bazelbuild / bazelbuild/bazel

bazel aquery --include_param_files does not work for CppCompile

Open
#23,293 4 comments 2 reactions 0 assignees View on GitHub
P3 team-Rules-CPP type: bug
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### 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=, 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_

Contributor guide

Open the contributing guide

Research direction

Start with the provided bazel aquery command in the bazel-shared-lib-bug reproducer on Windows using Bazel 7.3.1. Compare the CppCompile output with the link action, focusing on why --include_param_files expands one action's params but not the other's. Done means CppCompile output includes the expanded parameter-file content and the behavior is covered by an appropriate regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.