Skip to content

Commit a3e7e93

Browse files
myitcvflimzy
authored andcommitted
Add build tags to the hash
1 parent b4e03df commit a3e7e93

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

build/build.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"os/exec"
2222
"path"
2323
"path/filepath"
24+
"sort"
2425
"strconv"
2526
"strings"
2627

@@ -608,6 +609,11 @@ func (s *Session) BuildPackage(pkg *PackageData) (*compiler.Archive, error) {
608609
defer binFile.Close()
609610
io.Copy(pkgHash, binFile)
610611

612+
orderedBuildTags := append([]string{}, s.options.BuildTags...)
613+
sort.Strings(orderedBuildTags)
614+
615+
fmt.Fprintf(pkgHash, "build tags: %v\n", strings.Join(orderedBuildTags, ","))
616+
611617
for _, importedPkgPath := range pkg.Imports {
612618
// Ignore all imports that aren't mentioned in import specs of pkg.
613619
// For example, this ignores imports such as runtime/internal/sys and runtime/internal/atomic.

0 commit comments

Comments
 (0)