Skip to content

Overwrite CARGO_BUILD_BUILD_DIR as well to avoid deadlocks - #1174

Merged
emilio merged 1 commit into
mozilla:mainfrom
SwishSwushPow:fix-cargo-build-build-dir
Jul 26, 2026
Merged

Overwrite CARGO_BUILD_BUILD_DIR as well to avoid deadlocks#1174
emilio merged 1 commit into
mozilla:mainfrom
SwishSwushPow:fix-cargo-build-build-dir

Conversation

@SwishSwushPow

@SwishSwushPow SwishSwushPow commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Hi everyone,

I was playing around with CARGO_BUILD_BUILD_DIR (https://releases.rs/docs/1.91.0/#cargo) the last couple of days and noticed that my Rust workspace, which uses cbindgens [pase.expand] feature, would deadlock when building.

Since cbindgen is already handling this issue related to CARGO_TARGET_DIR I wanted to open this PR to apply the same treatment to CARGO_BUILD_BUILD_DIR. I think that it is probably ok to not introduce a new CARGO_EXPAND_BUILD_DIR env var because I feel like it would be ok for the expand-related artifacts to be located in the same place.

I hope that it is ok that I've opened this PR. I am open to discuss any changes or additions that are suggested. :)

This follows how CARGO_TARGET_DIR is handled and sets the same directory.
Comment thread src/bindgen/cargo/cargo_expand.rs
@emilio

emilio commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

I think this is fine, thanks!

@emilio
emilio added this pull request to the merge queue Jul 26, 2026
Merged via the queue into mozilla:main with commit fe69924 Jul 26, 2026
4 checks passed
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.

2 participants