Skip to content

Include transitive out directories when running rustc #3542

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

cameron-martin
Copy link
Contributor

@cameron-martin cameron-martin commented Aug 4, 2025

Previously only the out directories of build scripts that are direct dependencies were included when running rustc. This caused errors when linking when a transitive dependency's build script builds an archive into the out directory and adds a link argument to it via cargo::rustc-link-lib.

Now all out directories of transitive dependencies are collected into a depset and included as dependencies in the rustc compile action.

For some reason this test segfaults when running with bazel coverage. It runs locally fine, so I'm not sure what the issue is here. I've just disabled the test because I can't see how it'd be relevant to my change.

Previously only the out directories of build scripts that are direct dependencies were included when running rustc. This caused errors when linking when a transitive dependency's build script builds an archive into the out directory and adds a link argument to it via `cargo::rustc-link-lib`.

Now all out directories of transitive dependencies are collected into a depset and included as dependencies in the rustc compile action.
@cameron-martin
Copy link
Contributor Author

I have no idea why the test is segfaulting on OSX. I've ran this locally on an arm64 mac and it works fine.

I'm tempted to switch this to a build_test instead and not run it, because whether the test runs is inconsequential to this change.

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

Successfully merging this pull request may close these issues.

1 participant