don't let -debug affect the build cache hashes

Noticed while debugging #492,
as adding -debug to a previously run command would unexpectedly
rebuild all packages in the build, as if -a was given.

While here, remove commented out testscript that were kept in error.
pull/495/head
Daniel Martí 3 years ago committed by lu4p
parent 88a27d491b
commit ad87a0e2bc

@ -118,7 +118,11 @@ func appendFlags(w io.Writer, forBuildHash bool) {
if flagTiny {
io.WriteString(w, " -tiny")
}
if flagDebug {
if flagDebug && !forBuildHash {
// -debug doesn't affect the build result at all,
// so don't give it separate entries in the build cache.
// If the user really wants to see debug info for already built deps,
// they can use "go clean cache" or the "-a" build flag to rebuild.
io.WriteString(w, " -debug")
}
if flagDebugDir != "" && !forBuildHash {

@ -1,8 +1,5 @@
env GOGARBLE=*
# ! garble -debug -debugdir ./debug1 build
# cp stderr /tmp/log
# exit
garble -debugdir ./debug1 build
exists 'debug1/test/main/imported/imported.go' 'debug1/test/main/main.go' 'debug1/reflect/type.go'
! grep ImportedFunc $WORK/debug1/test/main/imported/imported.go

Loading…
Cancel
Save