Skip to content

Tools are not available on cross compiled platforms since #61861 #62558

Closed
alexcrichton/rustc-auto-publish
#11

Description

@mati865

Moved from rust-lang/rust-clippy#4267

#61861 was merged in #61962, since then Rustfmt fails to build when cross compiling which is the case for almost all non Tier 1 platforms.
Clippy and RLS are failing with similar error.

Error on aarch64-unknown-linux-gnu:

[01:14:03] error[E0464]: multiple matching crates for `rustc_macros`
[01:14:03]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_target-491.0.0/abi/mod.rs:10:5
[01:14:03]    |
[01:14:03]    | use syntax_pos::symbol::{sym, Symbol};
[01:14:03]    |     ^^^^^^^^^^
[01:14:03]    |
[01:14:03]    = note: candidates:
[01:14:03]            crate `rustc_macros`: /checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_macros-97bf1e9c420f9886.so
[01:14:03]            crate `rustc_macros`: /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/release/deps/librustc_macros-2f4546e1163449fb.so
[01:14:03] 
[01:14:03] error[E0461]: couldn't find crate `rustc_macros` with expected target triple x86_64-unknown-linux-gnu which `syntax_pos` depends on
[01:14:03]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_target-491.0.0/abi/mod.rs:10:5
[01:14:03]    |
[01:14:03] 10 | use syntax_pos::symbol::{sym, Symbol};
[01:14:03]    |     ^^^^^^^^^^
[01:14:03]    |
[01:14:03]    = note: the following crate versions were found:
[01:14:03]            crate `rustc_macros`, target triple aarch64-unknown-linux-gnu: /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/aarch64-unknown-linux-gnu/release/deps/librustc_macros-55389246a2ce204b.so
[01:14:03] 
[01:14:03] error: aborting due to 2 previous errors

https://api.travis-ci.com/v3/job/209363492/log.txt

@rustbot modify labels: T-dev-tools A-rustbuild

Activity

  1. mati865 commented on Jul 10, 2019

    @mati865
    Author
  2. added
    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
    T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.
    on Jul 10, 2019
  3. Manishearth commented on Jul 10, 2019

    @Manishearth
    Member

    Why does Clippy depend on rustfmt? We only have it in our Travis tests, and even then a test-fail shouldn't cause an unshipped tool

  4. mati865 commented on Jul 10, 2019

    @mati865
    MemberAuthor

    Modified issue description, it depends on fmt_macros but the error is basically the same.

  5. its-pointless commented on Jul 10, 2019

    @its-pointless

    only way i got it to build cross tools was from example in original post copying librustc_macros-97bf1e9c420f9886.so over librustc_macros-2f4546e1163449fb.so
    this and suddenly rust nightly std library doubling in size... fun times.

  6. asomers commented on Jul 29, 2019

    @asomers
    Contributor

    ping. Any progress here? This issue blocks tier2 users from upgrading past rustc nightly 1.36.0.

  7. Manishearth commented on Jul 29, 2019

    @Manishearth
    Member

    I can't tell where the logs for Clippy on cross platforms are so I don't know how to fix this. Rust has a ton of builders :/

  8. mati865 commented on Jul 29, 2019

    @mati865
    MemberAuthor
  9. Manishearth commented on Jul 29, 2019

    @Manishearth
    Member

    Hmm that seems like the rust build system being brittle. I've seen that kind of error before, it's usually solved by deleting something in the build dir.

    cc @alexcrichton @pietroalbini

  10. alexcrichton commented on Jul 30, 2019

    @alexcrichton
    Member

    That isn't an issue about stale build directories or anything like that. Something is misconfigured to cause the rustc-macros crate to get built twice. The rustc_macros crate should not be getting compiled into the stage1-tools directory, but something is pulling it in. I haven't investigated to see what, though.

    (it'd be good as well btw to not assume default-flakiness and instead assume that because it is a consistent regression that there's something which needs to be investigated)

  11. mati865 commented on Jul 30, 2019

    @mati865
    MemberAuthor

    I think rustc_macros are expected to be available in stage1: https://github.com/rust-lang/rust/pull/58013/files#diff-4bc384d35e57dc577b9378d4d733d7c3R818
    The issue started when rustfmt was updated and pulled new dependecy: rustc-ap-rustc_macros in #61861

  12. added
    C-bugCategory: This is a bug.
    T-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.
    on Aug 15, 2019
  13. martinellison commented on Aug 21, 2019

    @martinellison
  14. 54 remaining items

  15. added 4 commits that reference this issue on Nov 4, 2019
  16. added a commit that references this issue on Nov 6, 2019
    454032f
  17. msizanoen1 commented on Nov 11, 2019

    @msizanoen1
    Contributor

    Should be fixed by #66207

  18. msizanoen1 commented on Nov 13, 2019

    @msizanoen1
    Contributor
  19. added a commit that references this issue on May 13, 2026
  20. added a commit that references this issue on Oct 13, 2026
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-crossArea: Cross compilationC-bugCategory: This is a bug.O-ArmTarget: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 stateO-freebsdOperating system: FreeBSDT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.T-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions