icu4x icon indicating copy to clipboard operation
icu4x copied to clipboard

Continue testing public access to baked data APIs in CI

Open sffc opened this issue 1 year ago • 3 comments

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

sffc avatar Dec 12 '23 02:12 sffc

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 :)

robertbastian avatar Dec 12 '23 07:12 robertbastian

#2570

robertbastian avatar Dec 12 '23 09:12 robertbastian

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.

sffc avatar Dec 27 '23 20:12 sffc