bazelbuild / bazelbuild/bazel

Optionally disable tokenization for C++ defines etc.

Open
#21,500 2 comments 1 reaction 0 assignees View on GitHub
not stale P4 team-Rules-CPP type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the feature request:

Create a feature similar to `no_copts_tokenization` that would disable tokenization for `defines`/`local_defines` etc. See https://github.com/bazelbuild/bazel/issues/10859#issuecomment-596261495 for background.

### Which category does this issue belong to?

C++ Rules

### What underlying problem are you trying to solve with this feature?

Basically https://github.com/bazelbuild/bazel/issues/10859#issuecomment-596261495: right now it's surprising that preprocessor definitions need to be Bash-quoted even on Windows.

### Which operating system are you running Bazel on?

macOS

### What is the output of `bazel info release`?

release 7.0.2

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

### Have you found anything relevant by searching the web?

https://github.com/bazelbuild/bazel/issues/10859#issuecomment-596261495

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

`no_copts_tokenization` seems to be similar, just for `copts`.

Contributor guide

Open the contributing guide

Research direction

Start by reading the existing no_copts_tokenization behavior and the background discussion in issue #10859, then trace how defines and local_defines are tokenized. Done means providing an optional equivalent that prevents Bash-style tokenization for those attributes, with behavior confirmed for the reported macOS and Windows concern.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.