Skip to content

panic=immediate-abort with build-std doesn't work: the crate core was compiled with a panic strategy which is incompatible #146974

@burningtnt

Description

@burningtnt

I‘ve tried this code:

name: Build
run: |
  rustup target add --toolchain nightly x86_64-unknown-linux-gnu
  rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
  cargo +nightly build --release \
    -Z build-std=core,std,alloc,proc_macro,panic_abort \
    -Z build-std-features=default,optimize_for_size
env:
  RUSTFLAGS: -Zunstable-options -Cpanic=immediate-abort

with Cargo.toml

[profile.release]
panic = "abort"

I expected to see this happen: Cargo successfully compiled the project with immediate-abort flag and locally built std package.

Instead, this happened:

error: the crate `core` was compiled with a panic strategy which is incompatible with `immediate-abort`

I'm currently working on burningtnt/Terracotta#54 . All related metadata or configuration can be found on this branch.

Metadata

Metadata

Assignees

Labels

-Zbuild-stdUnstable cargo option: -Zbuild-stdA-panicArea: Panicking machineryC-bugCategory: This is a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions