Comments (3)
Oh shoot, I never noticed it downloaded crates case-sensitively. Since crates.io-index stores everything lowercase, I think it's fine to modify the creates directory to make everything lowercase.
As far as a non-breaking transition, that might be a bit tougher. The two options I can think of are:
- Run a one-time function to lowercase everything, and change
panamax serve
and the nginx config to lowercase the filename, - Only make future syncs download to lowercase files, and change
panamax serve
to try accessing normally, then as lowercase (since otherwise Linux would break, I think). I don't believe there's an nginx equivalent, but I'd be okay dropping that as a requirement.
Any thoughts on either of those two solutions?
from panamax.
Well, it's a little more complicated than I thought... And finally, I'm not sure that it really prevents panamax from serving crates, if the mirror has been made on a case insensitive filesystem. My problem occurred when I rsync from Linux to a Windows formatted external disk: crates/an
has been replaced by crates/An
.
cargo seems to use a URI with lowercase and uppercase characters. For example:
GET /crates/An/xi/Anxiety/0.0.0/Anxiety-0.0.0.crate
GET /crates/bv/e-/bve-native/0.0.0-Placeholder/bve-native-0.0.0-Placeholder.crate
e.g. in "http://mirror/crates/{prefix}/{crate}/{version}/{crate}-{version}.crate"
, prefix, crate and version use the lower and upper case characters found in the index entry. However, the entry is in an/xi/anxiety
file.
No easy solutions... Probably the best one is to change {prefix}
to {lowerprefix}
which seems to be added two years ago (ref) and to make the prefix part of the crates/
tree in lowercase. The crate name and its version will remain unchanged. It will work because package names are unique regardless of the case of the letters.
Dealing with case-insensitive filenames/filesystems is a pain. With Go modules, it's very complicated too: in the download uri, uppercase letters are replaced with an exclamation mark followed by the letter's lowercase equivalent: github.com/BurntSushi → github.com/!burnt!sushi 😐
from panamax.
So it looks like in crates.io-index
, all crate names are lowercase, but they have different casing in the names within the JSON. Additionally, as far as I can tell, there's no way to register a crate of the same name with differing case.
In that case (pun not intended), it should be just a matter of downloading every crate as lowercase, and modifying warp to lowercase all URLs.
As an aside, it's strange that {lowerprefix}
exists, but not {lowercrate}
.
from panamax.
Related Issues (20)
- wrong paths / urls HOT 7
- Adjust the vendor directories being tracked (over time) HOT 2
- A way to serve the documentation for crates.io?
- Please add selective syncing HOT 4
- Unable to complete downloading crates HOT 3
- Crate whitelisting HOT 1
- Cargo vendor failed using mirror repository
- could not resolve host:panamax.internal HOT 6
- [feature request] panamax publish my-mirror
- on Docker - error creating server listener: Address family not supported by protocol HOT 1
- not a git repository error
- how to masquerade as crates.io HOT 1
- [Enquiry] How big the full mirror is? HOT 3
- [Question] Can I start sync while the panamax is serving? HOT 2
- How do I download WASI and WASM targets ?
- [BUG] inconsistent state may occur HOT 4
- Mirroring Vendored Crates HOT 1
- No config.json HOT 4
- Unable to `cargo search` against panamax mirror HOT 2
- [Question] Use S3/minio to host /mirror? HOT 3
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 panamax.