Skip to content
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

Fix argfile length rustc bug (Windows) #2116

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

timbess
Copy link

@timbess timbess commented Aug 15, 2023

Fix rustc bug on windows by symlinking all transitive deps into a linked directory. This only affects windows because rustc uses an environment variable to track all the paths passed as -Ldependency= on that platform and it silently overflows causing "no such crate" errors when compiling rust projects with large transitive dependency trees.

@timbess timbess force-pushed the fix-windows-rustc-bug branch 2 times, most recently from 6181dfa to c3e6716 Compare August 16, 2023 14:50
Copy link
Collaborator

@UebelAndre UebelAndre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This seems reasonable to me but it seems that some test need to be updated in order to land this

(15:02:04) ERROR: C:/b/bk-windows-zh48/bazel/rules-rust-rustlang/test/unit/exports/BUILD.bazel:3:19: Analysis of target '//test/unit/exports:lib_exports_test' failed

Once they're updated I think it's mergable 😄

@timbess
Copy link
Author

timbess commented Aug 25, 2023

@UebelAndre Awesome! Yeah I need to come back to this and figure out why those tests fail. It looks like it expects the first action to always be some Rust artifact, but it's finding my symlinks instead? Not totally sure what's going on there.

@UebelAndre
Copy link
Collaborator

@UebelAndre Awesome! Yeah I need to come back to this and figure out why those tests fail. It looks like it expects the first action to always be some Rust artifact, but it's finding my symlinks instead? Not totally sure what's going on there.

that's what it looks like, the fix is probably to iterate over all actions and find the Rustc action. Maybe even assert you only found one.

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.

Long argsfile doesn't work properly on Windows
2 participants