-
Notifications
You must be signed in to change notification settings - Fork 8
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
Using --extern
is apparently not equivalent to --sysroot
#40
Comments
Hmm what happens if you pass an empty sysroot? (See #31 where it mentions that). Perhaps there is an issue of search priority? |
Ouch. Looks like this stems from rust-lang/rust#54658 (comment). @Ericson2314 redirecting I don't really understand why they are not allowed to shadow. Might be good to better understand that (and why sysroot is allowed to be shadowed but not |
@petrochenkov can you explain why a macro-expanded For context, this project is to add standard library support to Cargo. My original strategy was to use |
@ehuss The shadowing restriction can be relaxed (by using |
Hm so now this is sort of an interesting question. I think that we want Now the "solution" to this is probably to use So I think that our main goal should be parity between "normal mode" and I think the best way forward, in general, is to "basically do the same thing" as rust-lang/rust. I think that we should use |
Using I was originally thinking Hm, it's a bit unfortunate, but I can't think of better options. |
My current thinking is we should do one of two things:
I'm a fan personally of avoiding rustc changes if we can, but you're probably not wrong in that this is a much easier rustc change than a Cargo change. I was sort of hoping we could "just change the |
@alexcrichton I've been blocked for a while trying to think of a way to get the mock test suite to work. The fundamental problem is that there are duplicate |
Oh dear yeah I can see where that would cause problems. Want to gist what you've got and I can try to poke around? It may be that "mock std" either fundamentally no longer works or we can add |
Here is a work-in-progress (no test changes): ehuss/cargo@1ed8760 I've been trying a variety of things but keep hitting different problems. I was thinking of manually adding |
Not my proudest moment, but I think this does the trick - alexcrichton/cargo@dead4d0 |
Change build-std to use --sysroot This transitions build-std to use `--sysroot` instead of `--extern`. This is necessary because existing crates have a certain expectation of how standard library crates are exposed. It was intended that explicit dependencies in `Cargo.toml` would solve this problem, but I didn't really consider this would be a backwards-incompatible change, so using `--sysroot` is probably the best way to go, even though it's not ideal. Closes rust-lang/wg-cargo-std-aware#31 Closes rust-lang/wg-cargo-std-aware#40
Fixed in rust-lang/cargo#7421 |
|
Switch build-std to use --extern Switch `build-std` to use `--extern` flags instead of `--sysroot`. This is mostly a revert of #7421. It uses the new extern flag options introduced in rust-lang/rust#67074. It avoids modifying the extern prelude which was the source of the problem of rust-lang/wg-cargo-std-aware#40. Closes rust-lang/wg-cargo-std-aware#49 Reopens rust-lang/wg-cargo-std-aware#31
Testing out building a crate graph with
-Z build-std=std,alloc
(note that the need to passalloc
is a separate bug) ends up yielding:Sure enough this code:
fails to compile:
I'm not entirely sure the origin of this error, but it seems that we either need to:
--sysroot
The text was updated successfully, but these errors were encountered: