Skip to content

Commit aad73df

Browse files
authored
Merge pull request #4069 from AkihiroSuda/move-limactl-mcp
Makefile: move limactl-mcp from bin to libexec/lima
2 parents 45c9527 + 9430716 commit aad73df

File tree

4 files changed

+22
-21
lines changed

4 files changed

+22
-21
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ jobs:
240240
- name: Make
241241
run: make
242242
- name: Install
243-
run: make install
243+
run: sudo make install
244244
- name: Validate jsonschema
245245
run: make schema-limayaml.json
246246
- name: Validate templates
@@ -411,7 +411,7 @@ jobs:
411411
- name: Make
412412
run: make
413413
- name: Install
414-
run: make install
414+
run: sudo make install
415415
- name: "Adjust LIMACTL_CREATE_ARGS"
416416
run: echo "LIMACTL_CREATE_ARGS=${LIMACTL_CREATE_ARGS} --vm-type=qemu --network=lima:shared" >>$GITHUB_ENV
417417
- name: "Inject `no_timer_check` to kernel cmdline"
@@ -508,7 +508,7 @@ jobs:
508508
- name: Make
509509
run: make
510510
- name: Install
511-
run: make install
511+
run: sudo make install
512512
- name: Cache image used by templates/${{ matrix.template }}
513513
uses: ./.github/actions/setup_cache_for_template
514514
with:
@@ -546,7 +546,9 @@ jobs:
546546
make binaries install
547547
- name: Install Lima
548548
# gomodjail depends on symbols
549-
run: make KEEP_SYMBOLS=1 binaries install
549+
run: |
550+
make KEEP_SYMBOLS=1 binaries
551+
sudo make install
550552
- name: Cache image used by templates/default.yaml
551553
uses: ./.github/actions/setup_cache_for_template
552554
with:

.ls-lint.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ ls:
1616
# valid names are `show-ssh.go`, `show-ssh_windows.go` or `show-ssh_test.go`
1717
.go: lowercase
1818

19-
docs:
20-
.md: kebab-case
21-
2219
templates:
2320
# _default and _images have leading underscores
2421
.dir: lowercase

Makefile

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ help-targets:
112112
@echo '- limactl : Build limactl, and lima'
113113
@echo '- lima : Copy lima, and lima.bat'
114114
@echo '- helpers : Copy nerdctl.lima, apptainer.lima, docker.lima, podman.lima, and kubectl.lima'
115-
# TODO: move CLI plugins to _output/libexec/lima/
115+
@echo
116+
@echo 'Targets for files in _output/libexec/lima/:'
116117
@echo '- limactl-plugins : Build limactl-* CLI plugins'
117118
@echo
118119
@echo 'Targets for files in _output/share/lima/:'
@@ -282,25 +283,26 @@ ifeq ($(GOOS),darwin)
282283
codesign -f -v --entitlements vz.entitlements -s - $@
283284
endif
284285

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

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

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

292294
.PHONY: additional-drivers
293295
additional-drivers:
294-
@mkdir -p $(DRIVER_INSTALL_DIR)
296+
@mkdir -p $(LIBEXEC_LIMA)
295297
@for drv in $(ADDITIONAL_DRIVERS); do \
296298
echo "Building $$drv as external"; \
297299
if [ "$(GOOS)" = "windows" ]; then \
298-
$(GO_BUILD) -o $(DRIVER_INSTALL_DIR)/lima-driver-$$drv.exe ./cmd/lima-driver-$$drv; \
300+
$(GO_BUILD) -o $(LIBEXEC_LIMA)/lima-driver-$$drv.exe ./cmd/lima-driver-$$drv; \
299301
else \
300-
$(GO_BUILD) -o $(DRIVER_INSTALL_DIR)/lima-driver-$$drv ./cmd/lima-driver-$$drv; \
302+
$(GO_BUILD) -o $(LIBEXEC_LIMA)/lima-driver-$$drv ./cmd/lima-driver-$$drv; \
301303
fi; \
302304
if [ "$$drv" = "vz" ] && [ "$(GOOS)" = "darwin" ]; then \
303-
codesign -f -v --entitlements vz.entitlements -s - $(DRIVER_INSTALL_DIR)/lima-driver-vz; \
305+
codesign -f -v --entitlements vz.entitlements -s - $(LIBEXEC_LIMA)/lima-driver-vz; \
304306
fi; \
305307
done
306308

@@ -523,7 +525,6 @@ uninstall:
523525
"$(DEST)/bin/lima" \
524526
"$(DEST)/bin/lima$(bat)" \
525527
"$(DEST)/bin/limactl$(exe)" \
526-
"$(DEST)/bin/limactl-mcp$(exe)" \
527528
"$(DEST)/bin/nerdctl.lima" \
528529
"$(DEST)/bin/apptainer.lima" \
529530
"$(DEST)/bin/docker.lima" \
@@ -533,6 +534,7 @@ uninstall:
533534
"$(DEST)/share/man/man1/limactl"*".1" \
534535
"$(DEST)/share/lima" \
535536
"$(DEST)/share/doc/lima" \
537+
"$(DEST)/libexec/lima/limactl-mcp$(exe)" \
536538
"$(DEST)/libexec/lima/lima-driver-qemu$(exe)" \
537539
"$(DEST)/libexec/lima/lima-driver-vz$(exe)" \
538540
"$(DEST)/libexec/lima/lima-driver-wsl2$(exe)"

hack/test-upgrade.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function install_lima() {
2424
git checkout "${ver}"
2525
make clean
2626
make
27-
if [ -w "${PREFIX}/bin" ] && [ -w "${PREFIX}/share" ]; then
27+
if [ -w "${PREFIX}/bin" ] && [ -w "${PREFIX}/share" ] && [ -w "${PREFIX}/libexec" ]; then
2828
make install
2929
else
3030
sudo make install
@@ -34,15 +34,15 @@ function install_lima() {
3434
function install_lima_binary() {
3535
ver="$1"
3636
tar="tar"
37-
if [ ! -w "${PREFIX}/bin" ] || [ ! -w "${PREFIX}/share" ]; then
37+
if [ ! -w "${PREFIX}/bin" ] || [ ! -w "${PREFIX}/share" ] || [ ! -w "${PREFIX}/libexec" ]; then
3838
tar="sudo ${tar}"
3939
fi
4040
curl -fsSL "https://github.com/lima-vm/lima/releases/download/${ver}/lima-${ver:1}-$(uname -s)-$(uname -m).tar.gz" | ${tar} Cxzvm "${PREFIX}"
4141
}
4242

4343
function uninstall_lima() {
44-
files="${PREFIX}/bin/lima ${PREFIX}/bin/limactl ${PREFIX}/share/lima ${PREFIX}/share/doc/lima"
45-
if [ -w "${PREFIX}/bin" ] && [ -w "${PREFIX}/share" ]; then
44+
files="${PREFIX}/bin/lima ${PREFIX}/bin/limactl ${PREFIX}/share/lima ${PREFIX}/share/doc/lima ${PREFIX}/libexec/lima"
45+
if [ -w "${PREFIX}/bin" ] && [ -w "${PREFIX}/share" ] && [ -w "${PREFIX}/libexec" ]; then
4646
# shellcheck disable=SC2086
4747
rm -rf $files
4848
else

0 commit comments

Comments
 (0)