Skip to content

pdg: use mutex around cargo runs to avoid file race conditions#1380

Merged
kkysen merged 1 commit intomasterfrom
kkysen/fix-cargo-run-c2rust-instrument-race
Sep 29, 2025
Merged

pdg: use mutex around cargo runs to avoid file race conditions#1380
kkysen merged 1 commit intomasterfrom
kkysen/fix-cargo-run-c2rust-instrument-race

Conversation

@kkysen
Copy link
Contributor

@kkysen kkysen commented Sep 27, 2025

@kkysen kkysen requested a review from fw-immunant September 27, 2025 02:27
Copy link
Contributor

@fw-immunant fw-immunant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An interior-mutable static within function scope was a little surprising to read (just b/c it's not common to see something interacting with itself across multiple concurrent calls to the same function) but is correct as far as I can tell.

Copy link
Contributor Author

@kkysen kkysen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An interior-mutable static within function scope was a little surprising to read (just b/c it's not common to see something interacting with itself across multiple concurrent calls to the same function) but is correct as far as I can tell.

Yeah, kind of weird, but all of the concurrent calls are coming from here through the test framework, so it should work. I tried a few more complicated things before realizing I could just do this.

@kkysen kkysen merged commit 88a4af2 into master Sep 29, 2025
5 checks passed
@kkysen kkysen deleted the kkysen/fix-cargo-run-c2rust-instrument-race branch September 29, 2025 17:27
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.

Intermittent macOS CI failures

2 participants