bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
22.98k stars 4.03k forks source link

bazel aquery --include_param_files does not work for CppCompile #23293

Open peakschris opened 1 month ago

peakschris commented 1 month ago

Description of the bug:

bazel aquery //cc_shared_lib/liba:liba_base --include_commandline --include_param_files should include expanded content of all param files in its output. However, for CppCompile actions, param files are not expanded.

Reproducer:

git clone https://github.com/peakschris/bazel-shared-lib-bug (ignore the repo name)
cd bazel-shared-lib-bug
bazel aquery //cc_shared_lib/liba:liba_base --include_commandline --include_param_files

Outputs:

Mnemonic: CppCompile
Target: //cc_shared_lib/liba:liba_base
Configuration: x64_windows-fastbuild
Execution platform: @platforms//host:host
ActionKey: e0e07bb49c999a0ca4edac19ff80b6ee70e220825d9aee65b055883e2d048762
Inputs: [cc_shared_lib/liba/fun.cpp, cc_shared_lib/liba/fun.h, cc_shared_lib/liba/liba_exports.h, cc_shared_lib/liba/liba_undef.h, external/bazel_tools~cc_configure_extension~local_config_cc/builtin_include_directory_paths_msvc]
Outputs: [bazel-out/x64_windows-fastbuild/bin/cc_shared_lib/liba/_objs/liba_base/fun.obj]
Environment: [PATH=<snip>, RUNFILES_MANIFEST_ONLY=1]
Command Line: c:\apps\MVS174\VC\Tools\MSVC\14.34.31933\bin\HostX64\x64\cl.exe \
    @bazel-out/x64_windows-fastbuild/bin/cc_shared_lib/liba/_objs/liba_base/fun.obj.params
# Configuration: cfcdc0c472480d5083db8bc3726bd13fed7c1092a36217c0be7b5630e2f35326
# Execution platform: @@platforms//host:host

Note, the params file is not expanded for the CppCompile action. The link action does include the expanded params file.

Which category does this issue belong to?

C++ Rules

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

No response

Which operating system are you running Bazel on?

Windows

What is the output of bazel info release?

bazel 7.3.1

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

No response

If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

comius commented 2 weeks ago

CppCompileAction is a special action. I believe this will be resolved once it is transformed into a regular Spawn action (something that has already been done for linking action).