-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fresh install unable to install anything #3982
Comments
I get the same failure when using cargo update --verbose Caused by: Caused by: Platform: Windows 10 |
Yay. NUL is a reserved name. Other names to avoid / handle:
source: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx |
ping @alexcrichton @carols10cents not sure who else We probably need to delete this crate and add all of these windows reserved names to the list of reserved names in crates.io. |
Once nul is deleted I have a PR to reserve the names listed in @azriel91's post rust-lang/crates.io#695 |
@withoutboats Why wait? Make your PR sooner, for it better get some review before someone else has an idea to get famous quickly. |
@albel727 The PR is open (I linked to it), but I'm not sure what will happen if its deployed before |
What will happen is if there are any updates to the |
@withoutboats Ah, I thought it would be a PR against cargo itself. Nevermind me. |
Deploying to production of the crates.io pr starting now. |
This issue cannot be fixed by blacklisting crate names on crates. Cargo uses a trie, so you could always trigger the trie to break via things like uploading packages Unless I'm misunderstanding how the registry trie works. |
@Manishearth The trie is 2 letters, so a crate named |
All of the Windows names are 3 or 4 characters so it should be fine. |
If the directory scheme were to be changed, I'd recommend switching to using a hash of the name for the prefix directories; this leads to better distribution of files per directory. Too many things in a directory can have poor performance implications. |
With the current system you could trivially create a few million crates with a certain prefix and easily DOS anyone with a filesystem that doesn't handle that many files in a folder. |
Production deploy of crates.io done, and crate removed from the index. Please open new issues for any remaining problems. |
A more robust way to address these kinds of problems on Windows might be to do your own path normalization before calling any Win32 or C filesystem APIs. A fully qualified absolute path like |
@jckarter the error message seems to indicate that its during the git checkout that the issue occurs; not from within Cargo's own code. Perhaps there's an underlying issue with git / libgit? |
Ideally, the crates with reserved names should be banned. This should be trivial to add in the crates.io server. |
I don't think any names that some OS does not allow, should be banned. This is a Windows bug and not a problem with the crate name. |
@ticki That's exactly what we did. rust-lang/crates.io#695 |
We can't pass the buck on to windows like that. Yes, it is a windows bug. Windows won't change it and certainly not in a timeframe that solves the current breakage. It is our responsibility to fix it, regardless of the entity that can be blamed for the bug. Fixing a bug does not necessitate self-assigning fault for it. |
I think mangling could also be a solution here that preserves backwards compatibility. What if we mangled only names with a reserved words with a prefix? So "nul" becomes "--nul", or something similar? Then current and future versions of cargo can add these crates, and old versions of cargo miss out on a vanishingly small number of crates but also don't get borked by checking out the repository. |
Please open new issues for any new problems or discussions on further improvements |
...but GIT implemented Windows long paths @jckarter mentioned as far ago as 2014, pity no one tested it. https://www.brycevandyk.com/of-too-long-file-names-in-windows-and-git/ Wonder if [ab]using Git for package database was correct idea. It means that quirks of every single platform would be escalated into world-global Crates ban-list. Instead of fixing the platform "driver". In a sense, that was repeating that Microsoft "special CP/M names" escalation quirk.... |
Here is what I see with verbose. I get this trying to install clippy or rustfmt. I assume I would get it with other crates.
Updating registry
https://github.com/rust-lang/crates.io-index
error: [20/-1] Cannot checkout to invalid path '3/n/nul'
The text was updated successfully, but these errors were encountered: