Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake: atomic rename to fix toolchain cache creation race
While this race seems unlikely and harmless let's play it safe and implement the usual solution: temporary file + atomic rename. The race is unlikely and maybe even harmless because: - Only sanitycheck seems to invoke cmake concurrently. - Users rarely delete their ~/.cache/zephyr/ToolchainCapabilityDatabase/ - All concurrent cmake processes write the same, single byte to the same files. - Creating a single byte is at least very fast, so extremely short window for others to read an empty file. For additional background see links in issue #9992 Signed-off-by: Marc Herbert <[email protected]>
- Loading branch information