-
Notifications
You must be signed in to change notification settings - Fork 506
ORC-1684: [C++] Find tzdb without TZDIR when in conda-environments #1882
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
Conversation
|
If desired, I can test this patch on conda-forge infrastructure (build a patched orc that's published in a separate channel, then run conda-forge/arrow-cpp-feedstock#1086 against that). |
|
Thanks for the fix! Do you have a JIRA account? I can assign this to you. |
h-vetinari
left a comment
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.
Thanks for the quick review!
Thanks for the fix! Do you have a JIRA account? I can assign this to you.
https://issues.apache.org/jira/secure/ViewProfile.jspa?name=h-vetinari
|
Would it be possible/acceptable to create a symlink in CI? I believe we could write a test that exercises the branch for Line 423 in b75dcaa
but it would need a working tzdb at the end of $CONDA_PREFIX/share/zoneinfo.
|
|
Ah, just found orc/cmake_modules/ThirdpartyToolchain.cmake Line 340 in b75dcaa
So I guess it should be there? |
|
Nevermind, it worked now after 5min... |
That is only used in WIN32 to make test pass on Windows... |
Well, then we could still test that the CONDA_PREFIX mechanics work on windows, no? See my last commit, which tries to do this. |
|
OK, so the test I added passed now: but restoring Since this is copied from |
|
Tests are passing on windows now! 🥳 |
|
This is all green now and should be ready for closer review. :) |
We can either use a different timezone to avoid caching or add a function to invalidate the cache. |
a431294 to
8752fa2
Compare
|
Sorry for the force-pushes; I had to figure out the right dates/times (which is a bit harder because we apparently need to specify them in UTC rather than local time; in the latter it would always be around 2/3am). |
|
OK, I think I'm done now from my side. This tests all the things I could think of as relevant. |
wgtmac
left a comment
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.
Thanks @h-vetinari for all your effort!
### What changes were proposed in this pull request? Find tzdb without having to set `TZDIR` when in a conda-environment (where `tzdata` [has](https://conda-metadata-app.streamlit.app/?q=conda-forge%2Fnoarch%2Ftzdata-2024a-h0c530f3_0.conda) a uniform location of `$CONDA_PREFIX/share/zoneinfo` across all platforms). ### Why are the changes needed? This is due to issues in arrow (see apache/arrow#36026) that cannot really be fixed there, as it assumes that orc >=2.0 knows how to find the tzdb. Having to set `TZDIR` in all user environments is an intrusive change that should be avoided, and since the cost here is checking a single environment variable, it's hopefully not too onerous for consideration. ### How was this patch tested? CI here ### Was this patch authored or co-authored using generative AI tooling? No CC wgtmac See also: #1587 Closes #1882 from h-vetinari/tzdb. Authored-by: H. Vetinari <[email protected]> Signed-off-by: Gang Wu <[email protected]> (cherry picked from commit e89ca33) Signed-off-by: Gang Wu <[email protected]>
|
Thanks a lot for the review and help here @wgtmac! 🙏 Would you consider including this in the 2.0.1 release? I'm probably going to backport this in conda-forge if not, but it would be nicer if it could be included in the release here directly; seeing that it's just about checking a single environment variable, I think the risk here is very low. |
|
Yes, I have already ported it to branch-2.0 and will be released in 2.0.1. |
|
Amazing, thanks a lot! 🤩 |
What changes were proposed in this pull request?
Find tzdb without having to set
TZDIRwhen in a conda-environment (wheretzdatahas a uniform location of$CONDA_PREFIX/share/zoneinfoacross all platforms).Why are the changes needed?
This is due to issues in arrow (see apache/arrow#36026) that cannot really be fixed there, as it assumes that orc >=2.0 knows how to find the tzdb. Having to set
TZDIRin all user environments is an intrusive change that should be avoided, and since the cost here is checking a single environment variable, it's hopefully not too onerous for consideration.How was this patch tested?
CI here
Was this patch authored or co-authored using generative AI tooling?
No
CC @wgtmac
See also: #1587