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

[Merged by Bors] - Upgraded to ICU 1.2 #2826

Closed
wants to merge 3 commits into from
Closed

[Merged by Bors] - Upgraded to ICU 1.2 #2826

wants to merge 3 commits into from

Conversation

Razican
Copy link
Member

@Razican Razican commented Apr 15, 2023

This PR upgrades ICU to 1.2.

Unfortunately we still have some breaking changes, so this is being handled in unicode-org/icu4x#3332

@Razican Razican added this to the v0.17.0 milestone Apr 15, 2023
@jedel1043
Copy link
Member

Imported both deps directly. This is now just blocked on unicode-org/icu4x#3335

@jedel1043 jedel1043 added the blocked Waiting for another code change label Apr 15, 2023
@jedel1043
Copy link
Member

jedel1043 commented Apr 15, 2023

Just realized we can completely bypass the buffer and any constructors by using the unstable ones.
Just for the note, unstable does sound ominous, but I think we're in the clear, because BoaProvider unconditionally implements DataProvider<M> for all M: KeyedDataMarker, which means that any added or removed P: DataProvider<M> bounds on the constructors should never break our compilation... I think.

@sffc Can you either confirm or deny my assumptions? I can rollback to our old method if needed, just want to be sure since doing it this way simplifies our logic a lot.

@github-actions
Copy link

github-actions bot commented Apr 15, 2023

Test262 conformance changes

Test result main count PR count difference
Total 94,591 94,591 0
Passed 71,630 71,630 0
Ignored 17,634 17,634 0
Failed 5,327 5,327 0
Panics 0 0 0
Conformance 75.73% 75.73% 0.00%

@codecov
Copy link

codecov bot commented Apr 15, 2023

Codecov Report

Merging #2826 (f34e028) into main (4b72c06) will increase coverage by 0.00%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #2826   +/-   ##
=======================================
  Coverage   51.38%   51.38%           
=======================================
  Files         417      417           
  Lines       41330    41328    -2     
=======================================
  Hits        21238    21238           
+ Misses      20092    20090    -2     
Impacted Files Coverage Δ
boa_engine/src/context/icu.rs 39.58% <ø> (ø)

... and 3 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@jedel1043 jedel1043 removed the blocked Waiting for another code change label Apr 15, 2023
@sffc
Copy link

sffc commented Apr 16, 2023

@sffc Can you either confirm or deny my assumptions? I can rollback to our old method if needed, just want to be sure since doing it this way simplifies our logic a lot.

Yes, you have a blanket impl that leverages as_deserializing and as_downcasting, so you can use unstable constructors. The only catch is that the unstable constructors can't read from deprecated data keys, which we did for the first time in this release when we split the LocaleExpander key in three. So unless you regenerate your data, LocaleExpander will fail to construct. Using the non-unstable constructors allows you to use the old data key (they will map it for you internally).

impl<M> DataProvider<M> for BoaProvider<'_>
where
    M: KeyedDataMarker + 'static,
    for<'de> YokeTraitHack<<M::Yokeable as Yokeable<'de>>::Output>: Deserialize<'de>,
    for<'a> YokeTraitHack<<M::Yokeable as Yokeable<'a>>::Output>: Clone,
    M::Yokeable: ZeroFrom<'static, M::Yokeable> + MaybeSendSync,
{
    fn load(&self, req: DataRequest<'_>) -> Result<DataResponse<M>, DataError> {
        match self {
            BoaProvider::Buffer(provider) => provider.as_deserializing().load(req),
            BoaProvider::Any(provider) => provider.as_downcasting().load(req),
        }
    }
}

@jedel1043 jedel1043 added the blocked Waiting for another code change label Apr 16, 2023
@jedel1043
Copy link
Member

jedel1043 commented Apr 16, 2023

The only catch is that the unstable constructors can't read from deprecated data keys, which we did for the first time in this release when we split the LocaleExpander key in three.

Oh, that's pretty important, since I'd like to give our users the option to upgrade their dataset when they want, instead of forcing them to regenerate when we bump icu to the latest version. I'll rollback that change.

This is still blocked on that PR then.

@Razican
Copy link
Member Author

Razican commented Apr 16, 2023

I rebased this to the latest main branch and squashed commits. I also tried to "patch" cargo using the branch of the PR in ICU to see if it worked, but it seems that something is not quite right, probably some double-dependency. Let's wait for the 1.2.1 release, and then we can make this proper :)

@sffc
Copy link

sffc commented Apr 18, 2023

icu_locid_transform version 1.2.1 is released. This should unblock your upgrade

Cargo.toml Outdated
@@ -62,4 +62,4 @@ opt-level = 1
# Enables "fat" LTO, for faster benchmark builds
lto = "fat"
# Makes sure that all code is compiled together, for LTO
codegen-units = 1
codegen-units = 1
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
codegen-units = 1
codegen-units = 1

@Razican
Copy link
Member Author

Razican commented Apr 18, 2023

This looks good :) I would run a cargo update before merging (and should we re-generate the data file?), and add that end-of-file new line in Cargo.toml, but for the rest, I think we can merge it!

Thank you @sffc for your fast response!

@Razican Razican marked this pull request as ready for review April 18, 2023 07:48
Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

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

Ran datagen but git didn't detect any diff. Everything good!

Copy link
Member

@HalidOdat HalidOdat left a comment

Choose a reason for hiding this comment

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

Looks good to me! :)

@HalidOdat
Copy link
Member

bors r+

@bors
Copy link

bors bot commented Apr 18, 2023

👎 Rejected by label

@jedel1043 jedel1043 added dependencies Pull requests that update a dependency file Internal Category for changelog and removed blocked Waiting for another code change labels Apr 18, 2023
@jedel1043
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Apr 18, 2023
This PR upgrades ICU to 1.2.

Unfortunately we still have some breaking changes, so this is being handled in unicode-org/icu4x#3332


Co-authored-by: jedel1043 <jedel0124@gmail.com>
@bors
Copy link

bors bot commented Apr 18, 2023

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Upgraded to ICU 1.2 [Merged by Bors] - Upgraded to ICU 1.2 Apr 18, 2023
@bors bors bot closed this Apr 18, 2023
@bors bors bot deleted the icu_12 branch April 18, 2023 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file Internal Category for changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants