Avoid symlinking RECORD file (#227)

This is the one file that gets modified during installation. Hardlinking
it is bad!
This commit is contained in:
Charlie Marsh 2023-10-29 20:10:38 -07:00 committed by GitHub
parent 1d3ea242d4
commit ffbf6b6c16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -372,8 +372,12 @@ fn hardlink_wheel_files(
continue;
}
// Copy the file.
fs::hard_link(entry.path(), &out_path)?;
// Hardlink the file, unless it's the `RECORD` file, which we modify during installation.
if entry.path().ends_with("RECORD") {
fs::copy(entry.path(), &out_path)?;
} else {
fs::hard_link(entry.path(), &out_path)?;
}
count += 1;
}