Skip to content

FTBFS tarball rust 1.86.0: generated a symlink in a tarball: rust-lld #139477

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

Closed
rautyrauty opened this issue Apr 7, 2025 · 7 comments · Fixed by #139853
Closed

FTBFS tarball rust 1.86.0: generated a symlink in a tarball: rust-lld #139477

rautyrauty opened this issue Apr 7, 2025 · 7 comments · Fixed by #139853
Labels
A-linkers Area: linkers... you gotta love linkers C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@rautyrauty
Copy link

Summary

The bug is not reproducible on 1.85.1.
Built from a tarball: curl -O https://static.rust-lang.org/dist/rustc-1.86.0-src.tar.gz

[00:04:41] Copy/Link "/usr/bin/lld" to "/usr/src/RPM/BUILD/rust-1.86.0/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin/rust-lld"
[00:22:07] thread 'main' panicked at src/bootstrap/src/utils/tarball.rs:397:21:
[00:22:07] generated a symlink in a tarball: /usr/src/RPM/BUILD/rust-1.86.0/build/tmp/tarball/rustc/x86_64-unknown-linux-gnu/rustc-1.86.0-x86_64-unknown-linux-gnu/rustc/lib/rustlib/x86_64-unknown-linux-gnu/bin/rust-lld

Command used

All commands used are listed in the build log.

Bootstrap configuration (bootstrap.toml)

I didn't create it.

Operating system

ALT Linux Sisyphus.

HEAD

Built from a tarball.

Additional context

I am building an RPM package, I am the maintainer of the rust package in ALT Linux.

@rautyrauty rautyrauty added C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Apr 7, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 7, 2025
@rautyrauty
Copy link
Author

Failed to upload "rust-1.86.0-FTBFS-build.log":
https://drive.google.com/file/d/1_uxHkI2pxllOYIR0BaGTsj4wwInnKBGI/view?usp=sharing

@onur-ozkan onur-ozkan added A-linkers Area: linkers... you gotta love linkers and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 7, 2025
@jieyouxu
Copy link
Member

cc @Kobzol: I think this has to do with the lld changes?

@Kobzol
Copy link
Contributor

Kobzol commented Apr 14, 2025

The lld step returns a LLD binary directory here, as it assumes that it comes from download-ci-llvm. But that might not be the case, e.g. in this issue, /usr/bin/llvm-config is used as the LLVM config. The code then takes /usr/bin as the "download CI LLVM" directory, and returns the wrong (?) path. Then we try to copy /usr/bin/lld to the tarball, but that is probably not what we want, not to mention that it is likely a symlink in the OP's case.

The last PR that touched this is #134437, but I'm not sure if that change could cause this problem. I don't know if we are supposed to take the host LLD and copy it into the distributed archives as rust-lld, that sounds suspicious. I think that if we don't build the LLD, we shouldn't distribute it 🤔

@onur-ozkan
Copy link
Member

I think that if we don't build the LLD, we shouldn't distribute it 🤔

100% agreed.

@Mark-Simulacrum
Copy link
Member

Is that actually right? Does that break our targets that default to lld today?

It seems like distros (who often use their own upstream llvm) having an inconsistent rustc layout to what we ship isn't great if it's avoidable. In general I'd not expect lld to be special - what do we do for libLLVM? Is that distributed under an external llvm build?

Cc @cuviper

@cuviper
Copy link
Member

cuviper commented Apr 14, 2025

In general I'd not expect lld to be special - what do we do for libLLVM? Is that distributed under an external llvm build?

That's decided in dist::maybe_install_llvm, which skips external builds.

fn maybe_install_llvm(

@Kobzol
Copy link
Contributor

Kobzol commented Apr 15, 2025

Right, thanks. I think that we should do the same for LLD, and in particular forbid combining llvm-config with rust.lld = true. It seems that this is what has been configured in this situation. #139853 should disable this combination.

Zalathar added a commit to Zalathar/rust that referenced this issue Apr 16, 2025
Disable combining LLD with external llvm-config

When an external `llvm-config` is used, we don't really know anything about the external LLD, as we don't build it ourselves. Therefore, we probably shouldn't allow using `rust-lld` nor copy it to the target sysroot.

Fixes: rust-lang#139477

CC `@cuviper`

r? `@onur-ozkan`
Zalathar added a commit to Zalathar/rust that referenced this issue Apr 16, 2025
Disable combining LLD with external llvm-config

When an external `llvm-config` is used, we don't really know anything about the external LLD, as we don't build it ourselves. Therefore, we probably shouldn't allow using `rust-lld` nor copy it to the target sysroot.

Fixes: rust-lang#139477

CC ``@cuviper``

r? ``@onur-ozkan``
bors added a commit to rust-lang-ci/rust that referenced this issue Apr 16, 2025
Disable combining LLD with external llvm-config

When an external `llvm-config` is used, we don't really know anything about the external LLD, as we don't build it ourselves. Therefore, we probably shouldn't allow using `rust-lld` nor copy it to the target sysroot.

Fixes: rust-lang#139477

CC `@cuviper`

r? `@onur-ozkan`

try-job: dist-x86_64-linux
try-job: dist-aarch64-linux
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Apr 17, 2025
Disable combining LLD with external llvm-config

When an external `llvm-config` is used, we don't really know anything about the external LLD, as we don't build it ourselves. Therefore, we probably shouldn't allow using `rust-lld` nor copy it to the target sysroot.

Fixes: rust-lang#139477

CC `@cuviper`

r? `@onur-ozkan`

try-job: dist-x86_64-linux
try-job: dist-aarch64-linux
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Apr 17, 2025
Disable combining LLD with external llvm-config

When an external `llvm-config` is used, we don't really know anything about the external LLD, as we don't build it ourselves. Therefore, we probably shouldn't allow using `rust-lld` nor copy it to the target sysroot.

Fixes: rust-lang#139477

CC `@cuviper`

r? `@onur-ozkan`

try-job: dist-x86_64-linux
try-job: dist-aarch64-linux
@bors bors closed this as completed in ac00a37 Apr 18, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Apr 18, 2025
Rollup merge of rust-lang#139853 - Kobzol:lld-llvm-config, r=onur-ozkan

Disable combining LLD with external llvm-config

When an external `llvm-config` is used, we don't really know anything about the external LLD, as we don't build it ourselves. Therefore, we probably shouldn't allow using `rust-lld` nor copy it to the target sysroot.

Fixes: rust-lang#139477

CC ``@cuviper``

r? ``@onur-ozkan``

try-job: dist-x86_64-linux
try-job: dist-aarch64-linux
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Apr 19, 2025
Disable combining LLD with external llvm-config

When an external `llvm-config` is used, we don't really know anything about the external LLD, as we don't build it ourselves. Therefore, we probably shouldn't allow using `rust-lld` nor copy it to the target sysroot.

Fixes: rust-lang/rust#139477

CC ``@cuviper``

r? ``@onur-ozkan``

try-job: dist-x86_64-linux
try-job: dist-aarch64-linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkers Area: linkers... you gotta love linkers C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants