rust-lang / wg-cargo-std-aware

Repo for working on "std aware cargo"
133 stars 8 forks source link

Does not work with vendoring #65

Closed raphaelcohn closed 3 years ago

raphaelcohn commented 3 years ago

In my workspace folder, I have a .cargo folder with a config file containing the following:-

[source.crates-io]
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor"

My workspace folder contains a Cargo.toml with a list of workspace members, eg

[workspace]
members = [
"context-allocator",
"linux-support"
]

This works fine; I occasionally vendor my sources when one of those members has a new dependency.

Issuing cargo build --release -Zbuild-std=panic_abort,std -Zbuild-std-features=panic_immediate_abort --target=x86_64-unknown-linux-musl from inside the workspace folder fails:

error: no matching package named `compiler_builtins` found
location searched: registry `https://github.com/rust-lang/crates.io-index`
required by package `std v0.0.0 (/Users/raph/.rustup/toolchains/nightly-2020-10-14-x86_64-apple-darwin/lib/rustlib/src/rust/library/std)`
Raphaels-Pro:workspace raph$ cargo build --release -Zbuild-std=panic_abort,std -Zbuild-std-features=panic_immediate_abort --target=x86_64-unknown-linux-musl

Moving the .cargo folder / getting rid of the config file means it works.

Now, this makes some sense - compiler_builtins hasn't been vendored. But how can I vendor it, if it is not a dependency?!

Perhaps with a fake crate and module, but that's not really a great solution.

ehuss commented 3 years ago

Thanks for the report! Vendoring is currently not support. Closing as a duplicate of #23.