From 686e9467fd920569e83e1d48474ff6302054798a Mon Sep 17 00:00:00 2001 From: Andrei Boar Date: Mon, 19 Dec 2022 18:23:49 +0200 Subject: [PATCH] fix symlink when it has changed file pointer after build --- bobtask/artifact_extract.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bobtask/artifact_extract.go b/bobtask/artifact_extract.go index b5d40c7b..911ef79a 100644 --- a/bobtask/artifact_extract.go +++ b/bobtask/artifact_extract.go @@ -70,6 +70,7 @@ func (t *Task) ArtifactExtract(artifactName hash.In, invalidFiles map[string][]t // symlink if archiveFile.FileInfo.Mode()&os.ModeSymlink == os.ModeSymlink { + os.RemoveAll(dst) err = os.Symlink(header.Linkname, dst) errz.Fatal(err) continue @@ -131,7 +132,7 @@ func shouldFetchFromCache(filename string, invalidFiles map[string][]target.Reas return false } for _, reason := range invalidFiles[filename] { - if reason == target.ReasonHashChanged || reason == target.ReasonMissing { + if reason == target.ReasonSizeChanged || reason == target.ReasonHashChanged || reason == target.ReasonMissing { return true } }