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
x/build/buildlet: trim go1.4 tarballs #9797
Comments
We need to provide at least a file containing the package statement for
each package to satisfy the go tool (also need to make sure the dummy
source file should have earlier timestamp than its pkg.a file.
However, I think just removing unused Go based programs (I think only
bin/go, tool/6g, tool/6l are needed) will recover more space than removing
all the source code.
|
There's a cost to just opening, writing, and closing a file, however small, since it needs to do discontiguous reads/writes for the inode metadata, etc. Eliminating a few thousand of them seems worthwhile. |
sure, I thought you only concerned about the total size of the tarball.
But given we always require Go 1.4 to bootstrap, can we just add Go 1.4 to
the base image. (We can always use 1.4.0, because we can't assume what
version the final user is using, so we should only the least version.)
The go15bootstrap document said we want to keep the compiler bootstrapable
with 1.4 for as long as possible, now this is one more reason to keep that
promise.
When building the base image we can use adg's gostrip tool to build a
minimal Go 1.4 installation.
|
I did end up baking Go 1.4 into the Linux images, since they were easy to generate (with Docker). But the VM images are slow enough to generate, I'd rather not bake in Go 1.4 in general, since it gives us more flexibility to not touch the VM image (the buildlet library supports either way, though). I suppose to eliminate disk I/O (if we don't care about the network transfer speed, which I don't really), we could teach the buildlet to just skip over certain file entries when writing Go 1.4 to disk. That's probably easiest, and fixes the problem for all builders retroactively without regenerating their go1.4.*.tar.gz files on GCS. |
Notes on how I trimmed a bunch of stuff from the bootstrap.bash result:
|
CL https://golang.org/cl/21657 mentions this issue. |
Not high priority, but there's a lot of stuff in our go1.4 tarballs that are untarred on builds which can be removed to reduce network & disk I/O and thus improve build latency:
Biggest things:
Probably don't need pprof, objdump, nm, yacc, etc to bootstrap Go 1.5.
Do we even need the source? I forget when/why the go tool consults it. Did we ever add a mode to have it not look for source?
/cc @adg
The text was updated successfully, but these errors were encountered: