Skip to content

Exclude development scripts from published package#257

Merged
pksunkara merged 3 commits intoeyre-rs:masterfrom
weiznich:exclude_scripts
Feb 20, 2026
Merged

Exclude development scripts from published package#257
pksunkara merged 3 commits intoeyre-rs:masterfrom
weiznich:exclude_scripts

Conversation

@weiznich
Copy link
Contributor

During a dependency review we noticed that the color-eyre crate includes various development scripts. These development scripts shouldn't be there as they might, at some point become problematic. As of now they prevent any downstream user from enabling the [bans.build.interpreted] option of cargo deny.

I opted for using an explicit include list instead of an exclude list to prevent these files from being included in the published packages to make sure that everything that's included is an conscious choice. I decided to apply the settings to all workspace crates to make sure it similar issues won't happen for the other crates in the future.

During a dependency review we noticed that the color-eyre crate includes various development scripts. These development scripts shouldn't be there as they might, at some point become problematic. As of now they prevent any downstream user from enabling the `[bans.build.interpreted]` option of cargo deny.

I opted for using an explicit include list instead of an exclude list to prevent these files from being included in the published packages to make sure that everything that's included is an conscious choice. I decided to apply the settings to all workspace crates to make sure it similar issues won't happen for the other crates in the future.
@weiznich
Copy link
Contributor Author

weiznich commented Feb 3, 2026

cc @pksunkara as you merged PR's here: Any chance to get your look at this?

Copy link
Contributor

@pksunkara pksunkara left a comment

Choose a reason for hiding this comment

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

I don't think I have permissions to force merge over test failures (even though they are caused by other issues).

But I will make this as approved in case they are fixed and then immediately merge this.

@pksunkara
Copy link
Contributor

Let me see if I can get them passing this week and send a PR. Since @Manishearth is also made a contributor, he can approve and we will be able to get the fixes merged.

@weiznich weiznich force-pushed the exclude_scripts branch 3 times, most recently from d3da905 to dc7db55 Compare February 3, 2026 14:12
@weiznich
Copy link
Contributor Author

weiznich commented Feb 3, 2026

Most of the CI should now pass.

The nightly CI is still broken as the backtrace format changed there, which breaks the following tests:

  • test_error_backwards_compatibility
  • test_panic_backwards_compatibility

These seem to try to verify that the backtrace in a specific format but exactly that format changes because the compiler now returns something different. Might be related to symbol mangling or something like that.

For reference for test_error_backwards_compatibility the test suite expects

   0: test

Location:
   tests/theme.rs:17

Error:
   0: error

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

   0: theme::get_error with msg="test"
      at tests/theme.rs:11

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 5 frames hidden ⋮                               
   6: theme::get_error::create_report::hdb41452bef3fc05d
      at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:17
   7: theme::get_error::{{closure}}::h739c7fe800e2d03f
      at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:25
   8: core::option::Option<T>::ok_or_else::hd8e670bbca63e94a
      at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/option.rs:954
   9: theme::get_error::h2f751f4927c6fecb
      at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:25
  10: theme::test_error_backwards_compatibility::hfc4be9f22c32535c
      at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:43

It currently gets


   0: test

Location:
   color-eyre/tests/theme.rs:17

