<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/117451>117451</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc++][chrono] interaction with system tzdb on macos?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc++
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
h-vetinari
</td>
</tr>
</table>
<pre>
The tzdb in libc++ are currently disabled on osx
https://github.com/llvm/llvm-project/blob/3cecf17065919da0a7fa9b38f37592e5462c2f85/libcxx/src/experimental/tzdb.cpp#L51-L55
However, the code itself (unsurprisingly) works fine also on osx, and we've enabled (and tested) it in our distribution (minus the leap-second bits, which need `leap-seconds.list` that's not shipped by default).
Presumably, the problem is where to find the tzdb, especially with any degree of consistency across different OS versions. I would have assumed that -- over time -- Apple would start shipping the necessary `leap-seconds.list` in whatever ends up being symlinked behind `/usr/share/zoneinfo`.
However, rather than this file getting added, it seems now that even the `tzdata.zi` that libc++ is using
https://github.com/llvm/llvm-project/blob/3cecf17065919da0a7fa9b38f37592e5462c2f85/libcxx/src/experimental/tzdb.cpp#L675-L676
is getting removed? I noticed this when our tests started failing, and opened an [issue](https://github.com/actions/runner-images/issues/10793) on the repo where those images are mainained, where the information I got was
> It seems that Apple has stopped providing the time zone data file because, for macOS, the primary representation of time zone data is now in binary format, rather than this auxiliary text file.
Is that true @ldionne? I mean yes, people can download tzdata themselves, extract it somewhere and point to that, but given that it's already on the system, it seems to me that the system should provide what libc++ uses -- or vice versa -- that libc++ uses what the system provides.
Long-term, in our distribution, we'll end up pointing libc++ to our own `tzdata` as soon as the chrono bits move out of the static `libc++experimental.a` (which we cannot patch without creating security holes) and into the dylib. But because many users are already wanting to use the tzdb-enabled `<chrono>`, and libc++ is the last C++ stdlib that doesn't have full support, I'm also interested in making sure these bits work before that happens.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVs1u67oR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