From ea33f9df8ecce3fcf360c9e5a1b7d325ceb610cf Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Tue, 23 Sep 2025 16:47:49 +0900 Subject: [PATCH 1/2] CI: fix ls-lint failure about docs/README.md ls-lint was failing: ``` docs/README.md failed for `.md` rules: kebabcase ``` Signed-off-by: Akihiro Suda --- .ls-lint.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.ls-lint.yml b/.ls-lint.yml index 972dbf2b3a6..10c7564712c 100644 --- a/.ls-lint.yml +++ b/.ls-lint.yml @@ -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 From 94307162b33002ceb30445893e9187c96d3144e0 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Tue, 23 Sep 2025 12:50:17 +0900 Subject: [PATCH 2/2] Makefile: move limactl-mcp from bin to libexec/lima So as to avoid blocking `limac[TAB]` shell experience NOTE: `make install` now requires `sudo` even on Intel Mac on GHA, for mkdiring `/usr/local/libexec`. Signed-off-by: Akihiro Suda --- .github/workflows/test.yml | 10 ++++++---- Makefile | 22 ++++++++++++---------- hack/test-upgrade.sh | 8 ++++---- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e8bd49cb0d2..2493fe29e98 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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" @@ -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: @@ -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: diff --git a/Makefile b/Makefile index 75d99546bc7..eacb5472787 100644 --- a/Makefile +++ b/Makefile @@ -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/:' @@ -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 @@ -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" \ @@ -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)" diff --git a/hack/test-upgrade.sh b/hack/test-upgrade.sh index e9be6c15636..df762e27ef8 100755 --- a/hack/test-upgrade.sh +++ b/hack/test-upgrade.sh @@ -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 @@ -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