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

Fix ci breaking due to new dependencies and rustc changes (backport to master) #163

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion color-eyre/tests/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ fn test_panic_backwards_compatibility() {
.args(["run", "--example", "theme_test_helper"])
.arg("--no-default-features")
.args(&features)
.env("RUSTFLAGS", "-Awarnings")
.env("CARGO_FUTURE_INCOMPAT_REPORT_FREQUENCY", "never")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removes cargo printing an extra line on windows warning about a future incompatability in nom.

The cargo output is included in the panic test case as it invokes cargo run and looks at the output.

Since the report is colored with ansi-codes, it gets included in the test check

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    Finished dev [unoptimized + debuginfo] target(s) in 0.03s
     Running `target/debug/examples/theme_test_helper`
�[31mThe application panicked (crashed).�[0m
Message:  �[36m<non string panic payload>�[0m
Location: �[35mexamples/theme_test_helper.rs�[0m:�[35m37�[0m

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SPANTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   0: �[91mtheme_test_helper�[0m�[91m::�[0m�[91mget_error�[0m with �[96m�[3mmsg�[0m�[2m=�[0m"test"�[0m
      at �[35mexamples/theme_test_helper.rs�[0m:�[35m34�[0m

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  �[96m                              ⋮ 6 frames hidden ⋮                               �[0m
   7: �[32mstd::panic::panic_any�[0m�[90m::hd76a7f826307234c�[0m
      at �[35m/rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panic.rs�[0m:�[35m57�[0m
   8: �[91mtheme_test_helper::main�[0m�[90m::h767d3fd6c45048c8�[0m
      at �[35m/home/jlusby/git/yaahc/color-eyre/examples/theme_test_helper.rs�[0m:�[35m37�[0m
   9: �[32mcore::ops::function::FnOnce::call_once�[0m�[90m::hc5a1cd4127189dad�[0m
      at �[35m/rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/ops/function.rs�[0m:�[35m227�[0m
  �[96m                              ⋮ 15 frames hidden ⋮                              �[0m

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.

This is what we are checking against, note how it included the cargo output as well as the running output.

This has been an issue in the past wrt existing warnings, which was fixed by fixing the warnings.

This warning will fix itself in nom and we can not currently do anything about the warning

.output()
.expect("failed to execute process");
let target = String::from_utf8(output.stderr).expect("failed to convert output to `String`");
Expand Down Expand Up @@ -168,7 +170,7 @@ fn test_backwards_compatibility(target: String, file_name: &str) {
fn normalize_backtrace(input: &str) -> String {
input
.lines()
.take_while(|v| !v.contains("core::panic"))
.take_while(|v| !v.contains("core::panic") && !v.contains("theme_test_helper::main"))
.collect::<Vec<_>>()
.join("\n")
}
Expand Down
2 changes: 1 addition & 1 deletion eyre/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pyo3 = { version = "0.20", optional = true, default-features = false }
futures = { version = "0.3", default-features = false }
rustversion = "1.0"
thiserror = "1.0"
trybuild = { version = "1.0.19", features = ["diff"] }
trybuild = { version = "=1.0.83", features = ["diff"] }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed for #150 to pass

backtrace = "0.3.46"
anyhow = "1.0.28"
syn = { version = "2.0", features = ["full"] }
Expand Down
Loading