From ffbf6b6c16c886e8cb677bbba99f659a2fc14762 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sun, 29 Oct 2023 20:10:38 -0700 Subject: [PATCH] Avoid symlinking `RECORD` file (#227) This is the one file that gets modified during installation. Hardlinking it is bad! --- crates/install-wheel-rs/src/linker.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/install-wheel-rs/src/linker.rs b/crates/install-wheel-rs/src/linker.rs index fd73e183d..6856d8776 100644 --- a/crates/install-wheel-rs/src/linker.rs +++ b/crates/install-wheel-rs/src/linker.rs @@ -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; }