Skip to content
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

No way to override crates in [patch] section #230

Open
jethrogb opened this issue Dec 16, 2018 · 2 comments
Open

No way to override crates in [patch] section #230

jethrogb opened this issue Dec 16, 2018 · 2 comments

Comments

@jethrogb
Copy link
Collaborator

jethrogb commented Dec 16, 2018

#228 always adds a [patch] section to Xargo's Cargo.tomls, but there is no way to override the crate it points to. It always uses the crate it find in rust-src, even if std or core itself is built using a path or git source. This leads to two different, incompatible, core crates in the dependency tree.

See #231 for more issues with git sources.

I've come up with 3 different approaches to fix this, not sure which one is best:

  1. If there is a std crate in the blueprint, compute ../tools/rustc-std-workspace-core from that path (or use the same git) and use that as the [patch].

  2. If there is a std crate in the blueprint, find the spec of the core dependency (how would this work if std is a git dependency?), then generate a rustc-std-workspace-core crate in the tempdir with that core. Then, use that temp crate as the [patch].

  3. Use the existing logic from Fix for latest nightly: need to add a patch section #228 to generate the [patch] by default. Let users specify their own [patch]es in Xargo.toml

@bjorn3
Copy link

bjorn3 commented Dec 16, 2018

+1 for letting users specify their own patches. Because I have to patch compiler_builtins I moved away from xargo in rust-lang/rustc_codegen_cranelift@1e5c6bc.

@jethrogb
Copy link
Collaborator Author

I added support for specifying [patch] in #235, but I still think it's weird/annoying you have to use that facility when specifying a git/path dependency for std and friends.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants