-
Notifications
You must be signed in to change notification settings - Fork 721
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
Add unicode-case and unicode-perl features to the regex dependency #2566
Conversation
I don't believe this is quite sufficient. At least, it isn't for me when I run With that said, an alternative here is to not add any new features and tweak the regexes so that they don't require huge Unicode tables. There are a couple ways of doing that, but here's one:
This patch results in all tests passing locally for me without adding any new regex crate features. Do note though that this does subtly change the semantics of what the regex matches. My intuition says this is probably fine here, but that's up to y'all to decide. :-) |
Workaround until tokio-rs/tracing#2566 fixes this.
#2566 (comment) ## Motivation Missing features for the `regex` crate was causing build time errors due to the the use of unicode characters in the regex without using the proper features within the regex crate ## Solution Refactor regex so that no external feature are required, but regex is still valid and tests still pass Authored-by: Devin Bidwell <[email protected]>
The force push above is the 3 commits squashed into one |
you don't need to force-push; we squash on merge. (I'm running CI and looking at this PR now.) |
Yeah those tests were failing on my end as well. Not sure why, untouched by me. |
@BurntSushi Out of curiosity, what is the subtle change? It's disabling unicode case folding? |
I'm not entirely sure why the UI tests started failing all. Digging into it. |
@davidbarsky The change is that your regex matches fewer strings than it did before. So you're fine there. But So if you specifically wanted The sad thing is that you'll still have a dependency on |
Gotcha, thanks for explaining this! I'm not especially good at understanding regexes 😅 |
Aye. If it's any consolation this is less about regexes and more about the intersection of regexes and Unicode. It's a difficult beast to tame! |
So it sounds like it might actually be best to enable the features instead of refactor the original regexes? |
(@dbidwell94 That question I can't answer. I just wanted to put the tweaked regex out there as an alternative. It's up to y'all which behavior you want.) |
From a user perspective I doubt Unicode even makes sense here. In Rust you cannot name functions with non-ASCII characters so there should be no real-world use case where one wants to enable specific log level for some weird path. |
We'll end up enabling the feature for now and refactoring the regex later. |
…ode-perl' features to the regex dependency
Also, the case-insensitivity is being used for the part of the regex which parses the name of the log level, rather than the module path. The log levels themselves are the strings "trace", "debug", "info", "warn", "error", and "off", which should always be ASCII... |
Let's get a release out with this change, and then revisit refactoring the regex later! |
@hawkw Not quite sure why those tests are failing. @davidbarsky said he was going to look into it. |
These are UI tests for proc-macro error output. My guess is that they are failing because the compiler's error output changed somewhat on the latest stable version. @davidbarsky, we can probably fix these by running the UI tests with |
@hawkw Worked for me locally. Committing and pushing now. |
Head branch was pushed to by a user without write access
PR which fixes the UI tests (will need to be force merged as the build will fail due to missing regex features) |
… dependency (#2566) ## Motivation Missing features for the `regex` crate were causing build time errors due to the the use of unicode characters in the regex without using the proper features within the regex crate ## Solution Add the missing feature flags. Fixes #2565 Authored-by: Devin Bidwell <[email protected]>
… dependency (#2566) ## Motivation Missing features for the `regex` crate were causing build time errors due to the the use of unicode characters in the regex without using the proper features within the regex crate ## Solution Add the missing feature flags. Fixes #2565 Authored-by: Devin Bidwell <[email protected]>
… dependency (#2566) ## Motivation Missing features for the `regex` crate were causing build time errors due to the the use of unicode characters in the regex without using the proper features within the regex crate ## Solution Add the missing feature flags. Fixes #2565 Authored-by: Devin Bidwell <[email protected]>
# 0.3.17 (April 21, 2023) This release of `tracing-subscriber` fixes a build error when using `env-filter` with recent versions of the `regex` crate. It also introduces several minor API improvements. ### Fixed - **env-filter**: Add "unicode-case" and "unicode-perl" to the `regex` dependency, fixing a build error with recent versions of `regex` (#2566) - A number of minor documentation typos and other fixes (#2384, #2378, #2368, #2548) ### Added - **filter**: Add `fmt::Display` impl for `filter::Targets` ([2343) - **fmt**: Made `with_ansi(false)` no longer require the "ansi" feature, so that ANSI formatting escapes can be disabled without requiring ANSI-specific dependencies (#2535) ### Changed - **fmt**: Dim targets in the `Compact` formatter, matching the default formatter (#2409) Thanks to @keepsimple1, @andrewhalle, @LeoniePhiline, @LukeMathWalker, @howardjohn, @daxpedda, and @dbidwell94 for contributing to this release!
# 0.3.17 (April 21, 2023) This release of `tracing-subscriber` fixes a build error when using `env-filter` with recent versions of the `regex` crate. It also introduces several minor API improvements. ### Fixed - **env-filter**: Add "unicode-case" and "unicode-perl" to the `regex` dependency, fixing a build error with recent versions of `regex` (#2566) - A number of minor documentation typos and other fixes (#2384, #2378, #2368, #2548) ### Added - **filter**: Add `fmt::Display` impl for `filter::Targets` (#2343) - **fmt**: Made `with_ansi(false)` no longer require the "ansi" feature, so that ANSI formatting escapes can be disabled without requiring ANSI-specific dependencies (#2532) ### Changed - **fmt**: Dim targets in the `Compact` formatter, matching the default formatter (#2409) Thanks to @keepsimple1, @andrewhalle, @LeoniePhiline, @LukeMathWalker, @howardjohn, @daxpedda, and @dbidwell94 for contributing to this release!
Fixes trunk-rs#534, resolved by tokio-rs/tracing#2566.
Fixes trunk-rs#534, resolved by tokio-rs/tracing#2566.
`sea-orm-migration` 0.11.2 pulls in a version of `tracing-subscriber` with a bug that stops migrations from working. See [1], [2], [3] for context. [1]: https://github.com/SeaQL/sea-orm/releases/tag/0.11.3 [2]: SeaQL/sea-orm#1608 [3]: tokio-rs/tracing#2566
`sea-orm-migration` 0.11.2 pulls in a version of `tracing-subscriber` with a bug that stops migrations from working. See [1], [2], [3] for context. [1]: https://github.com/SeaQL/sea-orm/releases/tag/0.11.3 [2]: SeaQL/sea-orm#1608 [3]: tokio-rs/tracing#2566
Fixes trunk-rs#534, resolved by tokio-rs/tracing#2566.
This release of `tracing-subscriber` fixes a build error when using `env-filter` with recent versions of the `regex` crate. It also introduces several minor API improvements. - **env-filter**: Add "unicode-case" and "unicode-perl" to the `regex` dependency, fixing a build error with recent versions of `regex` (tokio-rs#2566) - A number of minor documentation typos and other fixes (tokio-rs#2384, tokio-rs#2378, tokio-rs#2368, tokio-rs#2548) - **filter**: Add `fmt::Display` impl for `filter::Targets` (tokio-rs#2343) - **fmt**: Made `with_ansi(false)` no longer require the "ansi" feature, so that ANSI formatting escapes can be disabled without requiring ANSI-specific dependencies (tokio-rs#2532) - **fmt**: Dim targets in the `Compact` formatter, matching the default formatter (tokio-rs#2409) Thanks to @keepsimple1, @andrewhalle, @LeoniePhiline, @LukeMathWalker, @howardjohn, @daxpedda, and @dbidwell94 for contributing to this release!
# 0.3.17 (April 21, 2023) This release of `tracing-subscriber` fixes a build error when using `env-filter` with recent versions of the `regex` crate. It also introduces several minor API improvements. ### Fixed - **env-filter**: Add "unicode-case" and "unicode-perl" to the `regex` dependency, fixing a build error with recent versions of `regex` (tokio-rs#2566) - A number of minor documentation typos and other fixes (tokio-rs#2384, tokio-rs#2378, tokio-rs#2368, tokio-rs#2548) ### Added - **filter**: Add `fmt::Display` impl for `filter::Targets` (tokio-rs#2343) - **fmt**: Made `with_ansi(false)` no longer require the "ansi" feature, so that ANSI formatting escapes can be disabled without requiring ANSI-specific dependencies (tokio-rs#2532) ### Changed - **fmt**: Dim targets in the `Compact` formatter, matching the default formatter (tokio-rs#2409) Thanks to @keepsimple1, @andrewhalle, @LeoniePhiline, @LukeMathWalker, @howardjohn, @daxpedda, and @dbidwell94 for contributing to this release!
Regex parse error
Motivation
tracing-subscriber-0.3.16\src\filter\env\directive.rs:140:10
fails to parse regex in certain casesSolution
Refactor referenced regex so that
unicode-case
andunicode-perl
is not required.