[C++] Vendored date library does not respect TZDIR environment variable
- Dominant language
- C++
- Stars
- 17.1k
- Forks
- 4.3k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 88
Description
The vendored Howard Hinnant date library hardcodes `/usr/share/zoneinfo` as the timezone database path in `discover_tz_dir()` (`cpp/src/arrow/vendored/datetime/tz.cpp`). It does not check the `TZDIR` environment variable, which is the POSIX standard mechanism for overriding this path.
This causes timezone operations to fail on non FHS Linux distributions such as NixOS, where `zoneinfo` resides under a non standard path like `/nix/store/.../share/zoneinfo`.
The upstream library also lacks `TZDIR` support
### Reproduction
On NixOS without a `TZDIR` patch:
```python
import pyarrow as pa
arr = pa.array([1], type=pa.timestamp("s", tz="America/New_York"))
# Fails: discover_tz_dir failed to find zoneinfo
```
### Expected Behavior
Arrow should check `TZDIR` before falling back to hardcoded paths, consistent with POSIX conventions and tools such as glibc, busybox, and Python's `zoneinfo` module.
### Component(s)
C++
Contributor guide
Assessment
This issue has not been assessed yet.