Skip to content

Improve Offload artifact creation - #162305

Draft
ZuseZ4 wants to merge 2 commits into
rust-lang:mainfrom
ZuseZ4:offload-host-fat-lto
Draft

Improve Offload artifact creation#162305
ZuseZ4 wants to merge 2 commits into
rust-lang:mainfrom
ZuseZ4:offload-host-fat-lto

Conversation

@ZuseZ4

@ZuseZ4 ZuseZ4 commented Sep 4, 2026

Copy link
Copy Markdown
Member

I think the underlying problem is that we don't treat these artifacts (especially device.bin, less the Host Manifest) as proper rust options to --emit. We could change that, but I'm not sure if it's the right path forward, given that it's just a glorified bit code wrapper. I feel like we can probably drop it (along with using some LLVM APIs) by just passing the bitcode files around. I mainly need to figure out which other tooling we might have access too if we keep following their bundle workflow.

Previously, we'd generate one host.o per CGU, overwriting each other.
We then would generate one more host.o during the final fat-lto run,
which was the one we ended up using. Move the host handling code, so
we stop generating the per-cgu host.o files that got overwritten anyway
The Device pass mainly creates a `device.bin` artifact. It previously
did that once per CGU, with the last one surviving. By coincidence that
usually worked. On the host side we solved that by enforcing fat-lto.
On the device, we might not have fat-lto (e.g. if built as an rlib),
and this one is the smaller correctness fix for now.
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 4, 2026
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
fmt: checked 7244 files
tidy check
tidy [rustdoc_json (src)]: `rustdoc-json-types` modified, checking format version
tidy: Skipping binary file check, read-only filesystem
tidy [style (compiler)]: /checkout/compiler/rustc_codegen_llvm/src/back/offload.rs:2: \
Use a single space after dots in comments.
tidy [style (compiler)]: FAIL
removing old virtual environment
creating virtual environment at '/checkout/obj/build/venv' using 'python3.12' and 'venv'
Requirement already satisfied: pip in ./build/venv/lib/python3.12/site-packages (24.0)
Collecting pip
  Downloading pip-26.2.1-py3-none-any.whl.metadata (4.6 kB)
---
typechecking javascript files
tidy: The following check failed: style (compiler)
Bootstrap failed while executing `test src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck`
Currently active steps:
test::Tidy {  } at src/bootstrap/src/core/build_steps/test.rs:1665
Command `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools-bin/rust-tidy --root-path=/checkout --cargo-path=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo --output-dir=/checkout/obj/build --concurrency=4 --npm-path=/node/bin/yarn --ci=true --extra-checks=py,cpp,js,spellcheck` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:1627:23
Executed at: src/bootstrap/src/core/build_steps/test.rs:1747:29

Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:02:35
  local time: Fri Sep  4 16:41:30 UTC 2026
  network time: Fri, 04 Sep 2026 16:41:30 GMT
##[error]Process completed with exit code 1.
##[group]Run echo "disk usage:"

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. A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

3 participants