From 8d2e0725e79273e46758d8efe35aca477e82fb5b Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Fri, 27 Oct 2023 02:36:10 -0700 Subject: [PATCH] Fix fallback to copyfile --- src/install/install.zig | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/install/install.zig b/src/install/install.zig index dbe03f7c65..57ef430c16 100644 --- a/src/install/install.zig +++ b/src/install/install.zig @@ -1650,12 +1650,16 @@ const PackageInstall = struct { .hardlink => { if (this.installWithHardlink()) |result| { return result; - } else |err| { + } else |err| outer: { + if (comptime !Environment.isWindows) { + if (err == error.NotSameFileSystem) { + supported_method = .copyfile; + supported_method_to_use = .copyfile; + break :outer; + } + } + switch (err) { - // error.ENXIO => { - // supported_method = .copyfile; - // supported_method_to_use = .copyfile; - // }, error.FileNotFound => return Result{ .fail = .{ .err = error.FileNotFound, .step = .opening_cache_dir }, },