llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
26.82k stars 10.99k forks source link

libcxx tz unknown path to the IANA Time Zone Database #78218

Open trcrsired opened 5 months ago

trcrsired commented 5 months ago

/home/cqwrteur/Projects/myllvm/llvm-project/libcxx/src/tz.cpp:48:4: error: "unknown path to the IANA Time Zone Database" 48 | # error "unknown path to the IANA Time Zone Database" | ^

This macro is only available on linux, causing wasi to fail

JonChesterfield commented 2 months ago

Can work around with the cmake -D LIBCXX_ENABLE_TIME_ZONE_DATABASE=OFF.

I'm not sure that should be necessary, the cmake is guarded with

if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
  set(ENABLE_TIME_ZONE_DATABASE_DEFAULT ON)
else()
  set(ENABLE_TIME_ZONE_DATABASE_DEFAULT OFF)
endif()

though it looks like cmake in my case believes it's building Linux and WASI at the same time, so I'm setting the database off flag.

mordante commented 2 months ago

I'm not familiar with wasi. Does it provide time zone information. If so it would be nice to get a patch to add support for it.