Comments (7)
The Write::flush implementation for File uses the operating system dependent flush operation, for example std::sys::unix::File::flush, or std::sys::windows::File::flush. Those flush operations do... nothing. Both implementations just return Ok(()).
Jesus, this is a fkn disgusting interface. I thought flush called sync, based on the documentation:
Flush this output stream, ensuring that all intermediately buffered contents reach their destination
I guess I shouldn't be surprised since POSIX is also an abomination.
from ktra.
Specifically, it seems like the local index is working properly but not the remote index.
from ktra.
Somehow it seems that the actual content of the files does not get committed. I wonder if this has to do with some working directory stuff.
from ktra.
Alright I think i found it. Seems like the files were committed before they were even flushed to disk. I'll submit a PR.
from ktra.
@jean-airoldie, it seems like my ktra install is still committing empty files, even when using a branch with #21 merged. Here is what happens:
- Index is hosted on gitlab
- running
cargo publish --registry my-registry
works just fine. The crate is downloaded, and the metadata is committed to the local index repo. - The metadata file pushed to the remote index is empty, even though the metadata is very much in the local index repo.
- Running
git diff origin master
from the local index repo says there aren't any changes. - Adding a change manually to the local metadata file (say, adding whitespace or something) make the changes "appear" in the diff. The file can now be pushed and will appear non-empty in the remote index.
Any idea what could cause this? The branch I'm using to test this is here.
from ktra.
I can't say I have an idea since it's been a while, but I can tell you what my config is at least.
I'm using this fork https://github.com/jean-airoldie/ktra. I run the ktra server via systemd on a 3rd party VPS and the index is hosted privately on github.
ktra server
# /etc/systemd/system/ktra.service
[Unit]
Description=Ktra server
[Service]
ExecStart=/root/.cargo/bin/ktra # path to the compiled binary
WorkingDirectory=/etc/ktra/
[Install]
WantedBy=multi-user.target
# /etc/ktra/config.toml
[index_config]
remote_url = "https://github.com/jean-airoldie/ktra-index.git"
https_username = "*********************"
https_password = "**************************************************"
branch = "master" # make sure this is the branch that match your fork
git_email = "*********************************"
git_name = "ktra-server"
github index
{"dl":"http://<VSP_IP_HERE>:8000/dl","api":"http://<VPS_IP_HERE>:8000"}
local config
# Cargo.toml
publish = ["ktra"] # add this line to your cargo.toml to not accidentally publish on crates.io
# .cargo/config.toml
[net]
git-fetch-with-cli = true
[registries]
ktra = { index = "https://github.com/jean-airoldie/ktra-index.git" }
Lastly I'm running an IP whitelist on my VPS provider because I don't trust that this crate is secure.
from ktra.
Thanks @jean-airoldie. I figured out the problem. Turns out that flush
doesn't actually wait for the files to be fully written to disk. I submitted a PR: #36.
from ktra.
Related Issues (20)
- Delete versions / crates
- Add verbosity option to `ktra` command?
- Dependency listed incorrectly if it has aliased
- Announcement: About the development of Ktra in future HOT 4
- Error 404 when trying to publish without a token (should be 400) HOT 2
- git error: corrupted loose reference file: FETCH_HEAD when trying to mirror crates.io
- No push to remote repo HOT 2
- Renamed packages aren't usable HOT 2
- Downloading ktra's crates.io mirror may fail when tried from some Cargo versions
- Change error message for unauthorized push to show name or login
- Self contained docker stack
- Add auth feature to manage download crates HOT 4
- Add https for the server HOT 4
- [Maintenance] Publish 0.7.0 HOT 4
- Ktra panics when using Mongo db backend HOT 3
- Store crates on S3
- Ktra openid doesn't install via cargo HOT 2
- ktra 0.7.0 - Failed to build with "--no-default-features --features=secure-auth,db-mongo" and "--no-default-features --features=secure-auth,db-redis"
- feat: verdaccio equivalent
- cargo build fails HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ktra.