bazelbuild / bazelbuild/bazel

--cxxopt not passed to compilation actions inside a tree artifact

Open
#25,566 1 comment 0 reactions 1 assignee Claimed by @pzembrod View on GitHub
P2 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:

We have some code generation actions that generate a treeartifact full of .cxx files and these are passed into cc_library rules. This all works fine. However, if we add options to the compiler with --cxxopt, these options do not get passed to the compiler for compile actions for these generated .cxx files. The options *do* get passed for regular .cxx files.

As a workaround we can pass options using --copt and these do apply to the .cxx files inside the tree-artifact but this can cause other issues with other .c files if the option we need to pass is not compatible with c-compilation.

Thanks!

### Which category does this issue belong to?

_No response_

### 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`?

8.1.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` ?

```text

```

### 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

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.