elastic / elastic/ml-cpp

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

Open
#2,771 2 comments 0 reactions 0 assignees View on GitHub
>build v8.17.0
Dominant language
C++
Stars
157
Forks
67
Avg merge
12h 48m
Merged PRs (30d)
16

Description

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:
```CMake
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()
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.