Skip to content

Some configurations build the compiler too many times #138123

New issue

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

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

Already on GitHub? # to your account

Closed
ehuss opened this issue Mar 6, 2025 · 0 comments · Fixed by #138148
Closed

Some configurations build the compiler too many times #138123

ehuss opened this issue Mar 6, 2025 · 0 comments · Fixed by #138148
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

@ehuss
Copy link
Contributor

ehuss commented Mar 6, 2025

In investigating #138039, here are some observations:

I am running this command as an illustration:

./x dist  --host powerpc64le-unknown-linux-gnu --target powerpc64le-unknown-linux-gnu --dry-run | grep "compiler artifacts"

After #138039

No config:

Building compiler artifacts (stage0 -> stage1, x86_64-unknown-linux-gnu)
Building compiler artifacts (stage1 -> stage2, x86_64-unknown-linux-gnu)
Building compiler artifacts (stage1:x86_64-unknown-linux-gnu -> stage2:powerpc64le-unknown-linux-gnu)

Not really clear why it is doing stage1 -> stage2, x86_64-unknown-linux-gnu, that should not be needed.

With the config:

[build]
docs = false

Yay, it seems to be doing the right thing:

Building compiler artifacts (stage0 -> stage1, x86_64-unknown-linux-gnu)
Building compiler artifacts (stage1:x86_64-unknown-linux-gnu -> stage2:powerpc64le-unknown-linux-gnu)

With the config:

[build]
docs = false

[rust]
llvm-bitcode-linker = true

Boo, it seems to build the host compiler twice when it shouldn't:

Building compiler artifacts (stage0 -> stage1, x86_64-unknown-linux-gnu)
Building compiler artifacts (stage1:x86_64-unknown-linux-gnu -> stage2:powerpc64le-unknown-linux-gnu)
Building compiler artifacts (stage0:x86_64-unknown-linux-gnu -> stage1:powerpc64le-unknown-linux-gnu)

Before #137215

The "no config" behavior is the same, but the other configs seem to work correctly (only two compilers built).

Docs

I only vaguely recall building the docs requires linking to the compiler.... I don't have time at the moment to refresh my memory. I don't know if it is absolutely required to have a stage2 compiler for that. It might be good to see if there are alternate solutions.

@ehuss ehuss added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Mar 6, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 6, 2025
@onur-ozkan onur-ozkan added 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 Mar 6, 2025
@onur-ozkan onur-ozkan self-assigned this Mar 6, 2025
bors added a commit to rust-lang-ci/rust that referenced this issue Mar 7, 2025
…=<try>

use target compiler on llvm-bitcode-linker

The build compiler is already resolved inside the `ToolBuild` step, so we should pass only the target compilers for `Mode::ToolRustc` tools.

Fixes rust-lang#138123

r? ghost

try-job: dist-powerpc64le-linux
@bors bors closed this as completed in c53af1c Mar 7, 2025
bors added a commit to rust-lang-ci/rust that referenced this issue Apr 20, 2025
ensure compiler existance of tools on the dist step

Fixes rust-lang#138778 with a coverage on rust-lang#138123 and rust-lang#138004.

try-job: dist-powerpc64le-linux
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Apr 25, 2025
ensure compiler existance of tools on the dist step

Fixes rust-lang#138778 with a coverage on rust-lang#138123 and rust-lang#138004.

try-job: dist-powerpc64le-linux
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Apr 25, 2025
Rollup merge of rust-lang#140006 - onur-ozkan:138778, r=onur-ozkan

ensure compiler existance of tools on the dist step

Fixes rust-lang#138778 with a coverage on rust-lang#138123 and rust-lang#138004.

try-job: dist-powerpc64le-linux
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Apr 26, 2025
ensure compiler existance of tools on the dist step

Fixes rust-lang/rust#138778 with a coverage on rust-lang/rust#138123 and rust-lang/rust#138004.

try-job: dist-powerpc64le-linux
# for free to join this conversation on GitHub. Already have an account? # 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.

3 participants