MEGA65 / mega65-libc

Simple C library for the MEGA65
Other
25 stars 18 forks source link

Prevent race condition on parallel build #54

Closed zeldin closed 1 month ago

zeldin commented 3 months ago

Two or more threads could all at the same time test that the "work" directory did not exist and then each proceed to create it, with all but one failing. By making it an ordering dependency, this is prevented from happening.

Checklist

Thanks a lot for your contribution! Please tick off the following:

Note: I did not change any code, just the Makefile. I can't run make test currently because I don't have xmega65. Getting that to run is probably a separate adventure. :smile:

lgblgblgb commented 3 months ago

Isn't that more simple to use mkdir -p which won't fail when a directory already exist? Then there is no even need for testing if the directory already exists just mkdir -p work unconditionally.

zeldin commented 3 months ago

Sure, that would work as well.

zeldin commented 3 months ago

I have now managed to build xmega65 for Linux/PPC64 (this turned out to be super easy, kudos!), so all the tests have been run. I also ran the mkdir -p version through the tests and that passed as well. Let me know if you prefer that version and I'll just force push this PR.