Repository navigation
Do not add proc-macro deps to transitive_link_search_paths - #1424
Merged
krasimirgg merged 1 commit intoJul 13, 2022
Merged
Conversation
krasimirgg
force-pushed
the
transitive_link_search_paths
branch
from
June 28, 2022 09:17
0ea6a6c to
dec399c
Compare
krasimirgg
force-pushed
the
transitive_link_search_paths
branch
2 times, most recently
from
July 7, 2022 13:01
9c6d5d2 to
05cc179
Compare
krasimirgg
force-pushed
the
transitive_link_search_paths
branch
3 times, most recently
from
July 12, 2022 14:08
6d4286b to
4a2f4c7
Compare
krasimirgg
marked this pull request as ready for review
July 12, 2022 14:09
krasimirgg
force-pushed
the
transitive_link_search_paths
branch
2 times, most recently
from
July 12, 2022 14:22
61706a1 to
a99f261
Compare
krasimirgg
enabled auto-merge (squash)
July 12, 2022 14:22
scentini
approved these changes
Jul 13, 2022
scentini
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for adding some tests around link_search_path_files !!
krasimirgg
force-pushed
the
transitive_link_search_paths
branch
from
July 13, 2022 09:55
a99f261 to
4b9e150
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While working on #1420, which added a user-defined transition on the
depsattribute ofrust_proc_macro, I was hitting a strange//crate_universe:rustdoc_testfailure:https://buildkite.com/bazel/rules-rust-rustlang/builds/6631#01819625-365a-42fd-bb11-f3a95db9f999/280-523
It took me a while to figure out exactly what was going on, since the process_wrapper error doesn't mention the path to the missing file nor the context in which the failure had occurred.
The root cause of the issue was that link_search_path's for (transitive) dependencies of proc-macro's were being added to the process_wrapper invocation. When I changed the
cfgofrust_proc_macro.deps, these were pointing to a configuration-specific relative path starting with blaze-out/, likebazel-out/k8-opt-exec-2B5CBBC6-ST-fa1bc2ca6f16/bin/external/crate_universe_crate_index__proc-macro2-1.0.39/proc-macro2_build_script.linksearchpaths, which doesn't exist at test time (the "standard" deps link_search_path's are passed relative tobin/, e.g.,external/crate_universe_crate_index__blah-1.0.39/blah_build_script.linksearchpaths.I updated rules_rust to not add the link_search_paths for transitive deps of proc_macros and added some error logging to process_wrapper so errors like these are more evident. I believe this is reasonable since proc_macro's and their deps are not attempted to be linked into their clients, instead rustc dynamically loads them while compiling clients.
Required by #1420. Without this change, that PR fails tests, so that will act as a test for this in practice.