Skip to content

[ML] Add tzdata as test target requirement for Linux and MacOS #2771

Open
@valeriy42

Description

@valeriy42

In our instructions to build a dev environment, we mention that tzdata is required to run some unit tests that do data conversion. However, this instruction is easy to overlook, which leaves developers with failed test without an obvious reason or error message.

I suggest to add tzdata as a CMake requirement for building test targets that perform corresponding data time transformations (ml::core?). Unfortunately, tzdata is not a library or binary, but a system package. Nonetheless, we could check if the timezone databases exist in the typical system paths and output a meaningful error message if not.

For example:

find_file(TZDATA_FILE NAMES "UTC" PATHS "/usr/share/zoneinfo" "/usr/lib/zoneinfo")

if(NOT TZDATA_FILE)
    message(FATAL_ERROR "tzdata is not installed or not found. Please install tzdata on your system.")
else()
    message(STATUS "tzdata found.")
endif()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions