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

build error: generated a symlink in a tarball #135554

Closed
bryteise opened this issue Jan 15, 2025 · 3 comments · Fixed by #135585
Closed

build error: generated a symlink in a tarball #135554

bryteise opened this issue Jan 15, 2025 · 3 comments · Fixed by #135585
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Milestone

Comments

@bryteise
Copy link

bryteise commented Jan 15, 2025

When building rust-1.84.0 from the source tarball on Linux I'm seeing the following in a backtrace:

thread 'main' panicked at src/utils/tarball.rs:397:21: generated a symlink in a tarball: /builddir/build/BUILD/rustc-1.84.0-src/build/tmp/tarball/rustc/x86_64-unknown-linux-gnu/rustc-1.84.0-x86_64-unknown-linux-gnu/rustc/lib/rustlib/x86_64-unknown-linux-gnu/bin/rust-objcopy

My config.toml has the following:

profile = "dist"
[llvm]
link-shared = true
download-ci-llvm = false
[build]
target = [
  "x86_64-unknown-linux-gnu",
  "i686-unknown-linux-gnu",
]
cargo = "/usr/bin/cargo"
rustc = "/usr/bin/rustc"
rustfmt = "/usr/bin/rustfmt"
locked-deps = true
vendor = true
tools = ["cargo", "clippy", "rustdoc", "rustfmt"]
sanitizers = true
profiler = true
docs = false
[install]
prefix = "/usr"
[rust]
codegen-units-std = 1
debuginfo-level = 1
debuginfo-level-std = 2
channel = "stable"
description = ""
rpath = false
frame-pointers = true
lld = false
use-lld = "external"
llvm-bitcode-linker = false
deny-warnings = false
backtrace-on-ice = true
remap-debuginfo = false
jemalloc = true
# codegen-tests depend on LLVM utils (FileCheck) we don't provide
codegen-tests = false

Looking at another issue I tried llvm-tools = false and hit a different issue:

src.symlink_metadata() failed with No such file or directory (os error 2) ("src = /builddir/build/BUILD/rustc-1.84.0-src/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-objcopy")

I'm inclined to just patch out the test for the symlink in the tarfile for now as that appears to be only there because of windows but this seems like a problem regardless.

@bryteise bryteise added the C-bug Category: This is a bug. label Jan 15, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 15, 2025
@jieyouxu jieyouxu added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jan 16, 2025
@onur-ozkan onur-ozkan removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 16, 2025
@onur-ozkan
Copy link
Member

We should resolve symlinks before adding them to tarballs. I plan to submit a PR for this in a few hours.

@onur-ozkan onur-ozkan changed the title 1.84.0 profile="dist" build error: generated a symlink in a tarball build error: generated a symlink in a tarball Jan 16, 2025
@onur-ozkan
Copy link
Member

You can cherry-pick #135585 until we backport it into the stable release.

@bryteise
Copy link
Author

Thanks!

@bors bors closed this as completed in 6997ea2 Jan 17, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jan 17, 2025
Rollup merge of rust-lang#135585 - onur-ozkan:135554, r=Kobzol

resolve symlinks of LLVM tool binaries before copying them

There is a chance that these tools are being installed from an external LLVM and we have no control over them. If any of these tools use symlinks, they will fail during tarball distribution. This change makes copying process to resolve symlinks just before placing them into the destination path.

Fixes rust-lang#135554
@cuviper cuviper added this to the 1.84.1 milestone Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants