Skip to content

Why are response files expanded in osx_cc_wrapper? #421

@ParkMyCar

Description

@ParkMyCar

I'm trying to build a relatively large Rust project with rules_rust and LTO enabled on macOS, but the linking step fails with:

= note: external/llvm_toolchain/bin/cc_wrapper.sh: line 129: external/llvm_toolchain_llvm/bin/clang: Argument list too long

I enabled logging for rustc and I can see that it spills arguments to a response file, i.e.

INFO rustc_codegen_ssa::back::link falling back to passing arguments to linker via an @-file

But then it looks like osx_cc_wrapper (and FWIW the Linux version too) expands response files which ultimately leads to the "Argument list too long error". With how long Bazel files paths can be, and the way Rust parallelizes compilation with codegen units, the argument list can get long very quickly.

Is it possible to stop expanding response files? Or is there some reason that the wrapper needs to? Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions