abseil / abseil/abseil-cpp

[Bug]: `absl/time` tests fail in Bazel when Abseil is an external dep

Ouverte
#1,378 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
C++
Étoiles
18.1k
Forks
3.2k
Merge moyen
20 h 36 min
PR mergées (30 j)
1

Description

### Describe the issue

If you include Abseil as a dependency in your Bazel WORKSPACE and attempt to run its tests, you will get failures in the following:

```
@com_google_absl//absl/time:time_test
@com_google_absl//absl/time/internal/cctz:time_zone_format_test
@com_google_absl//absl/time/internal/cctz:time_zone_lookup_test
```

The root cause is that the build targets for these tests specify,

```
env = {"TZDIR": "absl/time/internal/cctz/testdata/zoneinfo"}
```

E.g., see [here](https://github.com/abseil/abseil-cpp/blob/master/absl/time/BUILD.bazel#L86) for `time_test`. If I remove this line from the BUILD file, the test passes. The problem seems to be that `absl/time/internal/cctz/testdata/zoneinfo` is a relative path, and only correct if it's interpreted as relative to the abseil repository root.

See also discussion at https://github.com/bazelembedded/rules_cc_toolchain/pull/45#issuecomment-1413028774 and following.

### Steps to reproduce the problem

See description.

### What version of Abseil are you using?

Abseil LTS 20230125

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

Debian GNU/Linux rodete

### What compiler and version are you using?

Debian clang version 14.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/12
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/12
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

### What build system are you using?

bazel 6.0.0

### Additional context

_No response_

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.