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

Fatal regex parse error coming from tracing-subscriber after updating #534

Closed
s1gtrap opened this issue Apr 21, 2023 · 9 comments
Closed

Comments

@s1gtrap
Copy link
Contributor

s1gtrap commented Apr 21, 2023

I tried updating my install with cargo install --force trunk as I noticed an issue was fixed on master. Now it always errors with a regex parse error from tracing-subscriber..

This sucks especially as it worked fine before I tried updating AND it also works fine on my local git clone (even added some tests that were missing), but now no matter what version I try to install (back to ^0.15) it always fails as mentioned earlier.

Even if I discard all of my .zshrc changes

s1g@Coy ~ % env
TERM_SESSION_ID=w0t2p0:622BF19F-D4E7-48F5-BE5D-32598D2AB160
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.fKsl6B7xAZ/Listeners
LC_TERMINAL_VERSION=3.4.15
COLORFGBG=15;0
ITERM_PROFILE=s1g
XPC_FLAGS=0x0
PWD=/Users/s1g
SHELL=/bin/zsh
__CFBundleIdentifier=com.googlecode.iterm2
LC_CTYPE=UTF-8
TERM_PROGRAM_VERSION=3.4.15
TERM_PROGRAM=iTerm.app
PATH=/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/s1g/.cargo/bin
LC_TERMINAL=iTerm2
COLORTERM=truecolor
COMMAND_MODE=unix2003
TERM=xterm-256color
HOME=/Users/s1g
TMPDIR=/var/folders/14/w1_h_p_53393wdwbd_g528sw0000gn/T/
USER=s1g
XPC_SERVICE_NAME=0
LOGNAME=s1g
ITERM_SESSION_ID=w0t2p0:622BF19F-D4E7-48F5-BE5D-32598D2AB160
__CF_USER_TEXT_ENCODING=0x0:0:0
SHLVL=1
OLDPWD=/Users/s1g
EDITOR=vim
HOMEBREW_PREFIX=/opt/homebrew
HOMEBREW_CELLAR=/opt/homebrew/Cellar
HOMEBREW_REPOSITORY=/opt/homebrew
MANPATH=/opt/homebrew/share/man::
INFOPATH=/opt/homebrew/share/info:
_=/usr/bin/env
s1g@Coy ~ % which trunk
/Users/s1g/.cargo/bin/trunk
s1g@Coy ~ % trunk --version
trunk 0.16.0
s1g@Coy ~ % trunk build
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/s1g/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-subscriber-0.3.16/src/filter/env/directive.rs:140:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
zsh: abort      trunk build
@s1gtrap
Copy link
Contributor Author

s1gtrap commented Apr 21, 2023

Okay I just tested if it had anything to do with the --release flag:

s1g@Coy trunk % cargo run -- build
    Finished dev [unoptimized + debuginfo] target(s) in 0.09s
     Running `target/debug/trunk build`
Error: error taking canonical path to [build].target "index.html" in "/Users/s1g/trunk/Trunk.toml"

Caused by:
    No such file or directory (os error 2)
s1g@Coy trunk % cargo run --release -- build
    Finished release [optimized] target(s) in 0.09s
     Running `target/release/trunk build`
Error: error taking canonical path to [build].target "index.html" in "/Users/s1g/trunk/Trunk.toml"

Caused by:
    No such file or directory (os error 2)
s1g@Coy trunk % cargo install --path .
s1g@Coy trunk % trunk build
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/s1g/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tracing-subscriber-0.3.16/src/filter/env/directive.rs:140:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
zsh: abort      trunk build

It doesn't. When run locally it works fine, but as soon as I try to install it in .cargo/bin it fails.. what is happening!?

@s1gtrap
Copy link
Contributor Author

s1gtrap commented Apr 21, 2023

A workaround for the time being is running ~/trunk/target/release/trunk instead but this is ridiculous. For the record I'm on an M1 Mac w/ 13.1 and Rust 1.69.0.

@ondono
Copy link

ondono commented Apr 21, 2023

I see the same when trying to run trunk serve inside the official v1.69.0 docker image.

When using the workaround, I get lots of building errors during trunk serve anyway, but the process continues forward.

@101100
Copy link

101100 commented Apr 21, 2023

This appears to be related to this issue: rust-lang/regex#982

@101100
Copy link

101100 commented Apr 21, 2023

Looks like they updated tracing-subscriber to fix this issue: tokio-rs/tracing#2566

s1gtrap added a commit to s1gtrap/trunk that referenced this issue Apr 22, 2023
@s1gtrap
Copy link
Contributor Author

s1gtrap commented Apr 22, 2023

Yup!

--- a/Cargo.toml
+++ b/Cargo.toml
@@ -47,7 +47,7 @@ tokio-tungstenite = "0.17"
 toml = "0.5"
 tower-http = { version = "0.3", features = ["fs", "trace"] }
 tracing = "0.1"
-tracing-subscriber = { version = "0.3", features = ["env-filter"] }
+tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
 which = "4"
 zip = "0.6"

Followed by cargo install --path . fixed it for me!

Created a PR, I might as well close this then?

@s1gtrap s1gtrap closed this as completed Apr 22, 2023
@BurntSushi
Copy link

FYI, the likely reason why cargo install didn't work but cargo build did is because cargo install doesn't use the lock file by default where as cargo build will (assuming one is present). So if you had done cargo install --locked, that should have worked.

@101100
Copy link

101100 commented Apr 24, 2023

cargo install doesn't use the lock file by default

Thanks for sharing that tidbit. I didn't know cargo install worked that way. That explains why it was fixed by the release of tracing-subscriber even without the fix in this repo.

@BurntSushi
Copy link

Yeah it's a big pain point. I wish --locked was the default behavior (and I suspect most others do too), but I believe it isn't because of backcompat concerns.

s1gtrap added a commit to s1gtrap/trunk that referenced this issue Apr 25, 2023
s1gtrap added a commit to s1gtrap/trunk that referenced this issue Jun 4, 2023
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.

4 participants