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

python3 x.py install attempts to install some files multiple times and leaves ".old" files #115213

Closed
xry111 opened this issue Aug 25, 2023 · 10 comments · Fixed by #121079
Closed
Assignees
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@xry111
Copy link
Contributor

xry111 commented Aug 25, 2023

In a fresh install of 1.72.0 there are some .old files:

/opt/rustc-1.72.0/share/doc/rustc-1.72.0/README.md.old
/opt/rustc-1.72.0/share/doc/rustc-1.72.0/LICENSE-MIT.old
/opt/rustc-1.72.0/share/doc/rustc-1.72.0/LICENSE-APACHE.old
/opt/rustc-1.72.0/bin/cargo-fmt.old
/opt/rustc-1.72.0/bin/cargo-clippy.old
/opt/rustc-1.72.0/bin/rustfmt.old
/opt/rustc-1.72.0/bin/clippy-driver.old
/etc/bash_completion.d/cargo.old

The same thing happens with 1.71.1.

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 25, 2023
@saethlin saethlin added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Aug 25, 2023
@onur-ozkan onur-ozkan self-assigned this Sep 1, 2023
@onur-ozkan
Copy link
Member

Performed a test on 1.72.0 and was able to reproduce the problem. With HEAD: 959b2c7, it is no longer present(most probably fixed on the cargo side since it doesn't have anything to do with bootstrapping).

If you encounter the problem again, please feel free to re-open the issue.

@xry111
Copy link
Contributor Author

xry111 commented Oct 8, 2023

I'm still hitting this with 1.73.0.

@onur-ozkan onur-ozkan added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 8, 2023
@onur-ozkan onur-ozkan reopened this Oct 8, 2023
@xry111
Copy link
Contributor Author

xry111 commented Oct 8, 2023

Perhaps it's related to my config.toml setting. I'll do more experiments tomorrow and report back...

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 9, 2023
@xry111
Copy link
Contributor Author

xry111 commented Nov 17, 2023

Still happens with 1.74.0. The terminal output of python3 x.py install (I've removed the Compiling ... lines):

Building bootstrap
    Finished dev [unoptimized] target(s) in 0.18s
Building stage0 library artifacts (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.19s
Building compiler artifacts (stage0 -> stage1, x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.33s
Creating a sysroot for stage1 compiler (use `rustup toolchain link 'name' build/host/stage1`)
Building stage1 library artifacts (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.20s
Building compiler artifacts (stage1 -> stage2, x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.30s
Creating a sysroot for stage2 compiler (use `rustup toolchain link 'name' build/host/stage2`)
Uplifting library (stage1 -> stage2)
Building stage0 tool rust-installer (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.65s
Dist rust-std-1.74.0-x86_64-unknown-linux-gnu
	finished in 1.630 seconds
Installing stage2 std (x86_64-unknown-linux-gnu)
install: creating uninstall script at /opt/rustc-1.74.0/lib/rustlib/uninstall.sh
install: installing component 'rust-std-x86_64-unknown-linux-gnu'

    rust std installed.

Uplifting rustc (stage1 -> stage3)
Building tool cargo (stage2 -> stage3, x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 2m 58s
Dist cargo-1.74.0-x86_64-unknown-linux-gnu
	finished in 0.577 seconds
Installing stage2 cargo (x86_64-unknown-linux-gnu)
install: creating uninstall script at /opt/rustc-1.74.0/lib/rustlib/uninstall.sh
install: installing component 'cargo'
install: backing up existing file at /etc/bash_completion.d/cargo

    cargo installed.

Building tool rustfmt (stage2 -> stage3, x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 43.10s
Building tool cargo-fmt (stage2 -> stage3, x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.18s
Dist rustfmt-1.74.0-x86_64-unknown-linux-gnu
	finished in 0.258 seconds
Installing stage2 rustfmt (x86_64-unknown-linux-gnu)
install: creating uninstall script at /opt/rustc-1.74.0/lib/rustlib/uninstall.sh
install: installing component 'rustfmt-preview'
install: backing up existing file at /opt/rustc-1.74.0/share/doc/rustc-1.74.0/LICENSE-APACHE
install: backing up existing file at /opt/rustc-1.74.0/share/doc/rustc-1.74.0/LICENSE-MIT
install: backing up existing file at /opt/rustc-1.74.0/share/doc/rustc-1.74.0/README.md

    rustfmt installed.

Building tool clippy-driver (stage2 -> stage3, x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 1m 06s
Building tool cargo-clippy (stage2 -> stage3, x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.18s
Dist clippy-1.74.0-x86_64-unknown-linux-gnu
	finished in 0.317 seconds
Installing stage2 clippy (x86_64-unknown-linux-gnu)
install: creating uninstall script at /opt/rustc-1.74.0/lib/rustlib/uninstall.sh
install: installing component 'clippy-preview'
install: backing up existing file at /opt/rustc-1.74.0/share/doc/rustc-1.74.0/LICENSE-APACHE
install: backing up existing file at /opt/rustc-1.74.0/share/doc/rustc-1.74.0/LICENSE-MIT
install: backing up existing file at /opt/rustc-1.74.0/share/doc/rustc-1.74.0/README.md

    clippy installed.

Building tool rustdoc (stage1 -> stage2, x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.89s
Dist rustc-1.74.0-x86_64-unknown-linux-gnu
	finished in 2.611 seconds
Installing stage2 rustc (x86_64-unknown-linux-gnu)
install: creating uninstall script at /opt/rustc-1.74.0/lib/rustlib/uninstall.sh
install: installing component 'rustc'
install: backing up existing file at /opt/rustc-1.74.0/bin/cargo-clippy
install: backing up existing file at /opt/rustc-1.74.0/bin/cargo-fmt
install: backing up existing file at /opt/rustc-1.74.0/bin/clippy-driver
install: backing up existing file at /opt/rustc-1.74.0/bin/rustfmt
install: backing up existing file at /opt/rustc-1.74.0/share/doc/rustc-1.74.0/LICENSE-APACHE
install: backing up existing file at /opt/rustc-1.74.0/share/doc/rustc-1.74.0/LICENSE-MIT
install: backing up existing file at /opt/rustc-1.74.0/share/doc/rustc-1.74.0/README.md

    rustc installed.

Build completed successfully in 0:05:07

@onur-ozkan
Copy link
Member

Would be nice if you can share your config.toml. Last time I tried I couldn't reproduce it.

@xry111
Copy link
Contributor Author

xry111 commented Nov 17, 2023

Would be nice if you can share your config.toml. Last time I tried I couldn't reproduce it.

# tell x.py to not keep printing an annoying warning
changelog-seen = 2

[llvm]
# by default, rust will build for a myriad of architectures
targets = "X86"

# When using system llvm prefer shared libraries
link-shared = true

[build]
# omit docs to save time and space (default is to build them)
docs = false

# install extended tools: cargo, clippy, etc
extended = true

# Do not query new versions of dependencies online.
locked-deps = true

# Specify which extended tools (those from the default install).
tools = ["cargo", "clippy", "rustdoc", "rustfmt"]

# Use the source code shipped in the tarball for the dependencies.
# The combination of this and the "locked-deps" entry avoids downloading
# many crates from Internet, and makes the Rustc build more stable.
vendor = true

cargo = "/opt/rustc-1.73.0/bin/cargo"
rustc = "/opt/rustc-1.73.0/bin/rustc"

[install]
prefix = "/opt/rustc-1.74.0"
docdir = "share/doc/rustc-1.74.0"

[rust]
channel = "stable"
description = "for BLFS r12.0-681"

# BLFS used to not install the FileCheck executable from llvm,
# so disabled codegen tests.  The assembly tests rely on FileCheck
# and cannot easily be disabled, so those will anyway fail if
# FileCheck has not been installed.
#codegen-tests = false

[target.x86_64-unknown-linux-gnu]
# NB the output of llvm-config (i.e. help options) may be
# dumped to the screen when config.toml is parsed.
llvm-config = "/usr/bin/llvm-config"

[target.i686-unknown-linux-gnu]
# NB the output of llvm-config (i.e. help options) may be
# dumped to the screen when config.toml is parsed.
llvm-config = "/usr/bin/llvm-config"

@psumbera
Copy link
Contributor

I think I see the same with Rust 1.76:

ls -l rustc-1.76.0/bin/*.old
-rwxr-xr-x   1 psumbera staff    4254472 Feb 12 19:56 rustc-1.76.0/bin/cargo-fmt.old
-rwxr-xr-x   1 psumbera staff    13791032 Feb 12 19:56 rustc-1.76.0/bin/rustfmt.old

@onur-ozkan
Copy link
Member

I think I see the same with Rust 1.76:

ls -l rustc-1.76.0/bin/*.old
-rwxr-xr-x   1 psumbera staff    4254472 Feb 12 19:56 rustc-1.76.0/bin/cargo-fmt.old
-rwxr-xr-x   1 psumbera staff    13791032 Feb 12 19:56 rustc-1.76.0/bin/rustfmt.old

Are you building multiple targets?

@psumbera
Copy link
Contributor

psumbera commented Feb 14, 2024

Are you building multiple targets?

No. I just set following in config.toml: extended = true and tools = ["cargo", "rustfmt"].

@onur-ozkan
Copy link
Member

#121079 should handle this problem.

Nadrieril added a commit to Nadrieril/rust that referenced this issue Feb 17, 2024
…bertlarsan68

distribute tool documentations and avoid file conflicts on `x install`

I suggest reading commits one-by-one with the descriptions for more context about the changes.

Fixes rust-lang#115213
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 17, 2024
…bertlarsan68

distribute tool documentations and avoid file conflicts on `x install`

I suggest reading commits one-by-one with the descriptions for more context about the changes.

Fixes rust-lang#115213
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 17, 2024
…bertlarsan68

distribute tool documentations and avoid file conflicts on `x install`

I suggest reading commits one-by-one with the descriptions for more context about the changes.

Fixes rust-lang#115213
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Feb 17, 2024
…bertlarsan68

distribute tool documentations and avoid file conflicts on `x install`

I suggest reading commits one-by-one with the descriptions for more context about the changes.

Fixes rust-lang#115213
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Feb 18, 2024
…bertlarsan68

distribute tool documentations and avoid file conflicts on `x install`

I suggest reading commits one-by-one with the descriptions for more context about the changes.

Fixes rust-lang#115213
bors added a commit to rust-lang-ci/rust that referenced this issue Feb 19, 2024
…rtlarsan68

distribute tool documentations and avoid file conflicts on `x install`

I suggest reading commits one-by-one with the descriptions for more context about the changes.

Fixes rust-lang#115213
@bors bors closed this as completed in 43d3470 Feb 19, 2024
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