Giter VIP home page Giter VIP logo

Comments (4)

mcorbin avatar mcorbin commented on August 17, 2024

I think this is a cargo issue.

The crates metadata are generated by Cargo. The key is indeed req in the alternative-registries rfc and in the cargo documentation (https://doc.rust-lang.org/cargo/reference/registries.html), but is version_req in the cargo nightly documentation: https://doc.rust-lang.org/nightly/cargo/reference/registries.html.

I'm able to fetch a crate from Meuse if the crate does not have dependencies. If a crate has a dependency, I should indeed replace version_req by req in the crate metadata to be able to fetch it.

I could transform version_req to req in Meuse, but I would like to know why Cargo is pushing the crate with version_req instead of req.

from meuse.

ian-p-cooke avatar ian-p-cooke commented on August 17, 2024

I looked at this a little more and I think what cargo publishes isn't intended to go directly to the git index. notice there's a format for an index entry that uses 'req' and another format for the body of a publish request that uses 'version_req'. You can see crates.io building a git dependency from the published data here: https://github.com/rust-lang/crates.io/blob/e2f20c70093a91169e8a654e2a87a035ae3a54a7/src/models/dependency.rs#L115 and it's setting 'req' of the dependency to 'version_req' of the published crate.

so... I think my title is wrong here... it's not just just the keyname that's different, it's the whole serialized object. But they're so similar that it happens to work with just renaming that key. very odd/lucky!

from meuse.

mcorbin avatar mcorbin commented on August 17, 2024

You are right. The format in the git repository should now be OK ;)

from meuse.

ian-p-cooke avatar ian-p-cooke commented on August 17, 2024

confirmed a fresh publish can be downloaded by another project using the private registry.

from meuse.

Related Issues (20)

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.