Skip to content
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

Makefile: Improve rebuilding #2666

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

norio-nomura
Copy link
Contributor

@norio-nomura norio-nomura commented Sep 29, 2024

The goal is to ensure proper rebuilding without using the clean target by setting appropriate dependencies for each target.

  • codesign: skip if _output/bin/limactl$(exe) has valid code signature with expected entitlements
  • _output/bin/limactl$(exe): depends to source codes
  • _output/share/lima/lima-guestagent.Linux-%: depends to source codes
  • limactl: forece rebuild if build variables are differs to built binary
  • templates:
  • symbolic links:
  • manpages:
  • _artifacts/lima-%.tar.gz:
  • docsy:

…e signature with expected entitlements

Signed-off-by: Norio Nomura <[email protected]>
…t/share/lima/lima-guestagent.Linux-%`

Dependencies are defined using glob patterns:
- `limactl`: `go.mod`, `./cmd/limactl/**/!(*_test.go)`, `./pkg/**/!(*_test.go)`.
  `vz.entitlements` will be added if darwin.
- `lima-guestagent`: `go.mod`, `./cmd/lima-guestagent/**/!(*_test.go)`, and `./pkg/**/!(*_test.go)`.

Those patterns are expanded by `bash` using `shopt`: `extglob`, `globstar`, and `nullglob`.

Signed-off-by: Norio Nomura <[email protected]>
…l` binary is different from the current GO build variables.

The variables being checked from `go version -m _output/bin/limactl`:
- `GOVERSION`
- `CGO*`
- `GO*`
- `-ldflags`
are compared to output of `CGO_ENABLED=1 go env <variables>` and `$(LDFLAGS)`.
If it differs, `limactl` will be force build.
This is required to using `make artifact*`.

Signed-off-by: Norio Nomura <[email protected]>
@norio-nomura norio-nomura changed the title Makefile: Improve rebuild Makefile: Improve rebuilding Sep 29, 2024
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.

1 participant