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

Avoid Win32 MAX_PATH issues by shortening cargo_build_script bin names #1006

Merged
merged 1 commit into from
Nov 4, 2021

Conversation

UebelAndre
Copy link
Collaborator

I'm running into issues on Windows where cargo_build_script targets are filing to find files. After an investigation, I've found the cause to be paths exceeding the Windows max path length limitation. This change would shorten the runfiles path, potentially keeping some runfiles paths within the 260 character cap

before:

C:\bzl\czfrdgju\execroot\cargo_bazel_examples\bazel-out\x64_windows-opt-exec-2B5CBBC6\bin\external\multi__libnghttp2-sys-0.1.7-1.45.0\libnghttp2-sys_build_script_.exe.runfiles\multi__libnghttp2-sys-0.1.7-1.45.0\nghttp2/lib/includes/nghttp2/nghttp2ver.h.in

after:

C:\bzl\czfrdgju\execroot\cargo_bazel_examples\bazel-out\x64_windows-opt-exec-2B5CBBC6\bin\external\multi__libnghttp2-sys-0.1.7-1.45.0\libnghttp2-sys_build_script_script_.exe.runfiles\multi__libnghttp2-sys-0.1.7-1.45.0\nghttp2/lib/includes/nghttp2/nghttp2ver.h.in

Understandably this doesn't solve for all issues since another target may exceed the character limit again, but every character counts and given that this hasn't been a huge issue, I suspect libnghttp2-sys might just be the extreme case (or we don't have many windows users).

Copy link
Collaborator

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

Sure :)

@UebelAndre UebelAndre merged commit e2f0fcc into bazelbuild:main Nov 4, 2021
@UebelAndre UebelAndre deleted the windows branch November 4, 2021 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants