aboutsummaryrefslogtreecommitdiffhomepage
path: root/cgo
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2021-12-09 19:37:13 +0100
committerNia <[email protected]>2021-12-28 18:29:05 -0500
commit3e109fca5f289f5e97548f061d7e0e24c9727193 (patch)
tree4ebb81cdee9d11f98cd22435a90ba0a15082f302 /cgo
parent763a86cd8ebbc85b721cb945e7acf19d5e0b7ace (diff)
downloadtinygo-3e109fca5f289f5e97548f061d7e0e24c9727193.tar.gz
tinygo-3e109fca5f289f5e97548f061d7e0e24c9727193.zip
builder: use build ID as cache key
Instead of storing an increasing version number in relevant packages (compiler.Version, interp.Version, cgo.Version, ...), read the build ID from the currently running executable. This has several benefits: * All changes relevant to the compiled packages are caught. * No need to bump the version for each change to these packages. This avoids merge conflicts. * During development, `go install` is enough. No need to run `tinygo clean` all the time. Of course, the drawback is that it might be updated a bit more often than necessary but I think the overall benefit is big. Regular release users shouldn't see any difference. Because the tinygo binary stays the same, the cache works well.
Diffstat (limited to 'cgo')
-rw-r--r--cgo/cgo.go6
1 files changed, 0 insertions, 6 deletions
diff --git a/cgo/cgo.go b/cgo/cgo.go
index cd0c29d8f..efaa949cc 100644
--- a/cgo/cgo.go
+++ b/cgo/cgo.go
@@ -26,12 +26,6 @@ import (
"golang.org/x/tools/go/ast/astutil"
)
-// Version of the cgo package. It must be incremented whenever the cgo package
-// is changed in a way that affects the output so that cached package builds
-// will be invalidated.
-// This version is independent of the TinyGo version number.
-const Version = 1 // last change: run libclang once per Go file
-
// cgoPackage holds all CGo-related information of a package.
type cgoPackage struct {
generated *ast.File