Skip to main content

copy_build_output

Function copy_build_output 

Source
fn copy_build_output(
    config: &Config,
    build: &Path,
    workspace: &Path,
) -> Result<()>
Expand description

Copies the build output and the compiler cache of a built workspace into another workspace. The copy clones files where the file system can (APFS, Btrfs, XFS).

The compiler cache keys sources by their path relative to the root, but it stores remappings with the absolute root, and other remappings invalidate it. Both workspaces have the same files at the same relative paths, so moving the remappings to the new root keeps the cache valid, and the compiler rebuilds only sources whose content changed.