abseil / abseil/abseil-cpp

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

Offen
#1,378 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C++
Sterne
18.1k
Forks
3.2k
Ø Merge
20 Std. 36 Min.
Gemergte PRs (30 T.)
1

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.