-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[date] Add tz recipe as dependency and add windows compatibility with binary zic-compiled tzdb #21719
[date] Add tz recipe as dependency and add windows compatibility with binary zic-compiled tzdb #21719
Conversation
* Initial implementation adding tz recipe as a dependency * Apply patch from PR date#611 to add ability to specify tz database by environment variable and also enable the binary tz database to be parsed on windows * Deprecate use_system_tz_db in favour of "with_tzdb" option to handle all mutually exclusive options * Add with_db_format option to provide flexibility in how the tz recipe is consumed
For tracking, I've raised HowardHinnant/date#788 upstream for discussion of changes to the The author was also of the opinion that this may inhibit his attempts to encourage migration to C++20 chrono. Unfortunately, migration to C++20 chrono is not a perfect solution as:
In these cases, it's still necessary for projects to be able to provide On further research into what my implementation might look like, I discovered HowardHinnant/date#611 which provides close to the fewest possible changes required to introduce the core features that I conan-center-index needs to couple the For similar reasons above, my belief is that it's unlikely that these changes will be merged upstream (given that it was raised more than 3 years ago). My suggestion is that we incorporate these changes into the |
@uilianries I appreciate that there have been a number of CI related issues over the past week or two (and I suspect you're tracking the failure here as well) - I only have a macOS environment on which to test these changes for the moment (and docker for Linux), so I'm relying on the CI to provide feedback on Windows compatibility. Should I re-trigger the pipeline or is there something that you need to do on the backend? |
Hello @samuel-emrys!! Sorry about the CI situation, indeed we are babysitting the situation. Usually, we restart manually in CI (Jenkins), but also when marking a PR with On the user side, it's possible to enforce it, but we ask to avoid doing it frequently to avoid overloading the CI. To do it, you just need to "rebase" you branch by clicking on the update branch button: |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
* Add patches for v3.0.0 and v2.4.1 that hotfix the changes present in HowardHinnant/date#611 on to these older versions. This will allow all versions of date currently on CCI to utilise the tz package as a data source for the timezone database. Some additional modification of the build system was required in these patches to ensure a consistent interface across versions. Only the minimal changes necessary to introduce desired features were made, preserving deficiencies associated with older versions of date.
668f041
to
7a12d26
Compare
This comment has been minimized.
This comment has been minimized.
* Fix issue in existing patch in which a string to replace '/' with '\\' in windows paths was attempting to operate on either a string_view or a const string, which was causing compilation errors. This was rectified by making a copy of the string before modification.
Conan v1 pipeline ✔️All green in build 6 (
Conan v2 pipeline ✔️
All green in build 6 ( |
This is not ready to be merged. The tests are failing to read from the binary database, but not erroring appropriately. |
* Add tz recipe as a dependency to provide a way of easily consuming/maintaining and upgrading the timezone database * Apply patch from HowardHinnant/date#807 to add the ability to specify the tz database by environment variable * Deprecate `use_system_tz_db` in favour of `with_tzdb` option to handle all mutually exclusive options * Add `with_db_format` option to provide flexibility in how the tz package is consumed. This implementation superesedes conan-io#16285 and conan-io#21719. In the case of conan-io#21719, it turned out that HowardHinnant/date#611 was not mature enough to provide the ability for the date library to read zic-compiled binary variants of the tzdb on Windows. To take an iterative approach, this PR aims to extract the elements that worked from conan-io#21719, which was the use of an environment variable to inject the conan packaged tz database. Use of a binary database has been marked as an invalid configuration on Windows. This functionality can be added at a later date. This pull request is blocked on conan-io#21671, which packages the source database in the tz recipe and makes this the default configuration since this is the only database that can be parsed consistently on all major platforms. Closes conan-io#16204
I'm closing this in favour of #22294. The Windows binary database parser implemented in HowardHinnant/date#611 turns out not to be mature enough to be functional at this stage. I've pared this patch back, and submitted my own PR with just the modifications necessary to use an environment variable to inject the path to a tz database in HowardHinnant/date#807, which I've added a conan implementation for in #22294. The ability to read binary databases on Windows is an important consideration, but can be implemented in a future PR. |
use_system_tz_db
in favour ofwith_tzdb
option to handle all mutually exclusive optionswith_db_format
option to provide flexibility in how the tz package is consumedSpecify library name and version: date/3.0.1
This implementation supersedes #16285. It makes the following improvements:
date
to locate the tz database using theTZDATA
environment variable. This is an improvement over [date] Patch recipe to use tz recipe by default to obtain time zone database #16285, which hardcoded the path to the tz database within the binary, making it non-portable. Usage of environment variables here allows flexible runtime discovery of the tz database.** Is the most minimal change required to introduce the features we need to link the tz recipe with conan
** Sacrifices some semantic meaning/the build options that need to be enabled to provide desired features are not intuitive.
Closes #16204