diff --git a/src/global/trampoline.rs b/src/global/trampoline.rs index d9ea13ab6..9055f324c 100644 --- a/src/global/trampoline.rs +++ b/src/global/trampoline.rs @@ -354,9 +354,15 @@ impl Trampoline { .into_diagnostic()?; } - // Create a hard link to the shared trampoline binary - if !self.path().exists() { - tokio::fs::hard_link(self.trampoline_path(), self.path()) + // If the path doesn't exist yet, create a hard link to the shared trampoline binary + // If creating a hard link doesn't succeed, try copying + // Hard-linking might for example fail because the file-system enforces a maximum number of hard-links per file + if !self.path().exists() + && tokio_fs::hard_link(self.trampoline_path(), self.path()) + .await + .is_err() + { + tokio_fs::copy(self.trampoline_path(), self.path()) .await .into_diagnostic()?; }