Skip to main content

materialise

Function materialise 

Source
pub fn materialise(root: &Path, graph: &CommandGraph) -> Result<Outcome>
Expand description

Write the bridge and its manifest, atomically, and only when the graph changed.

Two shells entering the repository at once may both call this. Each renders to its own temporary file and renames it over the destination, which is atomic on the platforms this runs on, so a reader sees one complete file or the other and never a half-written one. No lock is taken: the two contents are identical whenever the two graphs are, and the loser of the race has written the same bytes as the winner.