Skip to content

fix: prefix pwd for compiler response file paths - #4216

Merged
UebelAndre merged 2 commits into
bazelbuild:mainfrom
KirillTim:kirilltim/prefix_pwd_for_compiler_response_files
Aug 24, 2026
Merged

UebelAndre merged 2 commits into
bazelbuild:mainfrom
KirillTim:kirilltim/prefix_pwd_for_compiler_response_files

Conversation

@KirillTim

@KirillTim KirillTim commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Our prebuilt clang ships with a compiler response file containing multiple -D switches.
While cc_toolchain already handles passing this file in our main build, we also need to pass it to clang invocations made inside Cargo.

Passing the response file directly is much simpler and more robust than reading the file and injecting its contents into the CXXFLAGS list.

Only the path to the response file is fixed. Its contents are left untouched and may be not resolved if contains execroot-relative paths. I believe it is still an positive improvement.

Tested:

bazel test //cargo/tests/cargo_build_script/cc_args_and_env:all

also extract _pwd_flags_* functions to a list to improve readability
Only the path to the response file is fixed. Its contents are left
untouched and may be not resolved if contains execroot-relative paths.
@KirillTim
KirillTim force-pushed the kirilltim/prefix_pwd_for_compiler_response_files branch from b2288e4 to be6e1b0 Compare August 9, 2026 04:13
@KirillTim

Copy link
Copy Markdown
Contributor Author

This PR is branched from #4215

@UebelAndre UebelAndre left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you!

@UebelAndre
UebelAndre added this pull request to the merge queue Aug 24, 2026
Merged via the queue into bazelbuild:main with commit 7c229c2 Aug 24, 2026
3 checks passed
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.

2 participants