Skip to content

Conversation

@igamigo
Copy link
Collaborator

@igamigo igamigo commented Sep 29, 2025

I think this solves the error we've been seeing when merging to next:

error: panic_immediate_abort is now a real panic strategy! Enable it with the compiler flags `-Zunstable-options -Cpanic=immediate-abort`
  --> /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/panicking.rs:36:1
   |
36 | / compile_error!(
37 | |     "panic_immediate_abort is now a real panic strategy! \
38 | |     Enable it with the compiler flags `-Zunstable-options -Cpanic=immediate-abort`"
39 | | );
   | |_^

See this PR for more context

@igamigo igamigo added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Sep 29, 2025
Copy link
Contributor

@mmagician mmagician left a comment

Choose a reason for hiding this comment

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

thanks for investigating this

@dagarcia7
Copy link
Collaborator

I'm going to be honest, I think my understanding of this issue is very limited 😅 Is the issue here that we're passing multiple different panic strategies via compiler flags that don't agree? And this attempts to pass in this latest flag to stabilize them? I guess my question here is looking at the error linked, it shows

[!] (plugin rust) Error: Could not load /home/runner/work/miden-client/miden-client/crates/web-client/Cargo.toml (imported by js/wasm.js): Command `cargo rustc --lib --target wasm32-unknown-unknown --crate-type cdylib --release --config profile.release.panic="abort" --config profile.release.lto=true --config profile.release.codegen-units=1 --config profile.release.strip=true -Z build-std=panic_abort,std -Z build-std-features=panic_immediate_abort,optimize_for_size --features testing --config build.rustflags=["-C", "target-feature=+atomics,+bulk-memory,+mutable-globals", "-C", "link-arg=--max-memory=4294967296"] --no-default-features` failed with error code: 101

so do we also need to modify (or remove?) any of these?

--config profile.release.panic="abort"
-Z build-std=panic_abort,std
-Z build-std-features=panic_immediate_abort,optimize_for_size

now that we're passing in

"-Z", "unstable-options", "-C", "panic=immediate-abort"

Copy link
Collaborator

@dagarcia7 dagarcia7 left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this! I think if the issue is fixed we should be good to merge, but just added some thoughts to give some of the other compile flags a look as well just in case they may also be part of the issue!

@igamigo
Copy link
Collaborator Author

igamigo commented Sep 30, 2025

[!] (plugin rust) Error: Could not load /home/runner/work/miden-client/miden-client/crates/web-client/Cargo.toml (imported by js/wasm.js): Command `cargo rustc --lib --target wasm32-unknown-unknown --crate-type cdylib --release --config profile.release.panic="abort" --config profile.release.lto=true --config profile.release.codegen-units=1 --config profile.release.strip=true -Z build-std=panic_abort,std -Z build-std-features=panic_immediate_abort,optimize_for_size --features testing --config build.rustflags=["-C", "target-feature=+atomics,+bulk-memory,+mutable-globals", "-C", "link-arg=--max-memory=4294967296"] --no-default-features` failed with error code: 101

so do we also need to modify (or remove?) any of these?

--config profile.release.panic="abort" -Z build-std=panic_abort,std -Z build-std-features=panic_immediate_abort,optimize_for_size

now that we're passing in

"-Z", "unstable-options", "-C", "panic=immediate-abort"

Thanks for taking a look! After reviewing this a bit more based on your comment, I found out why some flags are passed to rustc even when we don't explicitly add them (in our cargo settings nor in rollup.config.js). Basically, rollup-plugin-rust passes flags to rustc even if you don't specify them based on whether you are using nightly or not. The problem is that the flag is now deprecated and it crashes the compilation, even if we specify the correct one explicitly.

I think we could just remove the nightly requirement, because I don't think we need any of the nightly stuff. Could you confirm this is the case? I am not sure if you added the first version of rollup.config.js or someone else from the team, but unless there was any specific reason why nightly was used, I think we could go back to stable, what do you think @dagarcia7 ?

EDIT: Talked offline to Dennis, we decided we could try stable to see how it goes

@igamigo igamigo force-pushed the igamigo-compilation-flag branch from 75cf4e4 to 9025531 Compare September 30, 2025 17:14
@igamigo igamigo merged commit 91c821b into next Sep 30, 2025
28 checks passed
@igamigo igamigo deleted the igamigo-compilation-flag branch September 30, 2025 17:53
@igamigo
Copy link
Collaborator Author

igamigo commented Sep 30, 2025

Looks like the publishing succeeded: https://github.com/0xMiden/miden-client/actions/runs/18138878427/job/51624535483

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog This PR does not require an entry in the `CHANGELOG.md` file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants