magiclantern_simplified icon indicating copy to clipboard operation
magiclantern_simplified copied to clipboard

Audit makefiles for bad >> usage, race condition

Open reticulatedpines opened this issue 9 months ago • 0 comments

In multiple places, we build up a file using >> with shell commands for concatenating output. If the target file is a dependency for a make target, e.g. version.c, which version.o depends on, and you build in parallel, it's possible for version.o to attempt to build with an intermediate version of the file, since it may exist on disk at any stage in the process of concatenating file data.

We should probably concat into a temp file, and move that to the correct name as the final step, so intermediate content cannot be seen.

reticulatedpines avatar May 28 '24 04:05 reticulatedpines