Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mati865 opened this issue Jul 10, 2019 · 52 comments · Fixed by alexcrichton/rustc-auto-publish#11
Closed
Labels
A-cross Area: Cross compilation C-bug Category: This is a bug. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state O-freebsd Operating system: FreeBSD regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Comments

@mati865
Copy link
Contributor

mati865 commented Jul 10, 2019

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/git.luolix.top-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/git.luolix.top-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

@mati865

This comment has been minimized.

@rustbot rustbot added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. labels Jul 10, 2019
@Manishearth
Copy link
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

@mati865
Copy link
Contributor Author

mati865 commented Jul 10, 2019

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

@its-pointless
Copy link

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.

@asomers
Copy link
Contributor

asomers commented Jul 29, 2019

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

@Manishearth
Copy link
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 :/

@mati865
Copy link
Contributor Author

mati865 commented Jul 29, 2019

@Manishearth
Copy link
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

@alexcrichton
Copy link
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)

@mati865
Copy link
Contributor Author

mati865 commented Jul 30, 2019

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

@martinellison

This comment has been minimized.

@martinellison

This comment has been minimized.

@Manishearth

This comment has been minimized.

@martinellison

This comment has been minimized.

@mati865

This comment has been minimized.

@martinellison

This comment has been minimized.

@nico-abram
Copy link
Contributor

Where should someone start looking to try to fix this, x.py?

@Lokathor
Copy link
Contributor

Effectively all users were already affected as of latest stable.

@Zoxc
Copy link
Contributor

Zoxc commented Oct 15, 2019

-Z dual-proc-macros has the limitation that only one proc macro with the same name can be used. Making sure there's only a single version of each proc macro crate in use should fix this error.

To lift this restriction we must record the crate disambiguator of both the target and host proc macro crates when linking to it. We currently only record it for the target, so rustc can't find the right one for the host if there's multiple crates with the same name.

@gnzlbg
Copy link
Contributor

gnzlbg commented Oct 15, 2019

This bug will be affecting many more users now that Rustup 1.20.0 installs rustfmt and clippy by default.
https://blog.rust-lang.org/2019/10/15/Rustup-1.20.0.html

For those looking for a workaround, @mati865 fixed it for libc CI which started failing due to this today by using --profile=minimal when installing rustup in rust-lang/libc#1550 .

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Oct 18, 2019
Pkgsrc changes:
 * Adapt to the move of the implementation of random numbers.
 * Remove patch which is no longer relevant (Signals.inc)
 * Cross-build currently fails due to the still unresolved
   rust-lang/rust#62558, so bootstrap
   kits for 1.38.0 have to be built natively, and will follow shortly.
 * Bump bootstrap requirements to 1.37.0 except for armv7-unknown-netbsd-eabihf
   which I've neither managed to cross-build nor build natively.

Upstream changes:

Version 1.38.0 (2019-09-26)
==========================

Language
--------
- [The `#[global_allocator]` attribute can now be used in submodules.][62735]
- [The `#[deprecated]` attribute can now be used on macros.][62042]

Compiler
--------
- [Added pipelined compilation support to `rustc`.][62766] This will
  improve compilation times in some cases. For further information please refer
  to the [_"Evaluating pipelined rustc compilation"_][pipeline-internals]
  thread.
- [Added tier 3\* support for the `aarch64-uwp-windows-msvc`,
  `i686-uwp-windows-gnu`, `i686-uwp-windows-msvc`, `x86_64-uwp-windows-gnu`,
  and `x86_64-uwp-windows-msvc` targets.][60260]
- [Added tier 3 support for the `armv7-unknown-linux-gnueabi` and
  `armv7-unknown-linux-musleabi` targets.][63107]
- [Added tier 3 support for the `hexagon-unknown-linux-musl` target.][62814]
- [Added tier 3 support for the `riscv32i-unknown-none-elf` target.][62784]

\* Refer to Rust's [platform support page][forge-platform-support] for more
information on Rust's tiered platform support.

Libraries
---------
- [`ascii::EscapeDefault` now implements `Clone` and `Display`.][63421]
- [Derive macros for prelude traits (e.g. `Clone`, `Debug`, `Hash`) are now
  available at the same path as the trait.][63056] (e.g. The `Clone` derive
  macro is available at `std::clone::Clone`). This also makes all built-in
  macros available in `std`/`core` root. e.g. `std::include_bytes!`.
- [`str::Chars` now implements `Debug`.][63000]
- [`slice::{concat, connect, join}` now accepts `&[T]` in addition to
   `&T`.][62528]
- [`*const T` and `*mut T` now implement `marker::Unpin`.][62583]
- [`Arc<[T]>` and `Rc<[T]>` now implement `FromIterator<T>`.][61953]
- [Added euclidean remainder and division operations (`div_euclid`,
  `rem_euclid`) to all numeric primitives.][61884] Additionally `checked`,
  `overflowing`, and `wrapping` versions are available for all
  integer primitives.
- [`thread::AccessError` now implements `Clone`, `Copy`, `Eq`, `Error`, and
  `PartialEq`.][61491]
- [`iter::{StepBy, Peekable, Take}` now implement `DoubleEndedIterator`.][61457]

Stabilized APIs
---------------
- [`<*const T>::cast`]
- [`<*mut T>::cast`]
- [`Duration::as_secs_f32`]
- [`Duration::as_secs_f64`]
- [`Duration::div_duration_f32`]
- [`Duration::div_duration_f64`]
- [`Duration::div_f32`]
- [`Duration::div_f64`]
- [`Duration::from_secs_f32`]
- [`Duration::from_secs_f64`]
- [`Duration::mul_f32`]
- [`Duration::mul_f64`]
- [`any::type_name`]

