Skip to content

Conversation

@WVerlaek
Copy link
Member

@WVerlaek WVerlaek commented Apr 6, 2025

Description

Adds the following options to better utilize caches between builds:

  • --fixed-build-dir: this will generate the build directory based off the package name only (instead of also the version). This means packages are built in the same directory between builds, which is needed to make go/golangci-lint build caches work.
    • If for any reason the same package is built twice under different versions, we still ensure both are built in separate directories. Each build only uses the fixed directory name if it doesn't already exist, and otherwise falls back to using the version suffix in the build path.
  • --disable-coverage: disables collection of Go test coverage. Otherwise, go test caches are never used. The next Go major release (1.25) will fix this and make test caches work with coverage enabled

Example speedup for api/go:lib, time to build after making a small file change:

$ leeway build api/go:lib --fixed-build-dir --disable-coverage

# Before:
[api/go:lib] package build succeded (21.30s) [pull: 0.1s | lint: 8.1s | test: 12.7s]

# This PR:
[api/go:lib] package build succeded (2.04s) [pull: 0.1s | lint: 1.0s | test: 0.8s]

10x speedup in this case!

Related Issue(s)

Fixes #

How to test

Documentation

/hold

@WVerlaek WVerlaek requested review from aledbf and csweichel April 6, 2025 14:46
@WVerlaek WVerlaek merged commit b68957b into main Apr 6, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants