New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: define TZDIR for tzcode build #7186
Conversation
nixos (and probably some other distributives) place zoneinfo directory not in /usr/share (in /etc for example). TZDIR is set accordingly. Currently zoneinfo is looked for in /usr/share, disregarding TZDIR env variable. This commit adds compile definition for TZDIR if such env variable is defined. This fixes zoneinfo lookup for nixos. NO_CHANGELOG=build NO_DOC=build NO_TEST=build
60cc0df
to
c2ec986
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (see a small comment inline)
@@ -13,6 +13,10 @@ set(TZDATA_FULL_TARGET ${TZCODE_SOURCE_DIR}/${TZDATA_TARGET}) | |||
set(TZCODE_SRC ${PROJECT_SOURCE_DIR}/src/lib/tzcode) | |||
set(TZLUA_SRC ${PROJECT_SOURCE_DIR}/src/lua) | |||
|
|||
if(DEFINED ENV{TZDIR}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can evaluate ENV{TZDIR}
only once and then use variable with value. I'll not insist, it's up to you.
Backported to 2.10 as well. |
Both of the callbacks in the `print` wrapper are expected to be called, but `print` may throw errors, e.g., `print(setmetatable({}, {__tostring = error})`, so we need to call it in a protected environment and execute the 'after' callback even if `print` throws. Closes tarantool#8136 NO_CHANGELOG=<tarantoolgh-7186 was not released yet> NO_DOC=bugfix
Both of the callbacks in the `print` wrapper are expected to be called, but `print` may throw errors, e.g., `print(setmetatable({}, {__tostring = error})`, so we need to call it in a protected environment and execute the 'after' callback even if `print` throws. Closes #8136 NO_CHANGELOG=<gh-7186 was not released yet> NO_DOC=bugfix
Both of the callbacks in the `print` wrapper are expected to be called, but `print` may throw errors, e.g., `print(setmetatable({}, {__tostring = error})`, so we need to call it in a protected environment and execute the 'after' callback even if `print` throws. Closes tarantool#8136 NO_CHANGELOG=<tarantoolgh-7186 was not released yet> NO_DOC=bugfix
NixOS (and probably some other distributives) places
zoneinfo
directory not to/usr/share
, but rather in directory of a form/nix/store/izida45xkdjkejekje8282hdhdh6q3-tzdata-2022a/share/zoneinfo/
. In this case NixOS setsTZDIR
environment variable accordingly. Currently, in Tarantool we hardcode/usr/share/zoneinfo
as a location to use, disregardingTZDIR
env variable.This commit adds compile-time definition for
TZDIR
if such env variable defined, which allows to fix zoneinfo lookup in case of NixOS.