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

Downgrade tracing-indicatif #496

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

DarkaMaul
Copy link
Contributor

Zizmor v1.2.2 installed via Cargo does not compile on ubuntu (works fine on MacOS though).
Example:

The problem stems from tracing-indicatif:

root@8c9cc7047c95:/zizmor# CARGO_TARGET_DIR=/tmp/cargo-install5wZQo3/ cargo install zizmor --version 1.2.2 --jobs=1
    Updating crates.io index
  Installing zizmor v1.2.2
    Updating crates.io index
     Locking 314 packages to latest compatible versions
      Adding github-actions-models v0.22.0 (available: v0.23.0)
warning: profile package spec `insta` in profile `dev` did not match any packages

        Did you mean `idna`?
warning: profile package spec `similar` in profile `dev` did not match any packages
   Compiling tracing-indicatif v0.3.9
error[E0277]: `OnceCell<String>` cannot be shared between threads safely
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tracing-indicatif-0.3.9/src/lib.rs:661:20
    |
661 |           ext.insert(IndicatifSpanContext {
    |  _____________------_^
    | |             |
    | |             required by a bound introduced by this call
662 | |             progress_bar: None,
663 | |             pb_init_settings: ProgressBarInitSettings::default(),
664 | |             parent_progress_bar: None,
...   |
669 | |             level,
670 | |         });
    | |_________^ `OnceCell<String>` cannot be shared between threads safely
    |
    = help: within `IndicatifSpanContext`, the trait `Sync` is not implemented for `OnceCell<String>`
    = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::OnceLock` instead
note: required because it appears within the type `indicatif::state::TabExpandedString`
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/indicatif-0.17.10/src/state.rs:354:17
    |
354 | pub(crate) enum TabExpandedString {
    |                 ^^^^^^^^^^^^^^^^^
note: required because it appears within the type `style::TemplatePart`
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/indicatif-0.17.10/src/style.rs:634:6
    |
634 | enum TemplatePart {
    |      ^^^^^^^^^^^^
note: required because it appears within the type `PhantomData<style::TemplatePart>`
   --> /rustc/9fc6b43126469e3858e2fe86cafb4f0fd5068869/library/core/src/marker.rs:753:12
note: required because it appears within the type `alloc::raw_vec::RawVec<style::TemplatePart>`
   --> /rustc/9fc6b43126469e3858e2fe86cafb4f0fd5068869/library/alloc/src/raw_vec.rs:76:19
note: required because it appears within the type `Vec<style::TemplatePart>`
   --> /rustc/9fc6b43126469e3858e2fe86cafb4f0fd5068869/library/alloc/src/vec/mod.rs:397:12
note: required because it appears within the type `style::Template`
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/indicatif-0.17.10/src/style.rs:466:8
    |
466 | struct Template {
    |        ^^^^^^^^
note: required because it appears within the type `ProgressStyle`
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/indicatif-0.17.10/src/style.rs:21:12
    |
21  | pub struct ProgressStyle {
    |            ^^^^^^^^^^^^^
note: required because it appears within the type `Option<ProgressStyle>`
   --> /rustc/9fc6b43126469e3858e2fe86cafb4f0fd5068869/library/core/src/option.rs:572:10
note: required because it appears within the type `ProgressBarInitSettings`
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tracing-indicatif-0.3.9/src/lib.rs:169:8
    |
169 | struct ProgressBarInitSettings {
    |        ^^^^^^^^^^^^^^^^^^^^^^^
note: required because it appears within the type `IndicatifSpanContext`
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tracing-indicatif-0.3.9/src/lib.rs:176:8
    |
176 | struct IndicatifSpanContext {
    |        ^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `ExtensionsMut::<'a>::insert`
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tracing-subscriber-0.3.19/src/registry/extensions.rs:87:29
    |
87  |     pub fn insert<T: Send + Sync + 'static>(&mut self, val: T) {
    |                             ^^^^ required by this bound in `ExtensionsMut::<'a>::insert`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `tracing-indicatif` (lib) due to 1 previous error
error: failed to compile `zizmor v1.2.2`, intermediate artifacts can be found at `/tmp/cargo-install5wZQo3/`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Downgrading to tracing-indicatif==0.3.8 hotfixes the problem.

@woodruffw
Copy link
Owner

Huh, I'm surprised this passed on CI when I bumped it. Thanks @DarkaMaul!

(We should probably switch the Warehouse CI to use the PyPI hosted build instead.)

@woodruffw woodruffw self-assigned this Jan 28, 2025
@woodruffw woodruffw added the dependencies Pull requests that update a dependency file label Jan 28, 2025
@woodruffw woodruffw merged commit 1719760 into woodruffw:main Jan 28, 2025
6 checks passed
@woodruffw woodruffw mentioned this pull request Jan 28, 2025
2 tasks
@woodruffw
Copy link
Owner

Triaged: tracing-indicatif itself didn't cause the failure here; there was a release of indicatif that accidentally made some APIs non-Sync: console-rs/indicatif#694

I'll re-bump this dep and constrain indicatif itself to newer, fixed versions.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants