Giter Club home page Giter Club logo

Comments (9)

drmikehenry avatar drmikehenry commented on June 16, 2024 2

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.

drmikehenry avatar drmikehenry commented on June 16, 2024 1

I've released Romt 0.2.1, where romt crate config automatically performs romt crate mark to publish the configuration changes.

from romt.

ejbolt avatar ejbolt commented on June 16, 2024

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.

drmikehenry avatar drmikehenry commented on June 16, 2024

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.

drmikehenry avatar drmikehenry commented on June 16, 2024

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.

ejbolt avatar ejbolt commented on June 16, 2024

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.

ejbolt avatar ejbolt commented on June 16, 2024

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.

ejbolt avatar ejbolt commented on June 16, 2024

Actually, disregard the nginx comment.... I removed the rewrite rules during debugging for some silly reason 😅

from romt.

drmikehenry avatar drmikehenry commented on June 16, 2024

Great! I'm glad you got it working :-)

from romt.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.