Skip to content
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

Creating icu_experimental crate #4564

Merged
merged 14 commits into from
Feb 1, 2024
Merged

Conversation

robertbastian
Copy link
Member

@robertbastian robertbastian commented Jan 31, 2024

Part of #4551

This contains compactdecimal, displaynames, relativetime, dimension, transliterate, and unicodeset_builder.

unitsconversion can be done once there are no outstanding PRs.

@@ -24,13 +24,15 @@ use zerovec::{VarZeroVec, ZeroVec};
/// </div>
pub struct Baked;

include!("../../../provider/datagen/tests/data/baked/macros.rs");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made this use the stub data until we can move it into experimental. It's singleton anyway.

@@ -45,7 +45,6 @@ buffer_provider = [
"icu_collator?/serde",
"icu_datetime?/serde",
"icu_decimal?/serde",
"icu_displaynames?/serde",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disabled displaynames FFI for now. We have to decide between pulling in all of experimental or not having it on FFI.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should still take part in DCE and I wouldn't want to forbid a component from having FFI only because it is in icu_experimental.

Also, we said that moving the code from icu_experimental into its own crate should be a no-op PR that puts the repo into a releasable state with the crate at stable, and we can't do that if we then need to add FFI bindings. We should start drafting the FFI bindings while the code is in icu_experimental.

I lean toward including it in icu_capi and probably also in icu::experimental

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to include it in icu_capi, but behind a experimental_components features (like in datagen), instead of one feature per module.

Regarding icu, I like the property that a module is either in icu or in icu_experimental, and that stabilisation moves it over. I also see value in removing the experimental feature from icu, we have too many features.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I retract what I said about icu::experimental. I think we should include it in icu_capi.

icu_displaynames = { workspace = true, features = ["datagen"], optional = true }
icu_relativetime = { workspace = true, features = ["datagen"], optional = true }
icu_transliterate = { workspace = true, features = ["datagen"], optional = true }
icu_unitsconversion = { workspace = true, features = ["datagen"], optional = true }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repo becomes releasable with this PR

@robertbastian robertbastian marked this pull request as ready for review January 31, 2024 17:07
Copy link
Member

@sffc sffc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Praise: Nice work keeping the diffs to a nice reviewable state

"experimental/unitsconversion",
"experimental/components",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or components/experimental? 🤷

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Soooo my thinking here is to move everything from components to the top level, and also move icu_experimental to the top level. It makes for a nicer GitHub page where our core crates are all listed out.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not move things other than experimental components without first discussing with the team. I think we should land this PR and we can always move around the experimental components again later. experimental/components seems approximately as reasonable as components/experimental

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes this wasn't thinking for this pr

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Soooo my thinking here is to move everything from components to the top level, and also move icu_experimental to the top level. It makes for a nicer GitHub page where our core crates are all listed out.

Hmm. I don't know if I'm a huge fan of this, I like the split we have right now.

icu_relativetime = { path = "../../experimental/relativetime" }
icu_transliterate = { path = "../../experimental/transliterate" }
icu_unicodeset_parse = { path = "../../experimental/unicodeset_parse" }
icu_experimental = { path = "../../experimental/experimental" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: did you need to manually update this file or was it auto-generated? Is there something that enforces this file being up to date?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manual. There's a comment on the top level Cargo toml that "enforces" this. Tutorials ci also breaks if you move or delete crates, however not if you add

experimental/components/Cargo.toml Outdated Show resolved Hide resolved
[dev-dependencies]
icu_locid = { path = "../../components/locid" }

[features]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: should we make each module in icu_experimental be feature-gated?

pub mod transliterate;
pub mod unicodeset_parse;

#[doc(hidden)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: We don't normally put the provider module in doc(hidden), though we could consider making them internal when we implement #4467

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well we have n provider modules in this crate, but Baked needs to be in crate::provider because the constructor macro expects that. We can reexport Baked in foo::provider to have it public?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine for crate::provider to behave as it normally does with baked data, and for the data structs to be defined in crate::foo::provider.

@@ -45,7 +45,6 @@ buffer_provider = [
"icu_collator?/serde",
"icu_datetime?/serde",
"icu_decimal?/serde",
"icu_displaynames?/serde",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I retract what I said about icu::experimental. I think we should include it in icu_capi.

Manishearth
Manishearth previously approved these changes Jan 31, 2024
Manishearth
Manishearth previously approved these changes Jan 31, 2024
Manishearth
Manishearth previously approved these changes Jan 31, 2024
@robertbastian
Copy link
Member Author

autosubmit=true

@@ -2,11 +2,11 @@
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed that you are moving personnames; there is a big PR which has been open for some months which I'm perpetually halfway through reviewing. (It's also there if you want to review it)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be a clean-enough move, and if it's been open for a few months it's not something I want to block on.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm gonna merge this PR and then update the personnames PR (#4050)

Comment on lines +125 to +126
# icu_experimental is not currently published
# exec --fail-on-error cargo run --release --manifest-path experimental/Cargo.toml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracking issue to re-enable this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The website one, when we don't require the same test to work against release and head?

@sffc sffc merged commit 7053d17 into unicode-org:main Feb 1, 2024
30 checks passed
@robertbastian robertbastian deleted the experimental branch February 6, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants