Skip to content

[E0514] error message not clear  #30363

Closed

Description

@samwonelsie

I was trying to cross-compile something, and even though, the identically named down to the hash (compatible?), std crate for the cross arch had come from the same minor version (rustc 1.6.0-dev) I still got the error:

 hello.rs:1:1: 1:1 error: the crate `std` has been compiled with rustc 1.6.0-dev, which is incompatible with this version of rustc [E0514]

What is required for the crates to be compatible then? The exact commit hash of the rust compilers as well?

If so, this issue could be about something else too - building from a full source snapshot (instead of git clones) doesn't put the hash info into the binary.

Activity

  1. sfackler commented on Dec 13, 2015

    @sfackler
    Member

    The compilers must have been built from the same commit.

  2. samwonelsie commented on Dec 13, 2015

    @samwonelsie
    Author

    Strange that it's not printing the hash if it's still able to compare against it.

  3. ticki commented on Dec 14, 2015

    @ticki
    Contributor

    Try to run cargo clean

  4. samwonelsie commented on Dec 14, 2015

    @samwonelsie
    Author
  5. ticki commented on Dec 14, 2015

    @ticki
    Contributor

    Reddit thread?

  6. arielb1 commented on Dec 14, 2015

    @arielb1
    Contributor

    What compilers were you using?

  7. samwonelsie commented on Dec 14, 2015

    @samwonelsie
    Author

    Those were 1.6 nightlies for armhf (from rustbuild) and i686 (mine) architectures roughly from the same day - hence the matching crate names.

  8. arielb1 commented on Dec 14, 2015

    @arielb1
    Contributor

    Apparently the nightlies are built with different values of CFG_VERSION. Could @alexcrichton investigate?

  9. arielb1 commented on Dec 14, 2015

    @arielb1
    Contributor

    The CFG_VERSION is visible by doing strings $RLIB_FILE_CREATED_BY_RUSTC | grep "rustc 1[.]", or by rustc --version.

  10. alexcrichton commented on Dec 14, 2015

    @alexcrichton
    Member

    I guess this may depend on the string being compared, the nightly compilers have the version string ending with -nightly and from-source builds use -dev by default (configurable either way of course).

    I wonder if perhaps this check should just compare commit revisions?

  11. samwonelsie commented on Dec 15, 2015

    @samwonelsie
    Author

    I can confirm I got it working in both directions using 1.5.0-dev (after building from the same snapshot on both architectures) - rustc -vV doesn't include the hash info nor build date though.

  12. added
    T-compiler
    on Dec 15, 2015
  13. added
    A-diagnostics
    on Jan 6, 2016
  14. samwonelsie commented on Feb 20, 2016

    @samwonelsie
    Author

    I'd like to suggest including the commit info in the full source snapshots so that it can be parsed by the build scripts and rustc -vV doesn't end up like this:

    rustc 1.8.0-dev
    binary: rustc
    commit-hash: unknown
    commit-date: unknown
    host: arm-unknown-linux-gnueabihf
    release: 1.8.0-dev
    
  15. samwonelsie commented on Mar 18, 2016

    @samwonelsie
    Author

    The original issue has turned out to be about something else - fully compatible crates were being rejected for the sole reason CFG_VERSION was different. Otherwise, the message would have been crystal clear.

    In other words, it's not possible to pick up crates from rust-lang and use them in your own compiler built from tarball source, meaning #30622 shouldn't close this.

  16. samwonelsie commented on Apr 30, 2016

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsT-compiler

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions