Skip to content

Support different panic strategies. #29

Open
@ehuss

Description

@ehuss

The current implementation does not support different panic strategies, and is hard-coded for unwind. This is a tricky and difficult issue, and there will need to be some investigation and experimentation to figure out all the details. Some things to think about:

  • How will cargo know which implementation to use? Somehow inspecting the profile?
  • Should cargo always build both unwind and abort?
  • -C panic=abort must be passed for the panic_abort crate.
  • Some targets default to abort, need to figure that out.
  • When building abort crates, cargo currently rebuilds them with unwind when built with the libtest harness. Does this mean the entire standard library would need to be built twice? This needs more thought, as it is already subtle and finicky.

There is also some hard-coded knowledge in Cargo about building the panic-unwind/abort crates, due to the way the compiler works (just relying on the std feature flags wasn't enough). Alex mentioned a desire to remove this, but I'm not sure how.

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-needs-designStatus: needs design workimplementationImplementation exploration and tracking issuesstabilization blockerThis needs a resolution before stabilization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions