-
-
Notifications
You must be signed in to change notification settings - Fork 70
Sporadic failures with parallel builds through maturin #318
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
Comments
tuxu
added a commit
to tuxu/cargo-zigbuild
that referenced
this issue
Feb 13, 2025
Ensures that unique linker wrapper scripts are generated even when current_exe is different. Fixes an issue with concurrent builds driven through maturin. Closes rust-cross#318.
tuxu
added a commit
to tuxu/cargo-zigbuild
that referenced
this issue
Feb 13, 2025
Ensures that unique linker wrapper scripts are generated even when current_exe is different. Fixes an issue with concurrent builds driven through maturin. Closes rust-cross#318.
While testing, I noticed that there's another issue. The symlinks in the cache directory also point to
|
tuxu
added a commit
to tuxu/cargo-zigbuild
that referenced
this issue
Feb 13, 2025
Ensures that unique linker wrapper scripts are generated even when current_exe is different. Fixes an issue with concurrent builds driven through maturin. Closes rust-cross#318.
tuxu
added a commit
to tuxu/cargo-zigbuild
that referenced
this issue
Feb 13, 2025
Ensures that unique linker wrapper scripts are generated even when current_exe is different. Fixes an issue with concurrent builds driven through maturin. Closes rust-cross#318.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I ran into a race condition with cargo-zigbuild's generated linker script when multiple such builds are driven in parallel through maturin and uv. I initially blamed uv, because the error message indicated an issue with the lifetime of the temporary build venv, however @konstin pointed out that the linker script generation here is not safe (astral-sh/uv#11444 (comment)).
Steps to reproduce:
What happens is as follows:
cargo-zigbuild/src/zig.rs
Line 1437 in 1ddfd9b
When the build is driven by maturin instead of cargo, the generated linker script points to maturin inside a temporary build venv. Each build venv is destroyed by uv immediately after the build finishes. Thus, if multiple builds ran in parallel, each with their own build venv and maturin binary, but pointing to the the same linker script in the common cache directory, it's not guaranteed that the linker script script still points to a valid maturin binary when it's called later.
I think the easiest fix may be to include
env::current_exe()
in the hash of the linker script name.The text was updated successfully, but these errors were encountered: