Skip to content

Various incr comp session refactors - #165145

Open
bjorn3 wants to merge 9 commits into
rust-lang:mainfrom
bjorn3:lto_refactors23
Open

bjorn3 wants to merge 9 commits into
rust-lang:mainfrom
bjorn3:lto_refactors23

Conversation

@bjorn3

@bjorn3 bjorn3 commented Oct 29, 2026

Copy link
Copy Markdown
Member

The first half of this PR is preparations for being able to create multiple incr comp sessions for a single crate. This will become important to store the post-ThinLTO incr comp artifacts once -Zno-link/-Zlink-only will run ThinLTO in a separate rustc session, thus requiring the main incr comp session to be finished before ThinLTO runs. The second half of this PR is a bunch of minor cleanups to load_dep_graph.

Part of rust-lang/compiler-team#908

We start with a fresh incr comp session dir, so an already existing file
would mean that there is a conflict between two files produced by the
same rustc instance.
@rustbot

rustbot commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

rustc_codegen_gcc is developed in its own repository. If possible, consider making this change to rust-lang/rustc_codegen_gcc instead.

cc @antoyo, @GuillaumeGomez

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 29, 2026
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 29, 2026
@rustbot

rustbot commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

r? @Enselic

rustbot has assigned @Enselic.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler, incremental
  • compiler, incremental expanded to 77 candidates
  • Random selection from 22 candidates

@rust-log-analyzer

This comment has been minimized.

@Enselic

Enselic commented Oct 29, 2026

Copy link
Copy Markdown
Member

@rustbot reroll

@rustbot rustbot assigned fee1-dead and unassigned Enselic Oct 29, 2026
@rustbot

rustbot commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

miri is developed in its own repository. If the Miri part of this change can be broken out, consider making this change to rust-lang/miri instead. However, if Miri needs adjusting for rustc changes, just ignore this message.

cc @rust-lang/miri

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-aarch64-gnu-llvm-22-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
failures:

---- [ui] tests/ui-fulldeps/codegen-backend/hotplug.rs#dep stdout ----

error in revision `dep`: auxiliary build of /checkout/tests/ui-fulldeps/codegen-backend/auxiliary/the_backend.rs failed to compile: 
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui-fulldeps/codegen-backend/auxiliary/the_backend.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--cfg" "dep" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui-fulldeps/codegen-backend/hotplug.dep/auxiliary" "-Znext-solver=coherence" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "--edition=2021" "--crate-type" "dylib" "-L" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui-fulldeps/codegen-backend/hotplug.dep/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0432]: unresolved import `rustc_session::IncrCompSession`
##[error]  --> /checkout/tests/ui-fulldeps/codegen-backend/auxiliary/the_backend.rs:21:21
   |
---

---- [ui] tests/ui-fulldeps/codegen-backend/hotplug.rs#dep stdout end ----
---- [ui] tests/ui-fulldeps/codegen-backend/hotplug.rs#bindep stdout ----

error in revision `bindep`: auxiliary build of /checkout/tests/ui-fulldeps/codegen-backend/auxiliary/the_backend.rs failed to compile: 
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui-fulldeps/codegen-backend/auxiliary/the_backend.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--cfg" "bindep" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui-fulldeps/codegen-backend/hotplug.bindep/auxiliary" "-Znext-solver=coherence" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "--edition=2021" "--crate-type" "dylib" "-L" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui-fulldeps/codegen-backend/hotplug.bindep/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0432]: unresolved import `rustc_session::IncrCompSession`
##[error]  --> /checkout/tests/ui-fulldeps/codegen-backend/auxiliary/the_backend.rs:21:21
   |
---

---- [ui] tests/ui-fulldeps/codegen-backend/hotplug.rs#bindep stdout end ----
---- [ui] tests/ui-fulldeps/codegen-backend/hotplug.rs#normal stdout ----

error in revision `normal`: auxiliary build of /checkout/tests/ui-fulldeps/codegen-backend/auxiliary/the_backend.rs failed to compile: 
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui-fulldeps/codegen-backend/auxiliary/the_backend.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--cfg" "normal" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui-fulldeps/codegen-backend/hotplug.normal/auxiliary" "-Znext-solver=coherence" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "--edition=2021" "--crate-type" "dylib" "-L" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui-fulldeps/codegen-backend/hotplug.normal/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0432]: unresolved import `rustc_session::IncrCompSession`
##[error]  --> /checkout/tests/ui-fulldeps/codegen-backend/auxiliary/the_backend.rs:21:21
   |

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants