Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ jobs:
- name: Make
run: make
- name: Install
run: make install
run: sudo make install
- name: Validate jsonschema
run: make schema-limayaml.json
- name: Validate templates
Expand Down Expand Up @@ -411,7 +411,7 @@ jobs:
- name: Make
run: make
- name: Install
run: make install
run: sudo make install
- name: "Adjust LIMACTL_CREATE_ARGS"
run: echo "LIMACTL_CREATE_ARGS=${LIMACTL_CREATE_ARGS} --vm-type=qemu --network=lima:shared" >>$GITHUB_ENV
- name: "Inject `no_timer_check` to kernel cmdline"
Expand Down Expand Up @@ -508,7 +508,7 @@ jobs:
- name: Make
run: make
- name: Install
run: make install
run: sudo make install
- name: Cache image used by templates/${{ matrix.template }}
uses: ./.github/actions/setup_cache_for_template
with:
Expand Down Expand Up @@ -546,7 +546,9 @@ jobs:
make binaries install
- name: Install Lima
# gomodjail depends on symbols
run: make KEEP_SYMBOLS=1 binaries install
run: |
make KEEP_SYMBOLS=1 binaries
sudo make install
- name: Cache image used by templates/default.yaml
uses: ./.github/actions/setup_cache_for_template
with:
Expand Down
3 changes: 0 additions & 3 deletions .ls-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ ls:
# valid names are `show-ssh.go`, `show-ssh_windows.go` or `show-ssh_test.go`
.go: lowercase

docs:
.md: kebab-case

templates:
# _default and _images have leading underscores
.dir: lowercase
Expand Down
22 changes: 12 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ help-targets:
@echo '- limactl : Build limactl, and lima'
@echo '- lima : Copy lima, and lima.bat'
@echo '- helpers : Copy nerdctl.lima, apptainer.lima, docker.lima, podman.lima, and kubectl.lima'
# TODO: move CLI plugins to _output/libexec/lima/
@echo
@echo 'Targets for files in _output/libexec/lima/:'
@echo '- limactl-plugins : Build limactl-* CLI plugins'
@echo
@echo 'Targets for files in _output/share/lima/:'
Expand Down Expand Up @@ -282,25 +283,26 @@ ifeq ($(GOOS),darwin)
codesign -f -v --entitlements vz.entitlements -s - $@
endif

limactl-plugins: _output/bin/limactl-mcp$(exe)
LIBEXEC_LIMA := _output/libexec/lima

_output/bin/limactl-mcp$(exe): $(call dependencies_for_cmd,limactl-mcp) $$(call force_build,$$@)
$(ENVS_$@) $(GO_BUILD) -o $@ ./cmd/limactl-mcp
limactl-plugins: $(LIBEXEC_LIMA)/limactl-mcp$(exe)

DRIVER_INSTALL_DIR := _output/libexec/lima
$(LIBEXEC_LIMA)/limactl-mcp$(exe): $(call dependencies_for_cmd,limactl-mcp) $$(call force_build,$$@)
@mkdir -p $(LIBEXEC_LIMA)
$(ENVS_$@) $(GO_BUILD) -o $@ ./cmd/limactl-mcp

.PHONY: additional-drivers
additional-drivers:
@mkdir -p $(DRIVER_INSTALL_DIR)
@mkdir -p $(LIBEXEC_LIMA)
@for drv in $(ADDITIONAL_DRIVERS); do \
echo "Building $$drv as external"; \
if [ "$(GOOS)" = "windows" ]; then \
$(GO_BUILD) -o $(DRIVER_INSTALL_DIR)/lima-driver-$$drv.exe ./cmd/lima-driver-$$drv; \
$(GO_BUILD) -o $(LIBEXEC_LIMA)/lima-driver-$$drv.exe ./cmd/lima-driver-$$drv; \
else \
$(GO_BUILD) -o $(DRIVER_INSTALL_DIR)/lima-driver-$$drv ./cmd/lima-driver-$$drv; \
$(GO_BUILD) -o $(LIBEXEC_LIMA)/lima-driver-$$drv ./cmd/lima-driver-$$drv; \
fi; \
if [ "$$drv" = "vz" ] && [ "$(GOOS)" = "darwin" ]; then \
codesign -f -v --entitlements vz.entitlements -s - $(DRIVER_INSTALL_DIR)/lima-driver-vz; \
codesign -f -v --entitlements vz.entitlements -s - $(LIBEXEC_LIMA)/lima-driver-vz; \
fi; \
done

Expand Down Expand Up @@ -523,7 +525,6 @@ uninstall:
"$(DEST)/bin/lima" \
"$(DEST)/bin/lima$(bat)" \
"$(DEST)/bin/limactl$(exe)" \
"$(DEST)/bin/limactl-mcp$(exe)" \
"$(DEST)/bin/nerdctl.lima" \
"$(DEST)/bin/apptainer.lima" \
"$(DEST)/bin/docker.lima" \
Expand All @@ -533,6 +534,7 @@ uninstall:
"$(DEST)/share/man/man1/limactl"*".1" \
"$(DEST)/share/lima" \
"$(DEST)/share/doc/lima" \
"$(DEST)/libexec/lima/limactl-mcp$(exe)" \
"$(DEST)/libexec/lima/lima-driver-qemu$(exe)" \
"$(DEST)/libexec/lima/lima-driver-vz$(exe)" \
"$(DEST)/libexec/lima/lima-driver-wsl2$(exe)"
Expand Down
8 changes: 4 additions & 4 deletions hack/test-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function install_lima() {
git checkout "${ver}"
make clean
make
if [ -w "${PREFIX}/bin" ] && [ -w "${PREFIX}/share" ]; then
if [ -w "${PREFIX}/bin" ] && [ -w "${PREFIX}/share" ] && [ -w "${PREFIX}/libexec" ]; then
make install
else
sudo make install
Expand All @@ -34,15 +34,15 @@ function install_lima() {
function install_lima_binary() {
ver="$1"
tar="tar"
if [ ! -w "${PREFIX}/bin" ] || [ ! -w "${PREFIX}/share" ]; then
if [ ! -w "${PREFIX}/bin" ] || [ ! -w "${PREFIX}/share" ] || [ ! -w "${PREFIX}/libexec" ]; then
tar="sudo ${tar}"
fi
curl -fsSL "https://github.com/lima-vm/lima/releases/download/${ver}/lima-${ver:1}-$(uname -s)-$(uname -m).tar.gz" | ${tar} Cxzvm "${PREFIX}"
}

function uninstall_lima() {
files="${PREFIX}/bin/lima ${PREFIX}/bin/limactl ${PREFIX}/share/lima ${PREFIX}/share/doc/lima"
if [ -w "${PREFIX}/bin" ] && [ -w "${PREFIX}/share" ]; then
files="${PREFIX}/bin/lima ${PREFIX}/bin/limactl ${PREFIX}/share/lima ${PREFIX}/share/doc/lima ${PREFIX}/libexec/lima"
if [ -w "${PREFIX}/bin" ] && [ -w "${PREFIX}/share" ] && [ -w "${PREFIX}/libexec" ]; then
# shellcheck disable=SC2086
rm -rf $files
else
Expand Down