cross icon indicating copy to clipboard operation
cross copied to clipboard

Linker wrapper script for musl outputs garbage due to `set -x`

Open VorpalBlade opened this issue 11 months ago • 6 comments

Checklist

Describe your issue

https://github.com/cross-rs/cross/blob/main/docker/musl-gcc.sh uses set -x, which causes unexpected output. Rustc now issues a lint for that (on nightly). This breaks -Dwarning builds. See this rustc issue: https://github.com/rust-lang/rust/issues/136132

Cross should remove that set -x and then make a new release of the affected component(s). The docker images in this case I suppose?

What target(s) are you cross-compiling for?

No response

Which operating system is the host (e.g computer cross is on) running?

  • [ ] macOS
  • [ ] Windows
  • [x] Linux / BSD
  • [ ] other OS (specify in description)

What architecture is the host?

  • [x] x86_64 / AMD64
  • [ ] arm32
  • [ ] arm64 (including Mac M1)

What container engine is cross using?

  • [x] docker
  • [ ] podman
  • [ ] other container engine (specify in description)

cross version

cross 0.2.5 (66221abde 2024-11-19)

Example

Cross compile any program to aarch64-unknown-linux-musl.

Additional information / notes

No response

VorpalBlade avatar Jan 27 '25 17:01 VorpalBlade

To solve this without a fix to our images, one can use #![allow(linker_messages)] in root

I think it's unfortunate that this is an error-by-default, but oh well, it's a simple thing to fix. PRs welcome, otherwise I'll get to it myself

Emilgardis avatar Jan 27 '25 21:01 Emilgardis

I think it's unfortunate that this is an error-by-default, but oh well, it's a simple thing to fix. PRs welcome, otherwise I'll get to it myself

I believe they are currently planning to roll back this temporarily due to the fallout of the it.

VorpalBlade avatar Jan 27 '25 21:01 VorpalBlade

Ah yes, it was changed: https://github.com/rust-lang/rust/pull/136098

Emilgardis avatar Jan 27 '25 22:01 Emilgardis

Yes, we rolled it back for now to fix the warnings on our side and in places like here before enabling it again to reduce fallout.

I see that this script was added 3 years ago to work around issues in "older Rust versions". Maybe it can just be removed now?

Noratrieb avatar Jan 28 '25 08:01 Noratrieb

I think it's unfortunate that this is an error-by-default, but oh well, it's a simple thing to fix. PRs welcome, otherwise I'll get to it myself

It is a warning by default. OP used -Dwarnings upgrading any warning to an error: https://github.com/VorpalBlade/chezmoi_modify_manager/blob/12c5fea1442fcd7e465f827c9963475d088cf73e/.github/workflows/build.yml#L22

bjorn3 avatar Jan 28 '25 11:01 bjorn3

Yes, I wrote that in the initial post as well. The discussion about using that or not is a whole topic on its own though (and without it, I wouldn't have noticed this problem to begin with).

VorpalBlade avatar Jan 28 '25 11:01 VorpalBlade