google / google/googletest

[Bug]: has_absl should default to true when using bzlmod

Open
#4,953 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
39.5k
Forks
10.9k
Avg merge
6d 13h
Merged PRs (30d)
1

Description

### Describe the issue

Currently, the documented method of printing values via `AbslStringify` only works if you set `-DGTEST_HAS_ABSL`. However, when using googletest from the BCR, this dependency is unconditional yet the define still defaults to off, pulling in the dependency but not actually using it.

### Steps to reproduce the problem

1. Add `bazel_dep(name = "googletest", version = "1.17.0.bcr.2")` to `MODULE.bazel`
2. Define a custom `AbslStringify` for a type.
3. Have a test fail using that type.
4. Be surprised when the wrong value is printed or compilation fails (depending on the type).

### What version of GoogleTest are you using?

googletest-1.17.0.bcr.2

### What operating system and version are you using?

macos 25.3.0

### What compiler and version are you using?

clang 19.1.3

### What build system are you using?

bazel 9.0.0

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the MODULE.bazel dependency and a custom AbslStringify, then trace the bzlmod/BCR configuration that controls GTEST_HAS_ABSL. Done means the define defaults to enabled for this setup and the failing test prints the custom value or compiles successfully without an extra flag.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.