[libcxx-commits] [libcxx] [libcxx][test] Skip sys_info zdump test when zdump was built with 32 bit time_t (PR #103056)

David Spickett via libcxx-commits libcxx-commits at lists.llvm.org
Tue Aug 13 06:43:16 PDT 2024


================
@@ -352,6 +352,18 @@ def _mingwSupportsModules(cfg):
         name="has-no-zdump",
         when=lambda cfg: runScriptExitCode(cfg, ["zdump --version"]) != 0,
     ),
+    # zdump built with 32 bit time_t will truncate times into the 32 bit range.
+    # Starting with glibc 2.34, some architectures, like armhf, started building
+    # zdump with time_t as 64 bit which allows it to handle the maximum range.
+    # If zdump was built with time_t 64 bit, it will show the 1869 entries for
+    # this zone, which would be out of range for 32 bit.
+    Feature(
+        name="zdump-time_t-32bit",
+        when=lambda cfg: runScriptExitCode(
+            cfg, ["zdump -V -c1800,2100 Africa/Addis_Ababa | grep -q 1869"]
+        )
----------------
DavidSpickett wrote:

This will also return 1 if zdump is not present, which is a good thing for this check, but does overlap with `has-no-zdump` and would mean for example a Mac would get this feature despite not having zdump.

I'll see if there's some way to fix that, maybe a different exit code for zdump not existing. 

https://github.com/llvm/llvm-project/pull/103056


More information about the libcxx-commits mailing list