File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ go_library(
21
21
importpath = "github.com/aspect-build/aspect-cli/gazelle/js" ,
22
22
visibility = ["//visibility:public" ],
23
23
deps = [
24
+ "//buildinfo" ,
24
25
"//gazelle/common" ,
25
26
"//gazelle/common/cache" ,
26
27
"//gazelle/common/git" ,
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import (
27
27
"strings"
28
28
"sync"
29
29
30
+ "github.com/aspect-build/aspect-cli/buildinfo"
30
31
gazelle "github.com/aspect-build/aspect-cli/gazelle/common"
31
32
"github.com/aspect-build/aspect-cli/gazelle/common/cache"
32
33
starlark "github.com/aspect-build/aspect-cli/gazelle/common/starlark"
@@ -858,7 +859,15 @@ func init() {
858
859
func computeCacheKey (content []byte ) (string , bool ) {
859
860
cacheDigest := crypto .MD5 .New ()
860
861
862
+ if buildinfo .IsStamped () {
863
+ if _ , err := cacheDigest .Write ([]byte (buildinfo .GitCommit )); err != nil {
864
+ BazelLog .Errorf ("Failed to write GitCommit to cache digest: %v" , err )
865
+ return "" , false
866
+ }
867
+ }
868
+
861
869
if _ , err := cacheDigest .Write (content ); err != nil {
870
+ BazelLog .Errorf ("Failed to write source to cache digest: %v" , err )
862
871
return "" , false
863
872
}
864
873
You can’t perform that action at this time.
0 commit comments