Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
osx_cc_wrapper: Only expand existing response files
Closes bazelbuild#13044 Applies the changes suggested in bazelbuild#13044 (comment) Not all arguments starting with `@` represent response files, e.g. `-install_name @rpath/...` or `-Xlinker -rpath -Xlinker @loader_path/...` do not refer to response files and attempting to read them as such will fail the build. Users don't always have control over these arguments, meaning transforming them to `-Wl,-install_name,@rpath/...` or `-Wl,-rpath,@loader_path/...` is not always an option. E.g. as described in bazelbuild#13044 (comment) where these flags are emitted by the Haskell compiler GHC (see bazelbuild#13044 (comment) for their reasoning). With this change `osx_cc_wrapper` will only interpret arguments starting with `@` as response files if the corresponding file exists and is readable. This is analogous to the behavior defined in `wrapped_clang.cc`. See bazelbuild#13044 (comment) for discussion. Closes bazelbuild#13148. PiperOrigin-RevId: 436207868
- Loading branch information