-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Make host_root return host.root(), not host.dest() #8819
Conversation
Also create host_dest function to let other callsites retain their old functionality
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Nah this looks great, thanks! Would it be possible to add a test of some form for this as well? |
Thanks! Do you think you could add a test for this? It would probably go in I'm a little uncertain what exactly the issue is, though. Is there a command I can run in the |
There's a bit of setup before you can build There's a few fiddly dependency bugs, but theoretically, from a clean build, running Then, follow the logic of #8817 to see how that path in that file leads to this change. It certainly is a massive and bizzarely-set-up project, though (building a compiler and using it requires shenanigans), which obscures things a bit.
Yeah! |
Oh, I just realized, cargo itself doesn't consume the incorrect cargo/src/cargo/core/compiler/output_depinfo.rs Lines 16 to 23 in becb4c2
In any case, test written! fails before this commit, succeeds afterwards. edit: also, if you'd like, feel free to ping me on Embark discord, rust-gpu channel, or the rust-lang zulip (I'm either "Ashley Hauck" or khyperia, I forget), if you'd like to poke around what utterly cursed things we're doing to cargo in rust-gpu, and perhaps ways we could do things better. (I'm guessing there might be questions around why we're consuming cargo dep files into another cargo...). It's very similar to the wasm problem of "an x86 crate wants to reference a wasm crate and embed the binary in itself to use it", except spir-v, not wasm, and we need to build the compiler backend for spir-v too. |
Looks good, thanks! @bors r+ |
📌 Commit 628f701 has been approved by |
☀️ Test successful - checks-actions |
Update cargo 7 commits in becb4c282b8f37469efb8f5beda45a5501f9d367..d5556aeb8405b1fe696adb6e297ad7a1f2989b62 2020-10-28 16:41:55 +0000 to 2020-11-04 22:20:36 +0000 - Implement weak dependency features. (rust-lang/cargo#8818) - Avoid some extra downloads with new feature resolver. (rust-lang/cargo#8823) - fix: remove install command `$`, for copying friendly (rust-lang/cargo#8828) - Bump `anyhow` dependency to `1.0.34` in `crates-io` crate (rust-lang/cargo#8826) - Normalize SourceID in `cargo metadata`. (rust-lang/cargo#8824) - vendor: correct the path to cargo config (rust-lang/cargo#8822) - Make host_root return host.root(), not host.dest() (rust-lang/cargo#8819)
Update cargo 7 commits in becb4c282b8f37469efb8f5beda45a5501f9d367..d5556aeb8405b1fe696adb6e297ad7a1f2989b62 2020-10-28 16:41:55 +0000 to 2020-11-04 22:20:36 +0000 - Implement weak dependency features. (rust-lang/cargo#8818) - Avoid some extra downloads with new feature resolver. (rust-lang/cargo#8823) - fix: remove install command `$`, for copying friendly (rust-lang/cargo#8828) - Bump `anyhow` dependency to `1.0.34` in `crates-io` crate (rust-lang/cargo#8826) - Normalize SourceID in `cargo metadata`. (rust-lang/cargo#8824) - vendor: correct the path to cargo config (rust-lang/cargo#8822) - Make host_root return host.root(), not host.dest() (rust-lang/cargo#8819)
Also create host_dest function to let other callsites retain their old functionality. Fixes #8817, verified it works on the original problem reported in the
rust-gpu
repo.I did two things here:
host_root
(which returnsself.host.dest()
) to behost_dest
. This has three callsites. I did this to make it more clear that it returns dest, not root.host_root
function (that returnsself.host.root()
). This means that the callsite that this PR is actually fixing doesn't show up in this diff :/ - but I thought it was more clear this way.(Also copied the example path docs over from
layout.rs
to hopefully avoid this mistake again in the future)I tried to look into if the other two callsites should actually be calling
host.root()
instead ofdest
, because I imagine the same mistake could have been made again, but it quickly grew out of my understanding (this is my first time in the cargo codebase). Feel free to let me know if they should also callhost.root()
too, and I can update them.Thanks! (oh gosh I have no idea what I'm doing, I hope this is right)
r? @alexcrichton