icu4x
icu4x copied to clipboard
Continue testing public access to baked data APIs in CI
Currently the testdata-legacy CI job fails when there is baked data that tries to access a pub(crate) API. It is the only CI that fails in this condition:
https://github.com/unicode-org/icu4x/pull/4435
...
2023-12-09T02:10:36.9768608Z [cargo-make] INFO - Running Task: testdata-legacy-test
...
2023-12-09T02:11:01.0717938Z error[E0624]: associated function `from_time_granularity` is private
2023-12-09T02:11:01.0719524Z --> src/../data/baked/macros/datetime_buddhist_datelengths_v1.rs.data:2:1311
2023-12-09T02:11:01.0720440Z |
2023-12-09T02:11:01.0721603Z 2 | ... pattern :: runtime :: PatternMetadata :: from_time_granularity (icu_datetime :: pattern :: TimeGranularity :: None) , } , long : icu_...
2023-12-09T02:11:01.0723009Z | ^^^^^^^^^^^^^^^^^^^^^ private associated function
2023-12-09T02:11:01.0723710Z |
...
When we retire testdata we should continue testing for this condition, or else we may unintentionally land baked data APIs that don't work outside the crate.
CC @robertbastian
My initial instinct was that it's tested by https://github.com/unicode-org/icu4x/blob/main/docs/tutorials/crates/baked/src/main.rs, but that only tests a single key. It does serve as an example why the tutorials are not good semver tests though :)
#2570
This isn't semver, though, being public API, it is certainly related. This is about making sure that we export as pub and not pub(crate) any APIs that databake-generated output needs.