[Bug]: `absl/time` tests fail in Bazel when Abseil is an external dep
- 主要語言
- C++
- 星號
- 18.1k
- 分支
- 3.2k
- 平均合併
- 20 小時 36 分鐘
- 30 天內合併 PR
- 1
描述
### 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_
貢獻指南
評估
這個 Issue 還沒有評估資料。