GitInput: Include deepClone option in the cache key
Without this commit, two jobsets using the same repository as input, but different `deepClone` options, end up incorrectly sharing the same "checkout" for a given (`uri`, `branch`, `revision`) tuple. The presence or absence of `.git` is determined by the jobset execution order. This patch adds the missing `isDeepClone` boolean to the cache key. The database upgrade script empties the `CachedGitInputs` table, as we don't know if existing checkouts are deep clones. Unfortunately, this generally forces rebuilds even for correct `deepClone` checkouts, as the binary contents of `.git` are not deterministic. Fixes #510
This commit is contained in:
@ -402,9 +402,10 @@ create table CachedGitInputs (
|
||||
uri text not null,
|
||||
branch text not null,
|
||||
revision text not null,
|
||||
isDeepClone boolean not null,
|
||||
sha256hash text not null,
|
||||
storePath text not null,
|
||||
primary key (uri, branch, revision)
|
||||
primary key (uri, branch, revision, isDeepClone)
|
||||
);
|
||||
|
||||
create table CachedDarcsInputs (
|
||||
|
12
src/sql/upgrade-76.sql
Normal file
12
src/sql/upgrade-76.sql
Normal file
@ -0,0 +1,12 @@
|
||||
-- We don't know if existing checkouts are deep clones. This will
|
||||
-- force a new fetch (and most likely trigger a new build for deep
|
||||
-- clones, as the binary contents of '.git' are not deterministic).
|
||||
DELETE FROM CachedGitInputs;
|
||||
|
||||
ALTER TABLE CachedGitInputs
|
||||
ADD COLUMN isDeepClone BOOLEAN NOT NULL;
|
||||
|
||||
ALTER TABLE CachedGitInputs DROP CONSTRAINT cachedgitinputs_pkey;
|
||||
|
||||
ALTER TABLE CachedGitInputs ADD CONSTRAINT cachedgitinputs_pkey
|
||||
PRIMARY KEY (uri, branch, revision, isDeepClone);
|
Reference in New Issue
Block a user