Skip to content

Stable or versioned ABI? #11821

Closed
Closed
@SimonSapin

Description

@SimonSapin

The details of what’s in a compiled crate file is highly dependent on the Rust version. Different Rust versions are often incompatible. Ensuring binary compatibility is probably premature for Rust right now, but we should at least improve error messages.

Would it make sense to store an ABI version number in compiled crates?

Scenario:

  • Have a crate A
  • Have a crate B with extern mod A and using stuff from A
  • Build them both
  • Work on something else for a few weeks
  • Upgrade the compiler
  • Rebuild B

Desired result:

It either Just Works, or fails with an error message like "A has an incompatible ABI and needs to be rebuilt."

Obtained result (sometimes):

  • Internal compiler error.
  • Time wasted to figure out what’s going on.
% RUST_LOG=rustc=1 make
rustc -L ../rust-encoding url.rs --out-dir .
task 'rustc' failed at 'lookup_item: id not found: 108293', /home/simon/projects/servo/src/compiler/rust/src/librustc/metadata/decoder.rs:92
error: internal compiler error: unexpected failure
This message reflects a bug in the Rust compiler. 
We would appreciate a bug report: https://github.com/mozilla/rust/wiki/HOWTO-submit-a-Rust-bug-report
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1 to get further details and report the results to github.com/mozilla/rust/issues
task '<main>' failed at 'explicit failure', /home/simon/projects/servo/src/compiler/rust/src/librustc/lib.rs:440
Makefile:17: recipe for target 'liburl.dummy' failed
make: *** [liburl.dummy] Error 101

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions