Closed sbinet closed 6 years ago
We regenerate the .a file because we load it with the go/types package, and we want to make sure we have an up-to-date .a file. In the Go 1.10 caching world, it would be better if we just called "go build" for the package, and then loaded the .a file from the cache. That way the go command would not regenerate the .a file in the typical case.
Is there a way yet to find the .a file for a package in the cache? I believe Russ had discussed doing that, but I haven't been following since my leave started. I'll dig around later today.
Yeah there's no cache-aware version of gcimporter, so in lieu of writing one we will have to keep using go install to generate the necessary .a files.
OK, I think I can fix this. It will make some import operations very slow on Go 1.9, but I think the focus should be on Go 1.10 anyway thanks to its better plugin support.
this was discussed on golang-dev: https://groups.google.com/forum/#!topic/golang-dev/qfa3mHN4ZPA
the gist of it (as I understand it), is that the cache is invalidated for
eval
tests because when importing a Go package, we re-install it (before generating aplugin
enable wrapper of it).this prevents the cache to kick in because the resulting
foo.a
file is too new:(this was obtained, even after d9a7f2e was in)