Cargo
-----
- [Added pipelined compilation support to `cargo`.][cargo/7143]
- [You can now pass the `--features` option multiple times to enable
  multiple features.][cargo/7084]

Misc
----
- [`rustc` will now warn about some incorrect uses of
  `mem::{uninitialized, zeroed}` that are known to cause undefined
  behaviour.][63346]

Compatibility Notes
-------------------
- Unfortunately the [`x86_64-unknown-uefi` platform can not be built][62785]
  with rustc 1.39.0.
- The [`armv7-unknown-linux-gnueabihf` platform is also known to have
  issues][62896] for certain crates such as libc.

[60260]: rust-lang/rust#60260
[61457]: rust-lang/rust#61457
[61491]: rust-lang/rust#61491
[61884]: rust-lang/rust#61884
[61953]: rust-lang/rust#61953
[62042]: rust-lang/rust#62042
[62528]: rust-lang/rust#62528
[62583]: rust-lang/rust#62583
[62735]: rust-lang/rust#62735
[62766]: rust-lang/rust#62766
[62784]: rust-lang/rust#62784
[62785]: rust-lang/rust#62785
[62814]: rust-lang/rust#62814
[62896]: rust-lang/rust#62896
[63000]: rust-lang/rust#63000
[63056]: rust-lang/rust#63056
[63107]: rust-lang/rust#63107
[63346]: rust-lang/rust#63346
[63421]: rust-lang/rust#63421
[cargo/7084]: rust-lang/cargo#7084
[cargo/7143]: rust-lang/cargo#7143
[`<*const T>::cast`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.cast
[`<*mut T>::cast`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.cast
[`Duration::as_secs_f32`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.as_secs_f32
[`Duration::as_secs_f64`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.as_secs_f64
[`Duration::div_duration_f32`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.div_duration_f32
[`Duration::div_duration_f64`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.div_duration_f64
[`Duration::div_f32`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.div_f32
[`Duration::div_f64`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.div_f64
[`Duration::from_secs_f32`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.from_secs_f32
[`Duration::from_secs_f64`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.from_secs_f64
[`Duration::mul_f32`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.mul_f32
[`Duration::mul_f64`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.mul_f64
[`any::type_name`]: https://doc.rust-lang.org/std/any/fn.type_name.html
[forge-platform-support]: https://forge.rust-lang.org/platform-support.html
[pipeline-internals]: https://internals.rust-lang.org/t/evaluating-pipelined-rustc-compilation/10199
bors added a commit that referenced this issue Nov 1, 2019
Dual proc macro hash

This PR changes current `-Z dual-proc-macro` mechanism from resolving only by name to including the hash of the host crate inside the transistive dependency information to prevent name conflicts.
Fix partially #62558
@msizanoen1
Copy link
Contributor

msizanoen1 commented Nov 1, 2019

#65698 has been merged, now there is only rust-lang/rust-clippy#4714 and a follow-up submodule update PR (#66207) and we can close this.

@msizanoen1

This comment has been minimized.

@rustbot rustbot added the O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state label Nov 1, 2019
@msizanoen1
Copy link
Contributor

Miri, RLS and Rustfmt is now available: https://rust-lang.github.io/rustup-components-history/armv7-unknown-linux-gnueabihf.html

@msizanoen1

This comment has been minimized.

@Manishearth
Copy link
Member

@msizanoen1 please don't remove the clippy plugin yet. We're waiting to publish rust-lang/blog.rust-lang.org#435 before we remove it.

@msizanoen1
Copy link
Contributor

Please check the PR description carefully - it does not remove the clippy plugin but avoid building it in rustbuild.

@Manishearth
Copy link
Member

Oh, for some reason I thought we shipped the clippy plugin package as well, but plugin users don't use rustup.

bors added a commit to rust-lang/rust-clippy that referenced this issue Nov 4, 2019
Remove clippy plugin

This PR removes the clippy plugin, which is already deprecated and is causing the `fmt_macros` not found error in rust-lang/rust#62558: rust-lang/rust#62558 (comment)
bors added a commit to rust-lang/rust-clippy that referenced this issue Nov 4, 2019
Remove clippy plugin

This PR removes the clippy plugin, which is already deprecated and is causing the `fmt_macros` not found error in rust-lang/rust#62558: rust-lang/rust#62558 (comment)

changelog: remove plugin interface
bors added a commit to rust-lang/rust-clippy that referenced this issue Nov 6, 2019
Remove clippy plugin

This PR removes the clippy plugin, which is already deprecated and is causing the `fmt_macros` not found error in rust-lang/rust#62558: rust-lang/rust#62558 (comment)

changelog: remove plugin interface
pietroalbini added a commit to pietroalbini/rust that referenced this issue Nov 6, 2019
@msizanoen1
Copy link
Contributor

Should be fixed by #66207

@msizanoen1
Copy link
Contributor

The last tool, clippy is now available:
https://rust-lang.github.io/rustup-components-history/armv7-unknown-linux-gnueabihf.html

amuramatsu pushed a commit to amuramatsu/termux-packages that referenced this issue Dec 7, 2019
Due to rust-lang/rust#62558, the tools: rls,
clippy, and rustfmt cannot be built.

We also remove src which cuts the resulting size of the dep from about
330MB to 180MB.

The build is further broken into two steps:
1. `x.py dist`
2. `x.py install`

This change is because `x.py install` now fails due to an issue where
bootstrap tries to install  rustc-aarch64-linux-android before the
installation script is generated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cross Area: Cross compilation C-bug Category: This is a bug. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state O-freebsd Operating system: FreeBSD regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet