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

tracing-subscriber depends on unicode case-insensitivity, but doesn't enable unicode-case feature #2573

Closed
jyn514 opened this issue Apr 24, 2023 · 4 comments · Fixed by rapiz1/rathole#247

Comments

@jyn514
Copy link
Contributor

jyn514 commented Apr 24, 2023

Bug Report

Version

; cargo tree -i tracing
tracing v0.1.37
├── example v0.1.0 (/Users/jyn/src/example)
└── tracing-subscriber v0.2.25
    └── example v0.1.0 (/Users/jyn/src/example)

Platform

Darwin jyns-MacBook-Pro 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar  6 20:59:28 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6000 arm64

Crates

tracing-subscriber

Description

Steps to reproduce:

  1. cargo add tracing@0.1.37 --no-default-features --features std
  2. cargo add tracing-subscriber@0.2.25
echo 'use tracing_subscriber::{EnvFilter, fmt, prelude::*};

fn main() {
    tracing_subscriber::registry()
    .with(fmt::layer())
    .with(EnvFilter::from_default_env())
    .init();
}' > src/main.rs
  1. RUST_LOG=info cargo run
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Syntax(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
regex parse error:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1: (?x)
 2:                 ^(?P<global_level>(?i:trace|debug|info|warn|error|off|[0-5]))$ |
                                          ^
 3:                  #                 ^^^.
 4:                  #                     `note: we match log level names case-insensitively
 5:                 ^
 6:                 (?: # target name or span name
 7:                     (?P<target>[\w:-]+)|(?P<span>\[[^\]]*\])
 8:                 ){1,2}
 9:                 (?: # level or nothing
10:                     =(?P<level>(?i:trace|debug|info|warn|error|off|[0-5]))?
11:                      #          ^^^.
12:                      #              `note: we match log level names case-insensitively
13:                 )?
14:                 $
15:                 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: Unicode-aware case insensitivity matching is not available (make sure the unicode-case feature is enabled)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
)', /Users/jyn/.local/lib/cargo/registry/src/index.crates.io-6f17d22bba15001f/tracing-subscriber-0.2.25/src/filter/env/directive.rs:167:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

As a workaround, cargo add regex --features unicode-case fixes the panic.

@hawkw
Copy link
Member

hawkw commented Apr 24, 2023

This is fixed in tracing-sobscriber 0.3.17 --- see also #2565.

@hawkw
Copy link
Member

hawkw commented Apr 24, 2023

Oh, I see that you're using an 0.2.x version of tracing-subscriber. Is there a reason you're not using 0.3.x?

We don't generally support older semver-incompatible versions of tracing-subscriber, so it's fairly unlikely that there will be a backport of the fix for this to v0.2 --- not because backporting would be particularly difficult, but we don't currently have infrastructure for releasing off of older versions.

@jyn514
Copy link
Contributor Author

jyn514 commented Apr 24, 2023

ah, gotcha! I don't recall why we're using 0.2, but I suspect it won't be too hard to upgrade. Thanks for the quick response :)

@jyn514 jyn514 closed this as completed Apr 24, 2023
@hawkw
Copy link
Member

hawkw commented Apr 24, 2023

My pleasure, glad I could help!

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 a pull request may close this issue.

2 participants