Skip to content

Fix CI when codegen .so is clobbered#274

Closed
LegNeato wants to merge 1 commit intoRust-GPU:mainfrom
LegNeato:citruncate
Closed

Fix CI when codegen .so is clobbered#274
LegNeato wants to merge 1 commit intoRust-GPU:mainfrom
LegNeato:citruncate

Conversation

@LegNeato
Copy link
Copy Markdown
Contributor

The workspace builds rustc_codegen_nvvm as a normal Cargo member. During every CUDA build script, cuda_builder re-builds that same crate through -Zcodegen-backend=. Cargo produces two identical librustc_codegen_nvvm.so.

cuda_builder then tried to copy the backend .so into target/codegen-backends while rustc_codegen_nvvm was still being linked. It sometimes read a half- written file.

Now cuda_builder still knows how to depend on rustc_codegen_nvvm, but that dependency lives behind a default feature. Inside the workspace we turn the default feature off so the backend is built exactly once as a regular workspace member.

External users get the same old behaviour because the feature defaults to on.

We also no longer blindly assume the .so already exists in cuda_builder. The build script is now more defensive.

The workspace builds rustc_codegen_nvvm as a normal Cargo member.
During every CUDA build script, cuda_builder re-builds that same crate
through -Zcodegen-backend=. Cargo produces two identical
librustc_codegen_nvvm.so.

cuda_builder then tried to copy the backend .so into target/codegen-backends
while rustc_codegen_nvvm was still being linked. It sometimes read a half-
written file.

Now cuda_builder still knows how to depend on rustc_codegen_nvvm, but that
dependency lives behind a default feature. Inside the workspace we turn the
default feature off so the backend is built exactly once as a regular workspace
member.

External users get the same old behaviour because the feature defaults to on.

We also no longer blindly assume the .so already exists in cuda_builder.
The build script is now more defensive.
@LegNeato LegNeato closed this Sep 19, 2025
@LegNeato LegNeato reopened this Sep 19, 2025
@LegNeato LegNeato marked this pull request as draft September 19, 2025 16:55
@LegNeato LegNeato closed this Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant