Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

compiler: use hash calculation for determining archive staleness #805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
Loading
from
Prev Previous commit
Next Next commit
More readable version of hash for debug purposes
  • Loading branch information
myitcv committed May 4, 2018
commit f6baa109ae44fec7040539794cdd6737f90ba397
7 changes: 5 additions & 2 deletions 7 build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,10 @@ func (s *Session) BuildPackage(pkg *PackageData) (*compiler.Archive, error) {
return nil, fmt.Errorf("could not open %v: %v", binPath, err)
}
defer binFile.Close()
io.Copy(pkgHash, binFile)

binHash := sha256.New()
io.Copy(binHash, binFile)
flimzy marked this conversation as resolved.
Show resolved Hide resolved
fmt.Fprintf(pkgHash, "gopherjs bin: %#x\n", binHash.Sum(nil))

orderedBuildTags := append([]string{}, s.options.BuildTags...)
sort.Strings(orderedBuildTags)
Expand Down Expand Up @@ -642,7 +645,7 @@ func (s *Session) BuildPackage(pkg *PackageData) (*compiler.Archive, error) {
}

fmt.Fprintf(pkgHash, "import: %v\n", importedPkgPath)
fmt.Fprintf(pkgHash, " hash: %v\n", importedArchive.Hash)
fmt.Fprintf(pkgHash, " hash: %#x\n", importedArchive.Hash)
}

for _, name := range append(pkg.GoFiles, pkg.JSFiles...) {
flimzy marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.