-
Notifications
You must be signed in to change notification settings - Fork 524
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
Use OS temp directory instead of CARGO_TARGET_TMPDIR in bindgen tests #3428
Conversation
Can you say more? The docs say Cargo will create it so if it doesn't then that's definitely a bug in Cargo. However, it also says that Cargo doesn't manage it which means that anything could delete it. And if that's happening then it's likely a bug in the testing code somewhere. |
Sporadic build failures suddenly started showing up today like this one: https://github.com/microsoft/windows-rs/actions/runs/12679261715/job/35339673541 |
That's on stable, huh. Which definitely hasn't changed recently. Strange. Possibly some change in CI uncovered a bug somewhere. But seems weird. |
@ChrisDenton I noticed on my local machine (and on the runners via SSH) that the directory was missing during the test run. In my local testing, I see Cargo creates the folder once during a compile pass but not during a test run--not conclusive, I realize. (Maybe this is intentional; the documentation isn't clear to me!) In these bindgen tests, if the But given the errors we're now encountering in this PR, maybe CI could use a break tonight. 😅 |
What's not clear to me is if Cargo creates the folder once then what deletes it? |
I'm not sure whether this is causing failures but I've noticed this a few times (on master): https://github.com/microsoft/windows-rs/actions/runs/12679261715/job/35374800510 "warning: Perhaps because we build with this: Line 3 in ffb9078
I assume this runner has just got some old config stuff in it. 🤷 Update: reran a few times and this seems unrelated but perhaps somebody at GitHub can clean up this warning? |
It seems this change does not address the problem: https://github.com/microsoft/windows-rs/actions/runs/12682378553/job/35376701787?pr=3428 |
Oh do these tests possibly run in the same process? That would explain it. 🫢 |
Thanks for the eyeballs on this issue @riverar @ChrisDenton |
In my testing, I found that
CARGO_TARGET_TMPDIR
is not guaranteed to point to an existing directory, contrary to what is stated in the Cargo documentation. To address this, and stabilize the bindgen tests, I replaced references toCARGO_TARGET_TMPDIR
with calls tostd::env::temp_dir()
.