-
Notifications
You must be signed in to change notification settings - Fork 195
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
Updated regex-automata to 0.3 #3655
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is unclear to me whether data produced by [email protected]
is compatible with [email protected]
code. I couldn't find any migration documentation, and data stability is a property we require in ICU4X.
@@ -31,7 +31,7 @@ all-features = true | |||
[dependencies] | |||
displaydoc = { version = "0.2.3", default-features = false } | |||
icu_provider = { version = "1.2.0", path = "../../provider/core", features = ["macros"] } | |||
regex-automata = { version = "0.2", default-features = false } | |||
regex-automata = { version = "0.3", default-features = false, features = ["dfa-search", "dfa-build"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dfa-build
is only required in the cases where we currently require alloc
: serde_human
and datagen
We guarantee to be panic-free, and it is not clear to me from The safe solution here is to return There are more API incompatibilities in the builder code. You can run |
It is not. Normally you'll get an error, but I note that we've already had a discussion about this topic in the past. If you need serialized DFAs to work across multiple semver incompatible releases of
As for other stuff:
I think the first part of this is probably correct. I don't think I can guarantee that the set of errors will remain completely fixed within semver compatible releases. I would expect that any new error conditions that are added would be the result of new features that are added that would be disabled by default. For example, consider what would happen if the quit byte feature were added today after the Otherwise, turning a non-error case into an error case is something that I think would generally be considered a breaking change, unless it was fixing a bug. As far as anchors go, you should be fine there as long as you're search anchor configuration is consistent with your DFA builder configuration. For example, if you try to run an anchored search on a DFA that has only been configured for unanchored searches, then that will result in an error. Otherwise this isn't something that changes based on the haystack. Personally it feels like you'd be safe to call |
Thanks for clarifying, I'll close this PR then. We may consider upgrading to 0.3 in ICU4X 2.0, where we can do breaking data changes. |
To document, the next step should be to release a V2 version of the data structure. It's easier in 2.0 because then we can drop the old dependency; it's possible to do it sooner, but we'd keep the old dependency around for people who have old data. |
I think having both dependencies defeats the purpose, and making them optional gets really messy. |
Regex has released the new 0.3 regex-automata crate, used in icu-list, and I wanted to upgrade it, in order to reduce duplicate dependencies and no-longer-updated dependencies.
The only logic change is that now
start_state_forward()
can return an error, which the currentmatches_earliest_fwd_lazy()
function cannot propagate.Since the input is a static empty haystack, should I just call
expect()
on the error?Awaiting for that feedback before proposing the final solution.