From e702cb94fffbdcd023f95ce0255ebf2f37c89dc4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 25 Feb 2025 18:44:40 -0400 Subject: [PATCH] add compute remote uuid to compute state url Otherwise, two different compute remotes that happen to take the same input would use the same compute state url. Which seems wrong. --- Command/AddComputed.hs | 2 +- Remote/Compute.hs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Command/AddComputed.hs b/Command/AddComputed.hs index 0d614a1fc0..7afd23a129 100644 --- a/Command/AddComputed.hs +++ b/Command/AddComputed.hs @@ -147,7 +147,7 @@ perform o r program = do | otherwise = ingestwith $ ingestAdd' nullMeterUpdate (Just ld) (Just stateurlk) where - stateurl = Remote.Compute.computeStateUrl state outputfile + stateurl = Remote.Compute.computeStateUrl r state outputfile stateurlk = fromUrl stateurl Nothing True outputfile' = tmpdir outputfile ld = LockedDown ldc $ KeySource diff --git a/Remote/Compute.hs b/Remote/Compute.hs index 1157ac581d..b6ba1dbf2e 100644 --- a/Remote/Compute.hs +++ b/Remote/Compute.hs @@ -257,9 +257,9 @@ parseComputeState k b = in go c' rest {- A compute: url for a given output file of a computation. -} -computeStateUrl :: ComputeState -> OsPath -> URLString -computeStateUrl st p = - "annex-compute:" ++ fromOsPath p ++ "?" +computeStateUrl :: Remote -> ComputeState -> OsPath -> URLString +computeStateUrl r st p = + "annex-compute:" ++ fromUUID (uuid r) ++ "/" ++ fromOsPath p ++ "?" ++ decodeBS (formatComputeState' Nothing st') where -- Omit computeOutputs, so this gives the same result whether