Comments (9)
I think I see the problem now. Cargo is still seeing the original config.json
file, which is why it's trying to contact crates.io
. This is due to an issue with the changes brought in by Romt version 0.2.0.
Before version 0.2.0, Romt used only a single master
branch for the crates.io-index
, which left a small race condition during updates. Now there is a working
branch in which all changes to the index are made, following by downloading of the crates implied by these index changes, following by a final push of the index changes to the master
branch used by Cargo. The romt crate mark
command is responsible for publishing the changes in working
to the master
branch. But given the order of the steps in the instructions, there is no mark
operation following romt crate config
, so the config.json
changes aren't propagated to the master
branch. I hadn't seen this issue during testing because my config.json
changes had already been pushed to the master
branch.
To push the changes to master
, issue the command romt crate mark
(or any crate command containing a mark
operation, such as romt crate update
). This should convince Cargo to use your locally mirrored crates.
Also, you may want to delete the Cargo registry cache and clean the rand_test
workspace to see a complete re-download:
rm -rf ~/.cargo/registry/
cd rand_test
cargo clean
cargo fetch
I'll look into a more proper fix. Thanks for bringing this to my attention.
from romt.
I've released Romt 0.2.1, where romt crate config
automatically performs romt crate mark
to publish the configuration changes.
from romt.
To add, this is the error in nginx:
FastCGI sent in stderr: "Request not supported: '/var/www/html/git/crates.io-index/'" while reading response header from upstream, client: , server: , request: "GET /git/crates.io-index/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/fcgiwrap.socket:", host: "", referrer: "http:///git/"
from romt.
Hello, @ejbolt,
I suspect the romt crate config
step was skipped. Cargo uses the config.json
file in git/crates.io-index/
to point to the crates. The original config.json
(as seen in https://github.com/rust-lang/crates.io-index/blob/master/config.json) contains:
{
"dl": "https://crates.io/api/v1/crates",
"api": "https://crates.io"
}
This is how Cargo knows to contact the crates.io
server to download crates. The romt crate config
command updates config.json
and commits the change to your mirror of the crates.io-index
repository; by default, config.json
would be updated to use localhost:8000
, changing git/crates.io-index/config.json
to contain:
{
"dl": "http://localhost:8000/crates/{crate}/{crate}-{version}.crate",
"api": "http://localhost:8000/"
}
Testing with romt serve
is probably easiest, as the nginx configuration needs to be adjusted to match your paths, whereas romt serve
can be run from your mirror directory. If your config.json
was at fault, you can run romt crate config
to fix things.
from romt.
Also, I think your nginx error is because fcgiwrap
is not installed. On Ubuntu, it's installed via apt install fcgiwrap
. See https://www.nginx.com/resources/wiki/start/topics/examples/fcgiwrap/ for more information. Romt's README doesn't provide much information on the complex topic of nginx configuration (it's a bit out of scope for Romt's main purpose).
from romt.
Interesting,
I double checked with romt, serving on default port, and I'm able to fetch the index, but on downloading crates I still get the same issue of cargo trying to resolve crates.io. The crates are definitely there (testing by doing the rand_test example)
config.json has the proper IP (it is a network IP instead of localhost, but there's no firewall setup on either machine to interfere)
from romt.
That works! Probably need to tweak nginx to get it to work as well, but that's outside the scope of this program, as you stated.
Thank you for such a fast response, and thank you for this tool!
from romt.
Actually, disregard the nginx comment.... I removed the rewrite rules during debugging for some silly reason 😅
from romt.
Great! I'm glad you got it working :-)
from romt.
Related Issues (12)
- issue serving on offline laptop HOT 4
- Offline mirroring of a subset of crates.io HOT 1
- faield to download rustup in WSL HOT 2
- HTTP requests take a long time to process HOT 5
- The argument --keep-going does not seem to be working. I can't seem to get past one of the crates having a 403 forbidden Error. HOT 3
- The romt cannot be downloaded normally. HOT 5
- GIT_HTTP_BACKEND_SOURCES should be overwritable HOT 3
- Crate unpack error moving from Mac to Windows 10 HOT 5
- Case sensitive filesystems don't work? HOT 8
- What means ConnectTimeout('') and ReadTimeout('') ? HOT 3
- toolchain - nightly and stable mix/share targets HOT 2
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 romt.