Skip to content

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

Open
KirillTim wants to merge 2 commits into
bazelbuild:mainfrom
KirillTim:kirilltim/prefix_pwd_for_compiler_response_files
Open

fix: prefix pwd for compiler response file paths#4216
KirillTim wants to merge 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

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
Author

This PR is branched from #4215

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