-
Notifications
You must be signed in to change notification settings - Fork 573
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
e807fdb
e615455
69257f7
f6baa10
41c38df
d73d4bb
9c06cba
82f8b60
2e40249
3d5665a
5c358e3
1ed4e6a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -608,10 +608,10 @@ func (s *Session) BuildPackage(pkg *PackageData) (*compiler.Archive, error) { | |
| if err != nil { | ||
| return nil, fmt.Errorf("could not open %v: %v", binPath, err) | ||
| } | ||
| defer binFile.Close() | ||
|
|
||
| binHash := sha256.New() | ||
| io.Copy(binHash, binFile) | ||
| binFile.Close() | ||
|
||
| fmt.Fprintf(pkgHash, "gopherjs bin: %#x\n", binHash.Sum(nil)) | ||
|
|
||
| orderedBuildTags := append([]string{}, s.options.BuildTags...) | ||
|
|
@@ -656,6 +656,7 @@ func (s *Session) BuildPackage(pkg *PackageData) (*compiler.Archive, error) { | |
| } | ||
| fmt.Fprintf(pkgHash, "file: %v\n", fp) | ||
| n, _ := io.Copy(pkgHash, file) | ||
| file.Close() | ||
| fmt.Fprintf(pkgHash, "%d bytes\n", n) | ||
| } | ||
|
|
||
|
|
@@ -671,9 +672,9 @@ func (s *Session) BuildPackage(pkg *PackageData) (*compiler.Archive, error) { | |
| } | ||
| return nil, err | ||
| } | ||
| defer objFile.Close() | ||
|
|
||
flimzy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| archive, err := compiler.ReadArchive(pkg.PkgObj, pkg.ImportPath, objFile, s.Types) | ||
| objFile.Close() | ||
flimzy marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if err != nil { | ||
| return nil, err | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.