Error:
   0: error

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

   0: theme::get_error with msg="test"
      at color-eyre/tests/theme.rs:11

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1: <color_eyre[ec0f10ba8de5c8f1]::config::EyreHook>::default<unknown>
      at /home/weiznich/Documents/rust/eyre/color-eyre/src/config.rs:1018
   2: <color_eyre[ec0f10ba8de5c8f1]::config::EyreHook>::into_eyre_hook::{closure#0}<unknown>
      at /home/weiznich/Documents/rust/eyre/color-eyre/src/config.rs:1068
   3: eyre[af12fe77a4e585e4]::capture_handler<unknown>
      at /home/weiznich/Documents/rust/eyre/eyre/src/lib.rs:616
   4: <eyre[af12fe77a4e585e4]::Report>::from_adhoc::<&str><unknown>
      at /home/weiznich/Documents/rust/eyre/eyre/src/error.rs:114
   5: <eyre[af12fe77a4e585e4]::Report>::msg::<&str><unknown>
      at /home/weiznich/Documents/rust/eyre/eyre/src/error.rs:70
   6: theme[5aa8bd985b945ba1]::get_error::create_report<unknown>
      at /home/weiznich/Documents/rust/eyre/color-eyre/tests/theme.rs:17
   7: theme[5aa8bd985b945ba1]::get_error::{closure#0}<unknown>
      at /home/weiznich/Documents/rust/eyre/color-eyre/tests/theme.rs:26
   8: <core[ea2bd7cd219b3eb9]::option::Option<core[ea2bd7cd219b3eb9]::option::Option<()>>>::ok_or_else::<eyre[af12fe77a4e585e4]::Report, theme[5aa8bd985b945ba1]::get_error::{closure#0}><unknown>
      at /home/weiznich/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:1369
   9: theme[5aa8bd985b945ba1]::get_error<unknown>
      at /home/weiznich/Documents/rust/eyre/color-eyre/tests/theme.rs:26
  10: theme[5aa8bd985b945ba1]::test_error_backwards_compatibility<unknown>
      at /home/weiznich/Documents/rust/eyre/color-eyre/tests/theme.rs:45
  11: theme[5aa8bd985b945ba1]::test_error_backwards_compatibility::{closure#0}<unknown>
      at /home/weiznich/Documents/rust/eyre/color-eyre/tests/theme.rs:43
  12: <theme[5aa8bd985b945ba1]::test_error_backwards_compatibility::{closure#0} as core[ea2bd7cd219b3eb9]::ops::function::FnOnce<()>>::call_once<unknown>
      at /home/weiznich/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250
  13: <fn() -> core[ea2bd7cd219b3eb9]::result::Result<(), alloc[d48b8b032ee4278d]::string::String> as core[ea2bd7cd219b3eb9]::ops::function::FnOnce<()>>::call_once<unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/core/src/ops/function.rs:250
  14: test[612faf4e26cc897b]::__rust_begin_short_backtrace::<core[ea2bd7cd219b3eb9]::result::Result<(), alloc[d48b8b032ee4278d]::string::String>, fn() -> core[ea2bd7cd219b3eb9]::result::Result<(), alloc[d48b8b032ee4278d]::string::String>><unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/test/src/lib.rs:663
  15: test[612faf4e26cc897b]::run_test_in_process::{closure#0}<unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/test/src/lib.rs:686
  16: <core[ea2bd7cd219b3eb9]::panic::unwind_safe::AssertUnwindSafe<test[612faf4e26cc897b]::run_test_in_process::{closure#0}> as core[ea2bd7cd219b3eb9]::ops::function::FnOnce<()>>::call_once<unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/core/src/panic/unwind_safe.rs:274
  17: std[8cc15e19e2a5acfa]::panicking::catch_unwind::do_call::<core[ea2bd7cd219b3eb9]::panic::unwind_safe::AssertUnwindSafe<test[612faf4e26cc897b]::run_test_in_process::{closure#0}>, core[ea2bd7cd219b3eb9]::result::Result<(), alloc[d48b8b032ee4278d]::string::String>><unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/std/src/panicking.rs:581
  18: std[8cc15e19e2a5acfa]::panicking::catch_unwind::<core[ea2bd7cd219b3eb9]::result::Result<(), alloc[d48b8b032ee4278d]::string::String>, core[ea2bd7cd219b3eb9]::panic::unwind_safe::AssertUnwindSafe<test[612faf4e26cc897b]::run_test_in_process::{closure#0}>><unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/std/src/panicking.rs:544
  19: std[8cc15e19e2a5acfa]::panic::catch_unwind::<core[ea2bd7cd219b3eb9]::panic::unwind_safe::AssertUnwindSafe<test[612faf4e26cc897b]::run_test_in_process::{closure#0}>, core[ea2bd7cd219b3eb9]::result::Result<(), alloc[d48b8b032ee4278d]::string::String>><unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/std/src/panic.rs:359
  20: test[612faf4e26cc897b]::run_test_in_process<unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/test/src/lib.rs:686
  21: test[612faf4e26cc897b]::run_test::{closure#0}<unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/test/src/lib.rs:607
  22: test[612faf4e26cc897b]::run_test::{closure#1}<unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/test/src/lib.rs:637
  23: std[8cc15e19e2a5acfa]::sys::backtrace::__rust_begin_short_backtrace::<test[612faf4e26cc897b]::run_test::{closure#1}, ()><unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/std/src/sys/backtrace.rs:166
  24: std[8cc15e19e2a5acfa]::thread::lifecycle::spawn_unchecked::<test[612faf4e26cc897b]::run_test::{closure#1}, ()>::{closure#1}::{closure#0}<unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/std/src/thread/lifecycle.rs:91
  25: <core[ea2bd7cd219b3eb9]::panic::unwind_safe::AssertUnwindSafe<std[8cc15e19e2a5acfa]::thread::lifecycle::spawn_unchecked<test[612faf4e26cc897b]::run_test::{closure#1}, ()>::{closure#1}::{closure#0}> as core[ea2bd7cd219b3eb9]::ops::function::FnOnce<()>>::call_once<unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/core/src/panic/unwind_safe.rs:274
  26: std[8cc15e19e2a5acfa]::panicking::catch_unwind::do_call::<core[ea2bd7cd219b3eb9]::panic::unwind_safe::AssertUnwindSafe<std[8cc15e19e2a5acfa]::thread::lifecycle::spawn_unchecked<test[612faf4e26cc897b]::run_test::{closure#1}, ()>::{closure#1}::{closure#0}>, ()><unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/std/src/panicking.rs:581
  27: std[8cc15e19e2a5acfa]::panicking::catch_unwind::<(), core[ea2bd7cd219b3eb9]::panic::unwind_safe::AssertUnwindSafe<std[8cc15e19e2a5acfa]::thread::lifecycle::spawn_unchecked<test[612faf4e26cc897b]::run_test::{closure#1}, ()>::{closure#1}::{closure#0}>><unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/std/src/panicking.rs:544
  28: std[8cc15e19e2a5acfa]::panic::catch_unwind::<core[ea2bd7cd219b3eb9]::panic::unwind_safe::AssertUnwindSafe<std[8cc15e19e2a5acfa]::thread::lifecycle::spawn_unchecked<test[612faf4e26cc897b]::run_test::{closure#1}, ()>::{closure#1}::{closure#0}>, ()><unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/std/src/panic.rs:359
  29: std[8cc15e19e2a5acfa]::thread::lifecycle::spawn_unchecked::<test[612faf4e26cc897b]::run_test::{closure#1}, ()>::{closure#1}<unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/std/src/thread/lifecycle.rs:89
  30: <std[8cc15e19e2a5acfa]::thread::lifecycle::spawn_unchecked<test[612faf4e26cc897b]::run_test::{closure#1}, ()>::{closure#1} as core[ea2bd7cd219b3eb9]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}<unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/core/src/ops/function.rs:250
  31: <alloc[d48b8b032ee4278d]::boxed::Box<dyn core[ea2bd7cd219b3eb9]::ops::function::FnOnce<(), Output = ()> + core[ea2bd7cd219b3eb9]::marker::Send> as core[ea2bd7cd219b3eb9]::ops::function::FnOnce<()>>::call_once<unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/alloc/src/boxed.rs:2206
  32: <std[8cc15e19e2a5acfa]::sys::thread::unix::Thread>::new::thread_start<unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/std/src/sys/thread/unix.rs:127
  33: start_thread<unknown>
      at <unknown source file>:<unknown line>
  34: __clone3<unknown>
      at <unknown source file>:<unknown line>

Note: note
Warning: warning
Suggestion: suggestion

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

For the test_panic_backwards_compatibility test it expects

   Finished dev [unoptimized + debuginfo] target(s) in 0.03s
     Running `target/debug/examples/theme_test_helper`
The application panicked (crashed).
Message:  <non string panic payload>
Location: examples/theme_test_helper.rs:37

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

   0: theme_test_helper::get_error with msg="test"
      at examples/theme_test_helper.rs:34

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 6 frames hidden ⋮                               
   7: std::panic::panic_any::hd76a7f826307234c
      at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panic.rs:57

It gets the following:

 Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.67s
     Running `/home/weiznich/Documents/rust/eyre/target/debug/examples/theme_test_helper`
The application panicked (crashed).
Message:  <non string panic payload>
Location: color-eyre/examples/theme_test_helper.rs:38

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

   0: theme_test_helper::get_error with msg="test"
      at color-eyre/examples/theme_test_helper.rs:35

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1: <color_eyre[9d45c5f93028b3a2]::config::PanicHook>::panic_report<unknown>
      at /home/weiznich/Documents/rust/eyre/color-eyre/src/config.rs:975
   2: <color_eyre[9d45c5f93028b3a2]::config::PanicHook>::into_panic_hook::{closure#0}<unknown>
      at /home/weiznich/Documents/rust/eyre/color-eyre/src/config.rs:954
   3: <alloc[d48b8b032ee4278d]::boxed::Box<dyn for<'a, 'b> core[ea2bd7cd219b3eb9]::ops::function::Fn<(&'a std[8cc15e19e2a5acfa]::panic::PanicHookInfo<'b>,), Output = ()> + core[ea2bd7cd219b3eb9]::marker::Sync + core[ea2bd7cd219b3eb9]::marker::Send> as core[ea2bd7cd219b3eb9]::ops::function::Fn<(&std[8cc15e19e2a5acfa]::panic::PanicHookInfo,)>>::call<unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/alloc/src/boxed.rs:2220
   4: std[8cc15e19e2a5acfa]::panicking::panic_with_hook<unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/std/src/panicking.rs:833
   5: std[8cc15e19e2a5acfa]::panicking::begin_panic::<eyre[af12fe77a4e585e4]::Report>::{closure#0}<unknown>
      at /home/weiznich/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:762
   6: std[8cc15e19e2a5acfa]::sys::backtrace::__rust_end_short_backtrace::<std[8cc15e19e2a5acfa]::panicking::begin_panic<eyre[af12fe77a4e585e4]::Report>::{closure#0}, !><unknown>
      at /home/weiznich/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/backtrace.rs:182
   7: std[8cc15e19e2a5acfa]::panicking::begin_panic::<eyre[af12fe77a4e585e4]::Report><unknown>
      at /home/weiznich/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:761
   8: std[8cc15e19e2a5acfa]::panic::panic_any::<eyre[af12fe77a4e585e4]::Report><unknown>
      at /home/weiznich/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:260
   9: theme_test_helper[77462fdad0774114]::main<unknown>
      at /home/weiznich/Documents/rust/eyre/color-eyre/examples/theme_test_helper.rs:38
  10: <fn() as core[ea2bd7cd219b3eb9]::ops::function::FnOnce<()>>::call_once<unknown>
      at /home/weiznich/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250
  11: std[8cc15e19e2a5acfa]::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()><unknown>
      at /home/weiznich/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/backtrace.rs:166
  12: std[8cc15e19e2a5acfa]::rt::lang_start::<()>::{closure#0}<unknown>
      at /home/weiznich/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:206
  13: <&dyn core[ea2bd7cd219b3eb9]::ops::function::Fn<(), Output = i32> + core[ea2bd7cd219b3eb9]::marker::Sync + core[ea2bd7cd219b3eb9]::panic::unwind_safe::RefUnwindSafe as core[ea2bd7cd219b3eb9]::ops::function::FnOnce<()>>::call_once<unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/core/src/ops/function.rs:287
  14: std[8cc15e19e2a5acfa]::panicking::catch_unwind::do_call::<&dyn core[ea2bd7cd219b3eb9]::ops::function::Fn<(), Output = i32> + core[ea2bd7cd219b3eb9]::marker::Sync + core[ea2bd7cd219b3eb9]::panic::unwind_safe::RefUnwindSafe, i32><unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/std/src/panicking.rs:581
  15: std[8cc15e19e2a5acfa]::panicking::catch_unwind::<i32, &dyn core[ea2bd7cd219b3eb9]::ops::function::Fn<(), Output = i32> + core[ea2bd7cd219b3eb9]::marker::Sync + core[ea2bd7cd219b3eb9]::panic::unwind_safe::RefUnwindSafe><unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/std/src/panicking.rs:544
  16: std[8cc15e19e2a5acfa]::panic::catch_unwind::<&dyn core[ea2bd7cd219b3eb9]::ops::function::Fn<(), Output = i32> + core[ea2bd7cd219b3eb9]::marker::Sync + core[ea2bd7cd219b3eb9]::panic::unwind_safe::RefUnwindSafe, i32><unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/std/src/panic.rs:359
  17: std[8cc15e19e2a5acfa]::rt::lang_start_internal::{closure#0}<unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/std/src/rt.rs:175
  18: std[8cc15e19e2a5acfa]::panicking::catch_unwind::do_call::<std[8cc15e19e2a5acfa]::rt::lang_start_internal::{closure#0}, isize><unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/std/src/panicking.rs:581
  19: std[8cc15e19e2a5acfa]::panicking::catch_unwind::<isize, std[8cc15e19e2a5acfa]::rt::lang_start_internal::{closure#0}><unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/std/src/panicking.rs:544
  20: std[8cc15e19e2a5acfa]::panic::catch_unwind::<std[8cc15e19e2a5acfa]::rt::lang_start_internal::{closure#0}, isize><unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/std/src/panic.rs:359
  21: std[8cc15e19e2a5acfa]::rt::lang_start_internal<unknown>
      at /rustc/474276961f48b0d05f4ea260ba400096b027584e/library/std/src/rt.rs:171
  22: std[8cc15e19e2a5acfa]::rt::lang_start::<()><unknown>
      at /home/weiznich/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:205
  23: main<unknown>
      at <unknown source file>:<unknown line>
  24: __libc_start_call_main<unknown>
      at <unknown source file>:<unknown line>
  25: __libc_start_main_alias_1<unknown>
      at <unknown source file>:<unknown line>
  26: _start<unknown>
      at <unknown source file>:<unknown line>

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

Also bump a bunch of other dependencies + fix a few clippy warnings
@pksunkara pksunkara enabled auto-merge February 20, 2026 20:21
@pksunkara pksunkara merged commit 2ab897d into eyre-rs:master Feb 20, 2026
29 checks passed
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 this pull request may close these issues.

2 participants