commit | 3ea707028e5f140b1a5186a7086c0089a70c8f9c | [log] [tgz] |
---|---|---|
author | Leopold Schabel <leo@nexantic.com> | Wed Oct 23 16:40:06 2019 +0200 |
committer | Leopold Schabel <leo@nexantic.com> | Wed Oct 23 16:40:06 2019 +0200 |
tree | f07f5a23d75445789a1cbb116e8ca30471106ab2 | |
parent | 544440b6c8603ddaa548add84a657c999feeec49 [diff] |
Mount Bazel repository_cache, Go mod cache and Go build cache as volumes This leaves us with only git_repository rules not being cached, the worst offender being the edk2 recursive submodule clone. See: https://github.com/bazelbuild/bazel/issues/5116 gazelle's repo lookup (running `go list`) is also not cached, even if the repositories themselves are. We can eliminate most of the remaining rebuild time by mounting the entire execroot, however, this is currently foiled by a podman bug (Bazel needs to execute lots of binaries inside the root): https://github.com/containers/libpod/issues/4318 Test Plan: Ran `bazel build scripts:launch`, recreated container, ran it again. Build times decreased significantly: INFO: Elapsed time: 279.951s, Critical Path: 119.05s INFO: 477 processes: 476 linux-sandbox, 1 local. INFO: Build completed successfully, 497 total actions X-Origin-Diff: phab/D206 GitOrigin-RevId: 2d17a7eeb5d8b70ad4e26c13a0c6b31c4edfb33f
The build uses a Fedora 30 base image with a set of dependencies. Guide has been tested on a Fedora 30 host, with latest rW deployed.
Build the base image:
podman build -t smalltown-builder .
Launch the VM:
scripts/bin/bazel run scripts:launch
Exit qemu using the monitor console: Ctrl-A c quit
.