From a5fa181d4b78ffe0a08d8a90088772729922bf39 Mon Sep 17 00:00:00 2001 From: Vishwas Siravara Date: Thu, 28 Sep 2023 15:14:23 -0700 Subject: [PATCH 01/14] windows branch Signed-off-by: Vishwas Siravara --- Makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 8ef1caa..5b48c31 100644 --- a/Makefile +++ b/Makefile @@ -33,20 +33,16 @@ ifneq (,$(findstring arm64,$(ARCH))) FINCH_OS_DIGEST ?= $(FINCH_OS_AARCH64_DIGEST) HOMEBREW_PREFIX ?= /opt/homebrew - # TODO: Use Finch rootfs in Finch on Windows testing - FINCH_ROOTFS_URL ?= https://deps.runfinch.com/common/aarch64/finch-rootfs-production-arm64-1690920104.tar.zst - FINCH_ROOTFS_BASENAME := $(notdir $(FINCH_ROOTFS_URL)) else ifneq (,$(findstring x86_64,$(ARCH))) LIMA_ARCH = x86_64 LIMA_URL ?= https://deps.runfinch.com/x86-64/lima-and-qemu.macos-x86_64.1695247723.tar.gz FINCH_OS_BASENAME := $(notdir $(FINCH_OS_x86_URL)) FINCH_OS_IMAGE_URL := $(FINCH_OS_x86_URL) FINCH_OS_DIGEST ?= $(FINCH_OS_x86_DIGEST) + FINCH_ROOTFS_BASENAME := $(notdir $(FINCH_ROOTFS_x86_URL)) + FINCH_ROOTFS_URL ?= $(FINCH_ROOTFS_x86_URL) + FINCH_ROOTFS_DIGEST ?= $(FINCH_ROOTFS_x86_DIGEST) HOMEBREW_PREFIX ?= /usr/local - - # TODO: Use Finch rootfs in Finch on Windows testing - FINCH_ROOTFS_URL ?= https://deps.runfinch.com/common/x86-64/finch-rootfs-production-amd64-1690920103.tar.zst - FINCH_ROOTFS_BASENAME := $(notdir $(FINCH_ROOTFS_URL)) endif FINCH_OS_IMAGE_LOCATION ?= $(OUTDIR)/os/$(FINCH_OS_BASENAME) @@ -64,7 +60,7 @@ BUILD_OS ?= $(OS) ifeq ($(BUILD_OS), Windows_NT) binaries: rootfs lima-template download: download.rootfs -else +else binaries: os lima-socket-vmnet lima-template download: download.os endif @@ -76,13 +72,18 @@ $(OS_DOWNLOAD_DIR)/$(FINCH_OS_BASENAME): $(ROOTFS_DOWNLOAD_DIR)/$(FINCH_ROOTFS_BASENAME): mkdir -p $(ROOTFS_DOWNLOAD_DIR) + mkdir -p $(OUTDIR)/os curl -L --fail $(FINCH_ROOTFS_URL) > "$(ROOTFS_DOWNLOAD_DIR)/$(FINCH_ROOTFS_BASENAME)" + cd $(ROOTFS_DOWNLOAD_DIR) && gunzip $(FINCH_ROOTFS_BASENAME) + $(eval FINCH_ROOTFS_BASENAME := $(subst .gz,,$(FINCH_ROOTFS_BASENAME))) + cp $(ROOTFS_DOWNLOAD_DIR)/$(FINCH_ROOTFS_BASENAME) $(OUTDIR)/os .PHONY: download.os download.os: $(OS_DOWNLOAD_DIR)/$(FINCH_OS_BASENAME) .PHONY: download.rootfs download.rootfs: $(ROOTFS_DOWNLOAD_DIR)/$(FINCH_ROOTFS_BASENAME) + $(eval FINCH_ROOTFS_DIGEST := "sha256:$(sha256 $(ROOTFS_DOWNLOAD_DIR)/$(FINCH_ROOTFS_BASENAME))") $(LIMA_DOWNLOAD_DIR)/$(LIMA_DEPENDENCY_FILE_NAME): mkdir -p $(DEPENDENCIES_DOWNLOAD_DIR) From 371247cbea97f1689dc80aec67154065a76e40b0 Mon Sep 17 00:00:00 2001 From: Vishwas Siravara Date: Thu, 28 Sep 2023 16:25:39 -0700 Subject: [PATCH 02/14] makefile fix for windows Signed-off-by: Vishwas Siravara --- Makefile | 90 ++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 64 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index 5b48c31..9fba9e0 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ HASH_DIR ?= $(CURDIR)/hashes DOWNLOAD_DIR := $(CURDIR)/downloads OS_DOWNLOAD_DIR := $(DOWNLOAD_DIR)/os LIMA_DOWNLOAD_DIR := $(DOWNLOAD_DIR)/dependencies -ROOTFS_DOWNLOAD_DIR := $(DOWNLOAD_DIR)/rootfs +ROOTFS_DOWNLOAD_DIR := $(DOWNLOAD_DIR)/os DEPENDENCIES_DOWNLOAD_DIR := $(DOWNLOAD_DIR)/dependencies SOCKET_VMNET_TEMP_PREFIX ?= $(OUTDIR)/dependencies/lima-socket_vmnet/opt/finch UNAME := $(shell uname -m) @@ -16,38 +16,49 @@ BUILD_TS := $(shell date +%s) # Set these variables if they aren't set, or if they are set to "" # Allows callers to override these default values # From https://dl.fedoraproject.org/pub/fedora/linux/releases/37/Cloud/x86_64/images/ -FINCH_OS_x86_URL := $(or $(FINCH_OS_x86_URL),https://deps.runfinch.com/Fedora-Cloud-Base-38-1.6.x86_64-20230918164920.qcow2) -FINCH_OS_x86_DIGEST := $(or $(FINCH_OS_x86_DIGEST),"sha256:214cce00ce5f6ac402a0a5a5269013eae201bf143ad8dbb9d50cfd5e22acd991") +FINCH_OS_x86_URL := $(or $(FINCH_OS_x86_URL),https://deps.runfinch.com/Fedora-Cloud-Base-38-1.6.x86_64-20230830214712.qcow2) +FINCH_OS_x86_DIGEST := $(or $(FINCH_OS_x86_DIGEST),"sha256:e8d5872454cf25155ce5f19381f27ef096ce89efcbb5ecc639dcb6bf44e16bf8") # From https://dl.fedoraproject.org/pub/fedora/linux/releases/37/Cloud/aarch64/images/ -FINCH_OS_AARCH64_URL := $(or $(FINCH_OS_AARCH64_URL),https://deps.runfinch.com/Fedora-Cloud-Base-38-1.6.aarch64-20230918164937.qcow2) -FINCH_OS_AARCH64_DIGEST := $(or $(FINCH_OS_AARCH64_DIGEST),"sha256:ad4c2fa3f80736cb6ea8e46f1a6ccf1f5f578e56de462bb60fcbc241786478d2") +FINCH_OS_AARCH64_URL := $(or $(FINCH_OS_AARCH64_URL),https://deps.runfinch.com/Fedora-Cloud-Base-38-1.6.aarch64-20230830214718.qcow2) +FINCH_OS_AARCH64_DIGEST := $(or $(FINCH_OS_AARCH64_DIGEST),"sha256:219a30f1409f8757eaf654dabf378fe0412b9499f877e5c69ad2f24327b1a5f4") + +FINCH_ROOTFS_x86_URL := $(or $(FINCH_ROOTFS_x86_URL),https://deps.runfinch.com/common/x86-64/finch-rootfs-production-amd64-1693001442.tar.gz) +FINCH_ROOTFS_x86_DIGEST := $(or $(FINCH_ROOTFS_x86_DIGEST),"sha256:53f2e329b8da0f6a25e025d1f6cc262ae228402ba615ad095739b2f0ec6babc9") LIMA_DEPENDENCY_FILE_NAME ?= lima-and-qemu.tar.gz .DEFAULT_GOAL := all ifneq (,$(findstring arm64,$(ARCH))) - LIMA_ARCH = aarch64 - LIMA_URL ?= https://deps.runfinch.com/aarch64/lima-and-qemu.macos-aarch64.1695247723.tar.gz - FINCH_OS_BASENAME := $(notdir $(FINCH_OS_AARCH64_URL)) - FINCH_OS_IMAGE_URL := $(FINCH_OS_AARCH64_URL) - FINCH_OS_DIGEST ?= $(FINCH_OS_AARCH64_DIGEST) - HOMEBREW_PREFIX ?= /opt/homebrew + LIMA_ARCH = aarch64 + LIMA_URL ?= https://deps.runfinch.com/aarch64/lima-and-qemu.macos-aarch64.1691201350.tar.gz + FINCH_OS_BASENAME := $(notdir $(FINCH_OS_AARCH64_URL)) + FINCH_OS_IMAGE_URL := $(FINCH_OS_AARCH64_URL) + FINCH_OS_DIGEST ?= $(FINCH_OS_AARCH64_DIGEST) + # TODO: Use Finch rootfs in Finch on Windows testing + FINCH_ROOTFS_BASENAME := $(notdir $(FINCH_ROOTFS_AARCH64_URL)) + FINCH_ROOTFS_URL ?= $(FINCH_ROOTFS_AARCH64_URL) + FINCH_ROOTFS_DIGEST ?= $(FINCH_ROOTFS_AARCH64_DIGEST) + HOMEBREW_PREFIX ?= /opt/homebrew else ifneq (,$(findstring x86_64,$(ARCH))) - LIMA_ARCH = x86_64 - LIMA_URL ?= https://deps.runfinch.com/x86-64/lima-and-qemu.macos-x86_64.1695247723.tar.gz - FINCH_OS_BASENAME := $(notdir $(FINCH_OS_x86_URL)) - FINCH_OS_IMAGE_URL := $(FINCH_OS_x86_URL) - FINCH_OS_DIGEST ?= $(FINCH_OS_x86_DIGEST) - FINCH_ROOTFS_BASENAME := $(notdir $(FINCH_ROOTFS_x86_URL)) - FINCH_ROOTFS_URL ?= $(FINCH_ROOTFS_x86_URL) - FINCH_ROOTFS_DIGEST ?= $(FINCH_ROOTFS_x86_DIGEST) - HOMEBREW_PREFIX ?= /usr/local + LIMA_ARCH = x86_64 + LIMA_URL ?= https://deps.runfinch.com/x86-64/lima-and-qemu.macos-x86_64.1691201350.tar.gz + FINCH_OS_BASENAME := $(notdir $(FINCH_OS_x86_URL)) + FINCH_OS_IMAGE_URL := $(FINCH_OS_x86_URL) + FINCH_OS_DIGEST ?= $(FINCH_OS_x86_DIGEST) + # TODO: Use Finch rootfs in Finch on Windows testing + FINCH_ROOTFS_BASENAME := $(notdir $(FINCH_ROOTFS_x86_URL)) + FINCH_ROOTFS_URL ?= $(FINCH_ROOTFS_x86_URL) + FINCH_ROOTFS_DIGEST ?= $(FINCH_ROOTFS_x86_DIGEST) + HOMEBREW_PREFIX ?= /usr/local + endif FINCH_OS_IMAGE_LOCATION ?= $(OUTDIR)/os/$(FINCH_OS_BASENAME) FINCH_OS_IMAGE_INSTALLATION_LOCATION ?= $(DEST)/os/$(FINCH_OS_BASENAME) +FINCH_ROOTFS_LOCATION ?= $(OUTDIR)/os/$(FINCH_ROOTFS_BASENAME) + .PHONY: all all: binaries @@ -55,14 +66,30 @@ all: binaries .PHONY: download # Rootfs required for Windows, require full OS for Linux and Mac - +FINCH_IMAGE_LOCATION ?= +FINCH_IMAGE_DIGEST ?= +# ifeq ($(GOOS),windows) +# FINCH_IMAGE_LOCATION := $(FINCH_ROOTFS_LOCATION) +# FINCH_IMAGE_DIGEST := $(FINCH_ROOTFS_DIGEST) +# else +# FINCH_IMAGE_LOCATION := $(FINCH_OS_IMAGE_LOCATION) +# FINCH_IMAGE_DIGEST := $(FINCH_OS_DIGEST) +# endif + +FEDORA_YAML ?= BUILD_OS ?= $(OS) ifeq ($(BUILD_OS), Windows_NT) -binaries: rootfs lima-template +binaries: rootfs lima download: download.rootfs +lima: lima-exe +FINCH_IMAGE_LOCATION := $(FINCH_ROOTFS_LOCATION) +FINCH_IMAGE_DIGEST := $(FINCH_ROOTFS_DIGEST) else binaries: os lima-socket-vmnet lima-template download: download.os +FINCH_IMAGE_LOCATION := $(FINCH_OS_IMAGE_LOCATION) +FINCH_IMAGE_DIGEST := $(FINCH_OS_DIGEST) +FEDORA_YAML := fedora.yaml endif $(OS_DOWNLOAD_DIR)/$(FINCH_OS_BASENAME): @@ -78,9 +105,11 @@ $(ROOTFS_DOWNLOAD_DIR)/$(FINCH_ROOTFS_BASENAME): $(eval FINCH_ROOTFS_BASENAME := $(subst .gz,,$(FINCH_ROOTFS_BASENAME))) cp $(ROOTFS_DOWNLOAD_DIR)/$(FINCH_ROOTFS_BASENAME) $(OUTDIR)/os + .PHONY: download.os download.os: $(OS_DOWNLOAD_DIR)/$(FINCH_OS_BASENAME) +# TODO: getting sha PoC only for now .PHONY: download.rootfs download.rootfs: $(ROOTFS_DOWNLOAD_DIR)/$(FINCH_ROOTFS_BASENAME) $(eval FINCH_ROOTFS_DIGEST := "sha256:$(sha256 $(ROOTFS_DOWNLOAD_DIR)/$(FINCH_ROOTFS_BASENAME))") @@ -100,12 +129,12 @@ install.lima-dependencies: download.lima-dependencies .PHONY: lima-template lima-template: download mkdir -p $(OUTDIR)/lima-template - cp lima-template/fedora.yaml $(OUTDIR)/lima-template + cp $(OUTDIR)/lima-template/$(FEDORA_YAML) $(OUTDIR)/lima-template/fedora.yaml # using -i.bak is very intentional, it allows the following commands to succeed for both GNU / BSD sed # this sed command uses the alternative separator of "|" because the image location uses "/" - sed -i.bak -e "s||$(FINCH_OS_IMAGE_LOCATION)|g" $(OUTDIR)/lima-template/fedora.yaml + sed -i.bak -e "s||$(FINCH_IMAGE_LOCATION)|g" $(OUTDIR)/lima-template/fedora.yaml sed -i.bak -e "s//$(LIMA_ARCH)/g" $(OUTDIR)/lima-template/fedora.yaml - sed -i.bak -e "s//$(FINCH_OS_DIGEST)/g" $(OUTDIR)/lima-template/fedora.yaml + sed -i.bak -e "s//$(FINCH_IMAGE_DIGEST)/g" $(OUTDIR)/lima-template/fedora.yaml rm $(OUTDIR)/lima-template/*.yaml.bak .PHONY: lima-socket-vmnet @@ -114,6 +143,13 @@ lima-socket-vmnet: cd src/socket_vmnet && git clean -f -d cd src/socket_vmnet && PREFIX=$(SOCKET_VMNET_TEMP_PREFIX) "$(MAKE)" install.bin +.PHONY: lima lima-exe +lima-exe: + cd src/lima && \ + "$(MAKE)" exe _output/share/lima/lima-guestagent.Linux-x86_64 + mkdir -p ${OUTDIR}/lima + cp -r src/lima/_output/* ${OUTDIR}/lima + .PHONY: download-sources download-sources: ./bin/download-sources.pl @@ -125,12 +161,14 @@ os: download .PHONY: rootfs rootfs: download + mkdir -p $(OUTDIR)/os + cp $(DOWNLOAD_DIR)/os/$(FINCH_ROOTFS_BASENAME) "$(OUTDIR)/os/$(FINCH_ROOTFS_BASENAME)" .PHONY: install install: uninstall mkdir -p $(DEST) (cd _output && tar c * | tar Cvx $(DEST) ) - sed -i.bak -e "s|${FINCH_OS_IMAGE_LOCATION}|$(FINCH_OS_IMAGE_LOCATION)|g" $(DEST)/lima-template/fedora.yaml + sed -i.bak -e "s|${FINCH_OS_IMAGE_LOCATION}|$(FINCH_IMAGE_LOCATION)|g" $(DEST)/lima-template/fedora.yaml rm $(DEST)/lima-template/*.yaml.bak .PHONY: uninstall From dff9b137a3d1c3e7092aa69b7e5ad826375526a7 Mon Sep 17 00:00:00 2001 From: Justin Date: Fri, 29 Sep 2023 17:36:14 -0400 Subject: [PATCH 03/14] fix: track pendo324/lima windows-ssh-quoting until quoting fixed upstream (#175) Issue #, if available: *Description of changes:* Tracks a Lima fork until the SSH quoting issue is resolved upstream. You probably need to run `git submodule set-url src/lima https://github.com/pendo324/lima` and `git submodule update --init --recursive` to get the latest changes *Testing done:* - [x] I've reviewed the guidance in CONTRIBUTING.md #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. Signed-off-by: Justin Alvarez Signed-off-by: Vishwas Siravara --- .gitmodules | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index d56ee12..a99db2b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,7 @@ [submodule "src/lima"] path = src/lima - url = https://github.com/lima-vm/lima + url = https://github.com/pendo324/lima + branch = windows-ssh-quoting [submodule "src/socket_vmnet"] path = src/socket_vmnet url = https://github.com/lima-vm/socket_vmnet From f5bf1d92028b7f5ab726e13bb398afa80bdad3cd Mon Sep 17 00:00:00 2001 From: Justin Date: Fri, 29 Sep 2023 18:57:12 -0400 Subject: [PATCH 04/14] fix: update and don't extract rootfs (#176) Issue #, if available: *Description of changes:* - update to latest rootfs built by action - don't extract rootfs, let Lima do it *Testing done:* - [x] I've reviewed the guidance in CONTRIBUTING.md #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. Signed-off-by: Justin Alvarez Signed-off-by: Vishwas Siravara --- Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 9fba9e0..43e7c74 100644 --- a/Makefile +++ b/Makefile @@ -22,8 +22,8 @@ FINCH_OS_x86_DIGEST := $(or $(FINCH_OS_x86_DIGEST),"sha256:e8d5872454cf25155ce5f FINCH_OS_AARCH64_URL := $(or $(FINCH_OS_AARCH64_URL),https://deps.runfinch.com/Fedora-Cloud-Base-38-1.6.aarch64-20230830214718.qcow2) FINCH_OS_AARCH64_DIGEST := $(or $(FINCH_OS_AARCH64_DIGEST),"sha256:219a30f1409f8757eaf654dabf378fe0412b9499f877e5c69ad2f24327b1a5f4") -FINCH_ROOTFS_x86_URL := $(or $(FINCH_ROOTFS_x86_URL),https://deps.runfinch.com/common/x86-64/finch-rootfs-production-amd64-1693001442.tar.gz) -FINCH_ROOTFS_x86_DIGEST := $(or $(FINCH_ROOTFS_x86_DIGEST),"sha256:53f2e329b8da0f6a25e025d1f6cc262ae228402ba615ad095739b2f0ec6babc9") +FINCH_ROOTFS_x86_URL := $(or $(FINCH_ROOTFS_x86_URL),https://deps.runfinch.com/common/x86-64/finch-rootfs-production-amd64-1694791577.tar.gz) +FINCH_ROOTFS_x86_DIGEST := $(or $(FINCH_ROOTFS_x86_DIGEST),"sha256:2d4d2e7386450899c6d0587fd0db21afadb31d974fa744aa9365c883935c5341") LIMA_DEPENDENCY_FILE_NAME ?= lima-and-qemu.tar.gz .DEFAULT_GOAL := all @@ -101,8 +101,6 @@ $(ROOTFS_DOWNLOAD_DIR)/$(FINCH_ROOTFS_BASENAME): mkdir -p $(ROOTFS_DOWNLOAD_DIR) mkdir -p $(OUTDIR)/os curl -L --fail $(FINCH_ROOTFS_URL) > "$(ROOTFS_DOWNLOAD_DIR)/$(FINCH_ROOTFS_BASENAME)" - cd $(ROOTFS_DOWNLOAD_DIR) && gunzip $(FINCH_ROOTFS_BASENAME) - $(eval FINCH_ROOTFS_BASENAME := $(subst .gz,,$(FINCH_ROOTFS_BASENAME))) cp $(ROOTFS_DOWNLOAD_DIR)/$(FINCH_ROOTFS_BASENAME) $(OUTDIR)/os From 74d195204f90331d96117c94cd43c96904954625 Mon Sep 17 00:00:00 2001 From: Justin Date: Mon, 2 Oct 2023 18:54:50 -0400 Subject: [PATCH 05/14] chore: track lima master now that quote fix is merged (#177) Issue #, if available: *Description of changes:* - Since the ssh quote fix is merged, we can track Lima's `master` branch again *Testing done:* - [x] I've reviewed the guidance in CONTRIBUTING.md #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. Signed-off-by: Justin Alvarez Signed-off-by: Vishwas Siravara --- .gitmodules | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index a99db2b..d56ee12 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,6 @@ [submodule "src/lima"] path = src/lima - url = https://github.com/pendo324/lima - branch = windows-ssh-quoting + url = https://github.com/lima-vm/lima [submodule "src/socket_vmnet"] path = src/socket_vmnet url = https://github.com/lima-vm/socket_vmnet From 375adea931054f0b591df216ea48bdddbcbab834 Mon Sep 17 00:00:00 2001 From: Gavin Inglis <43075615+ginglis13@users.noreply.github.com> Date: Thu, 5 Oct 2023 17:16:52 +0000 Subject: [PATCH 06/14] fix: lima-template path in Makefile, OS images (#179) Issue #, if available: *Description of changes:* Failure seen in mac e2e tests on branch `windev`: https://github.com/runfinch/finch/actions/runs/6413564599/job/17412684261?pr=584 update OS image refs. hashes are already correct in windev branch. revert a change to the fedora lima template path. This `lima-template` rule is only used on macOS: https://github.com/runfinch/finch-core/blob/22af4e43c95b2ac591754fc817228b8aff9deddf/Makefile#L79-L93 *Testing done:* On both windows and macOS dev machines: ``` # .gitmodules [submodule "finch-core"] path = deps/finch-core url = https://github.com/ginglis13/finch-core.git branch = makefile-fix ``` ``` make ./_output/bin/finch vm init ``` - [x] I've reviewed the guidance in CONTRIBUTING.md #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. Signed-off-by: Gavin Inglis Signed-off-by: Vishwas Siravara --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 43e7c74..2634459 100644 --- a/Makefile +++ b/Makefile @@ -16,11 +16,11 @@ BUILD_TS := $(shell date +%s) # Set these variables if they aren't set, or if they are set to "" # Allows callers to override these default values # From https://dl.fedoraproject.org/pub/fedora/linux/releases/37/Cloud/x86_64/images/ -FINCH_OS_x86_URL := $(or $(FINCH_OS_x86_URL),https://deps.runfinch.com/Fedora-Cloud-Base-38-1.6.x86_64-20230830214712.qcow2) -FINCH_OS_x86_DIGEST := $(or $(FINCH_OS_x86_DIGEST),"sha256:e8d5872454cf25155ce5f19381f27ef096ce89efcbb5ecc639dcb6bf44e16bf8") +FINCH_OS_x86_URL := $(or $(FINCH_OS_x86_URL),https://deps.runfinch.com/Fedora-Cloud-Base-38-1.6.x86_64-20230918164920.qcow2) +FINCH_OS_x86_DIGEST := $(or $(FINCH_OS_x86_DIGEST),"sha256:214cce00ce5f6ac402a0a5a5269013eae201bf143ad8dbb9d50cfd5e22acd991") # From https://dl.fedoraproject.org/pub/fedora/linux/releases/37/Cloud/aarch64/images/ -FINCH_OS_AARCH64_URL := $(or $(FINCH_OS_AARCH64_URL),https://deps.runfinch.com/Fedora-Cloud-Base-38-1.6.aarch64-20230830214718.qcow2) -FINCH_OS_AARCH64_DIGEST := $(or $(FINCH_OS_AARCH64_DIGEST),"sha256:219a30f1409f8757eaf654dabf378fe0412b9499f877e5c69ad2f24327b1a5f4") +FINCH_OS_AARCH64_URL := $(or $(FINCH_OS_AARCH64_URL),https://deps.runfinch.com/Fedora-Cloud-Base-38-1.6.aarch64-20230918164937.qcow2) +FINCH_OS_AARCH64_DIGEST := $(or $(FINCH_OS_AARCH64_DIGEST),"sha256:ad4c2fa3f80736cb6ea8e46f1a6ccf1f5f578e56de462bb60fcbc241786478d2") FINCH_ROOTFS_x86_URL := $(or $(FINCH_ROOTFS_x86_URL),https://deps.runfinch.com/common/x86-64/finch-rootfs-production-amd64-1694791577.tar.gz) FINCH_ROOTFS_x86_DIGEST := $(or $(FINCH_ROOTFS_x86_DIGEST),"sha256:2d4d2e7386450899c6d0587fd0db21afadb31d974fa744aa9365c883935c5341") @@ -127,7 +127,7 @@ install.lima-dependencies: download.lima-dependencies .PHONY: lima-template lima-template: download mkdir -p $(OUTDIR)/lima-template - cp $(OUTDIR)/lima-template/$(FEDORA_YAML) $(OUTDIR)/lima-template/fedora.yaml + cp lima-template/fedora.yaml $(OUTDIR)/lima-template # using -i.bak is very intentional, it allows the following commands to succeed for both GNU / BSD sed # this sed command uses the alternative separator of "|" because the image location uses "/" sed -i.bak -e "s||$(FINCH_IMAGE_LOCATION)|g" $(OUTDIR)/lima-template/fedora.yaml From 59ddb9326f8164cf773a8b9230df55b3dab08baf Mon Sep 17 00:00:00 2001 From: Vishwas Siravara Date: Tue, 10 Oct 2023 17:53:42 +0000 Subject: [PATCH 07/14] feat: add cosign to rootfs (#181) Issue #, if available: *Description of changes:* Add cosign binary to rootfs *Testing done:* - [X] I've reviewed the guidance in CONTRIBUTING.md #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Signed-off-by: Vishwas Siravara --- Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index dab2ce9..c4721cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,11 @@ RUN dnf install -y \ iptables \ fuse-sshfs +# install cosign +RUN curl -L -O https://github.com/sigstore/cosign/releases/download/v2.0.1/cosign-2.0.1.x86_64.rpm && \ + sudo rpm -ivh cosign-2.0.1.x86_64.rpm && \ + rm -rf cosign-2.0.1.x86_64.rpm + RUN systemctl enable cloud-init cloud-init-local cloud-config cloud-final # enable systemd From 1ffbc95ff0f98dbbc56b08451c48d14edba1ca5f Mon Sep 17 00:00:00 2001 From: Vishwas Siravara Date: Tue, 10 Oct 2023 19:38:51 +0000 Subject: [PATCH 08/14] build(deps): update rootfs (#185) Issue #, if available: *Description of changes:* - Update rootfs archive - Remove arm64 build for rootfs *Testing done:* - [X] I've reviewed the guidance in CONTRIBUTING.md #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. Signed-off-by: Vishwas Siravara --- .github/workflows/rootfs.yaml | 3 ++- Makefile | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rootfs.yaml b/.github/workflows/rootfs.yaml index f5c0568..810d3a3 100644 --- a/.github/workflows/rootfs.yaml +++ b/.github/workflows/rootfs.yaml @@ -19,7 +19,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - arch: ['amd64', 'arm64'] + # finch only supports amd64 for windows + arch: ['amd64'] platform: ['common'] steps: - name: Generate Timestamp diff --git a/Makefile b/Makefile index 2634459..b0bdd9d 100644 --- a/Makefile +++ b/Makefile @@ -22,8 +22,8 @@ FINCH_OS_x86_DIGEST := $(or $(FINCH_OS_x86_DIGEST),"sha256:214cce00ce5f6ac402a0a FINCH_OS_AARCH64_URL := $(or $(FINCH_OS_AARCH64_URL),https://deps.runfinch.com/Fedora-Cloud-Base-38-1.6.aarch64-20230918164937.qcow2) FINCH_OS_AARCH64_DIGEST := $(or $(FINCH_OS_AARCH64_DIGEST),"sha256:ad4c2fa3f80736cb6ea8e46f1a6ccf1f5f578e56de462bb60fcbc241786478d2") -FINCH_ROOTFS_x86_URL := $(or $(FINCH_ROOTFS_x86_URL),https://deps.runfinch.com/common/x86-64/finch-rootfs-production-amd64-1694791577.tar.gz) -FINCH_ROOTFS_x86_DIGEST := $(or $(FINCH_ROOTFS_x86_DIGEST),"sha256:2d4d2e7386450899c6d0587fd0db21afadb31d974fa744aa9365c883935c5341") +FINCH_ROOTFS_x86_URL := $(or $(FINCH_ROOTFS_x86_URL),https://deps.runfinch.com/common/x86-64/finch-rootfs-production-amd64-1696963702.tar.gz) +FINCH_ROOTFS_x86_DIGEST := $(or $(FINCH_ROOTFS_x86_DIGEST),"sha256:ed36fb7f4819644efaf409a3417456fe8378c4f4bcff0bd1e0e520954b10ccf5") LIMA_DEPENDENCY_FILE_NAME ?= lima-and-qemu.tar.gz .DEFAULT_GOAL := all From a598bb29f780c7d42230d551fbb865ae6468c213 Mon Sep 17 00:00:00 2001 From: Justin Date: Thu, 12 Oct 2023 16:00:37 -0400 Subject: [PATCH 09/14] feat: add windows deps (#187) Issue #, if available: *Description of changes:* - Adds all dependencies needed to run lima/finch standalone - This includes a lot of DLLs, need a better way to automate this - TODO: after merge, need to modify Finch to set path when calling Lima so that these executables are actually used *Testing done:* - All exes work with an empty `%PATH%` (e.g. `$env:Path = ""; ssh.exe --help` works) - [x] I've reviewed the guidance in CONTRIBUTING.md #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Signed-off-by: Justin Alvarez Signed-off-by: Vishwas Siravara --- .gitignore | 1 + Makefile | 113 ++++++++++++++++++++++++++++++++++++++---------- verify_hash.ps1 | 18 ++++++++ 3 files changed, 110 insertions(+), 22 deletions(-) create mode 100644 verify_hash.ps1 diff --git a/.gitignore b/.gitignore index b0df895..78f5ef5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ _output/ downloads/ +wingit-temp/ *.idea *.DS_Store *.bak diff --git a/Makefile b/Makefile index b0bdd9d..b52ab11 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ HASH_DIR ?= $(CURDIR)/hashes DOWNLOAD_DIR := $(CURDIR)/downloads OS_DOWNLOAD_DIR := $(DOWNLOAD_DIR)/os LIMA_DOWNLOAD_DIR := $(DOWNLOAD_DIR)/dependencies +LIMA_OUTDIR ?= $(OUTDIR)/lima ROOTFS_DOWNLOAD_DIR := $(DOWNLOAD_DIR)/os DEPENDENCIES_DOWNLOAD_DIR := $(DOWNLOAD_DIR)/dependencies SOCKET_VMNET_TEMP_PREFIX ?= $(OUTDIR)/dependencies/lima-socket_vmnet/opt/finch @@ -28,29 +29,34 @@ FINCH_ROOTFS_x86_DIGEST := $(or $(FINCH_ROOTFS_x86_DIGEST),"sha256:ed36fb7f48196 LIMA_DEPENDENCY_FILE_NAME ?= lima-and-qemu.tar.gz .DEFAULT_GOAL := all +WINGIT_TEMP_DIR := $(CURDIR)/wingit-temp +WINGIT_x86_URL := $(or $(WINGIT_x86_URL),https://github.com/git-for-windows/git/releases/download/v2.42.0.windows.2/Git-2.42.0.2-64-bit.tar.bz2) +WINGIT_x86_BASENAME ?= $(notdir $(WINGIT_x86_URL)) +WINGIT_x86_HASH := $(or $(WINGIT_x86_HASH),"sha256:c192e56f8ed3d364acc87ad04d1f5aa6ae03c23b32b67bf65fcc6f9b8f032e65") + ifneq (,$(findstring arm64,$(ARCH))) - LIMA_ARCH = aarch64 - LIMA_URL ?= https://deps.runfinch.com/aarch64/lima-and-qemu.macos-aarch64.1691201350.tar.gz - FINCH_OS_BASENAME := $(notdir $(FINCH_OS_AARCH64_URL)) - FINCH_OS_IMAGE_URL := $(FINCH_OS_AARCH64_URL) - FINCH_OS_DIGEST ?= $(FINCH_OS_AARCH64_DIGEST) - # TODO: Use Finch rootfs in Finch on Windows testing - FINCH_ROOTFS_BASENAME := $(notdir $(FINCH_ROOTFS_AARCH64_URL)) - FINCH_ROOTFS_URL ?= $(FINCH_ROOTFS_AARCH64_URL) - FINCH_ROOTFS_DIGEST ?= $(FINCH_ROOTFS_AARCH64_DIGEST) - HOMEBREW_PREFIX ?= /opt/homebrew + LIMA_ARCH = aarch64 + LIMA_URL ?= https://deps.runfinch.com/aarch64/lima-and-qemu.macos-aarch64.1691201350.tar.gz + FINCH_OS_BASENAME := $(notdir $(FINCH_OS_AARCH64_URL)) + FINCH_OS_IMAGE_URL := $(FINCH_OS_AARCH64_URL) + FINCH_OS_DIGEST ?= $(FINCH_OS_AARCH64_DIGEST) + # TODO: Use Finch rootfs in Finch on Windows testing + FINCH_ROOTFS_BASENAME := $(notdir $(FINCH_ROOTFS_AARCH64_URL)) + FINCH_ROOTFS_URL ?= $(FINCH_ROOTFS_AARCH64_URL) + FINCH_ROOTFS_DIGEST ?= $(FINCH_ROOTFS_AARCH64_DIGEST) + HOMEBREW_PREFIX ?= /opt/homebrew else ifneq (,$(findstring x86_64,$(ARCH))) - LIMA_ARCH = x86_64 - LIMA_URL ?= https://deps.runfinch.com/x86-64/lima-and-qemu.macos-x86_64.1691201350.tar.gz - FINCH_OS_BASENAME := $(notdir $(FINCH_OS_x86_URL)) - FINCH_OS_IMAGE_URL := $(FINCH_OS_x86_URL) - FINCH_OS_DIGEST ?= $(FINCH_OS_x86_DIGEST) - # TODO: Use Finch rootfs in Finch on Windows testing - FINCH_ROOTFS_BASENAME := $(notdir $(FINCH_ROOTFS_x86_URL)) - FINCH_ROOTFS_URL ?= $(FINCH_ROOTFS_x86_URL) - FINCH_ROOTFS_DIGEST ?= $(FINCH_ROOTFS_x86_DIGEST) - HOMEBREW_PREFIX ?= /usr/local + LIMA_ARCH = x86_64 + LIMA_URL ?= https://deps.runfinch.com/x86-64/lima-and-qemu.macos-x86_64.1691201350.tar.gz + FINCH_OS_BASENAME := $(notdir $(FINCH_OS_x86_URL)) + FINCH_OS_IMAGE_URL := $(FINCH_OS_x86_URL) + FINCH_OS_DIGEST ?= $(FINCH_OS_x86_DIGEST) + # TODO: Use Finch rootfs in Finch on Windows testing + FINCH_ROOTFS_BASENAME := $(notdir $(FINCH_ROOTFS_x86_URL)) + FINCH_ROOTFS_URL ?= $(FINCH_ROOTFS_x86_URL) + FINCH_ROOTFS_DIGEST ?= $(FINCH_ROOTFS_x86_DIGEST) + HOMEBREW_PREFIX ?= /usr/local endif @@ -81,7 +87,7 @@ BUILD_OS ?= $(OS) ifeq ($(BUILD_OS), Windows_NT) binaries: rootfs lima download: download.rootfs -lima: lima-exe +lima: lima-exe install.lima-dependencies-wsl2 FINCH_IMAGE_LOCATION := $(FINCH_ROOTFS_LOCATION) FINCH_IMAGE_DIGEST := $(FINCH_ROOTFS_DIGEST) else @@ -121,9 +127,72 @@ $(LIMA_DOWNLOAD_DIR)/$(LIMA_DEPENDENCY_FILE_NAME): .PHONY: download.lima-dependencies download.lima-dependencies: $(LIMA_DOWNLOAD_DIR)/$(LIMA_DEPENDENCY_FILE_NAME) -.PHONE: install.lima-dependencies +.PHONY: install.lima-dependencies install.lima-dependencies: download.lima-dependencies +# Only redownload/extract if this file is missing (there's no particular reason for choosing this file instead of any other) +$(LIMA_OUTDIR)/bin/ssh.exe: + mkdir -p $(DEPENDENCIES_DOWNLOAD_DIR) + mkdir -p $(OUTDIR)/bin + + curl -L --fail $(WINGIT_x86_URL) > $(DEPENDENCIES_DOWNLOAD_DIR)/$(WINGIT_x86_BASENAME) + pwsh.exe -NoLogo -NoProfile -c ./verify_hash.ps1 "$(DEPENDENCIES_DOWNLOAD_DIR)\$(WINGIT_x86_BASENAME)" $(WINGIT_x86_HASH) + mkdir -p $(WINGIT_TEMP_DIR) + # this takes a long time because of an almost 4:1 compression ratio and needing to extract many small files + tar -xvjf "$(DEPENDENCIES_DOWNLOAD_DIR)\$(WINGIT_x86_BASENAME)" -C $(WINGIT_TEMP_DIR) + + # Lima runtime dependencies + mkdir -p $(LIMA_OUTDIR)/bin + + # From https://packages.msys2.org/package/gzip?repo=msys&variant=x86_64 + cp $(WINGIT_TEMP_DIR)/usr/bin/gzip.exe $(LIMA_OUTDIR)/bin/ + # From https://packages.msys2.org/package/msys2-runtime?repo=msys&variant=x86_64 + cp $(WINGIT_TEMP_DIR)/usr/bin/cygpath.exe $(LIMA_OUTDIR)/bin/ + # From https://packages.msys2.org/package/tar?repo=msys&variant=x86_64 + cp $(WINGIT_TEMP_DIR)/usr/bin/tar.exe $(LIMA_OUTDIR)/bin/ + # From https://packages.msys2.org/package/openssh?repo=msys&variant=x86_64 + cp $(WINGIT_TEMP_DIR)/usr/bin/ssh.exe $(LIMA_OUTDIR)/bin/ + + # Dependency DLLs, extracted with https://github.com/lucasg/Dependencies + # Dependencies.exe -chain $(WINGIT_TEMP_DIR)\usr\bin\ssh.exe -depth 3 -json + # Depth 3 is only needed for ssh.exe, everything else only needs depth 1 + # TODO: Automate + + # Required by all MSYS2 programs, from https://github.com/msys2/msys2-runtime + cp $(WINGIT_TEMP_DIR)/usr/bin/msys-2.0.dll $(LIMA_OUTDIR)/bin/ + # Required by tar.exe, from https://packages.msys2.org/package/libiconv?repo=msys&variant=x86_64 + cp $(WINGIT_TEMP_DIR)/usr/bin/msys-iconv-2.dll $(LIMA_OUTDIR)/bin/ + # Required by msys-iconv-2.dll, from https://packages.msys2.org/package/libintl?repo=msys&variant=x86_64 + cp $(WINGIT_TEMP_DIR)/usr/bin/msys-intl-8.dll $(LIMA_OUTDIR)/bin/ + # GCC exception handling, required for all programs that throw exceptions, from https://packages.msys2.org/package/gcc-libs?repo=msys&variant=x86_64 + cp $(WINGIT_TEMP_DIR)/usr/bin/msys-gcc_s-seh-1.dll $(LIMA_OUTDIR)/bin/ + + # Required by ssh.exe, from https://packages.msys2.org/package/libopenssl?repo=msys&variant=x86_64 + cp $(WINGIT_TEMP_DIR)/usr/bin/msys-crypto-3.dll $(LIMA_OUTDIR)/bin/ + # Required by ssh.exe, from https://packages.msys2.org/package/zlib-devel?repo=msys&variant=x86_64 + cp $(WINGIT_TEMP_DIR)/usr/bin/msys-z.dll $(LIMA_OUTDIR)/bin/ + # Required by ssh.exe, from https://packages.msys2.org/package/libcrypt?repo=msys&variant=x86_64 + cp $(WINGIT_TEMP_DIR)/usr/bin/msys-crypt-0.dll $(LIMA_OUTDIR)/bin/ + # Required by heimdal-libs, from https://packages.msys2.org/package/libsqlite?repo=msys&variant=x86_64 + cp $(WINGIT_TEMP_DIR)/usr/bin/msys-sqlite3-0.dll $(LIMA_OUTDIR)/bin/ + + # Required by ssh.exe, from https://packages.msys2.org/package/heimdal-libs?repo=msys&variant=x86_64 + cp $(WINGIT_TEMP_DIR)/usr/bin/msys-asn1-8.dll $(LIMA_OUTDIR)/bin/ + cp $(WINGIT_TEMP_DIR)/usr/bin/msys-com_err-1.dll $(LIMA_OUTDIR)/bin/ + cp $(WINGIT_TEMP_DIR)/usr/bin/msys-gssapi-3.dll $(LIMA_OUTDIR)/bin/ + cp $(WINGIT_TEMP_DIR)/usr/bin/msys-hcrypto-4.dll $(LIMA_OUTDIR)/bin/ + cp $(WINGIT_TEMP_DIR)/usr/bin/msys-heimbase-1.dll $(LIMA_OUTDIR)/bin/ + cp $(WINGIT_TEMP_DIR)/usr/bin/msys-heimntlm-0.dll $(LIMA_OUTDIR)/bin/ + cp $(WINGIT_TEMP_DIR)/usr/bin/msys-hx509-5.dll $(LIMA_OUTDIR)/bin/ + cp $(WINGIT_TEMP_DIR)/usr/bin/msys-krb5-26.dll $(LIMA_OUTDIR)/bin/ + cp $(WINGIT_TEMP_DIR)/usr/bin/msys-roken-18.dll $(LIMA_OUTDIR)/bin/ + cp $(WINGIT_TEMP_DIR)/usr/bin/msys-wind-0.dll $(LIMA_OUTDIR)/bin/ + + -@rm -rf $(WINGIT_TEMP_DIR) + +.PHONY: install.lima-dependencies-wsl2 +install.lima-dependencies-wsl2: $(LIMA_OUTDIR)/bin/ssh.exe + .PHONY: lima-template lima-template: download mkdir -p $(OUTDIR)/lima-template diff --git a/verify_hash.ps1 b/verify_hash.ps1 new file mode 100644 index 0000000..eb2dfc4 --- /dev/null +++ b/verify_hash.ps1 @@ -0,0 +1,18 @@ +<# + Verify file hashes using pure PowerShell +#> +param ( + # Dependency file path + [Parameter(Mandatory=$true)] + [string]$DependencyFilePath, + + # Dependency hash + [Parameter(Mandatory=$true)] + [string]$DependencyHash = 'out.png' +) + +if (!(Get-FileHash -Algorithm SHA256 "$DependencyFilePath").Hash -eq $DependencyHash) { + $host.SetShouldExit(-1); exit +} else { + Write-Output "Verified $DependencyFilePath" +} From 126c1ba4fbaae627b1d50db024b1d07df6f2aac8 Mon Sep 17 00:00:00 2001 From: Justin Date: Thu, 12 Oct 2023 16:16:56 -0400 Subject: [PATCH 10/14] chore: add ssh-keygen and deps (#188) Issue #, if available: *Description of changes:* - Accidentally removed from previous PR *Testing done:* - [x] I've reviewed the guidance in CONTRIBUTING.md #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. Signed-off-by: Justin Alvarez Signed-off-by: Vishwas Siravara --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index b52ab11..08a40e7 100644 --- a/Makefile +++ b/Makefile @@ -152,6 +152,8 @@ $(LIMA_OUTDIR)/bin/ssh.exe: cp $(WINGIT_TEMP_DIR)/usr/bin/tar.exe $(LIMA_OUTDIR)/bin/ # From https://packages.msys2.org/package/openssh?repo=msys&variant=x86_64 cp $(WINGIT_TEMP_DIR)/usr/bin/ssh.exe $(LIMA_OUTDIR)/bin/ + # From https://packages.msys2.org/package/openssh?repo=msys&variant=x86_64 + cp $(WINGIT_TEMP_DIR)/usr/bin/ssh-keygen.exe $(LIMA_OUTDIR)/bin/ # Dependency DLLs, extracted with https://github.com/lucasg/Dependencies # Dependencies.exe -chain $(WINGIT_TEMP_DIR)\usr\bin\ssh.exe -depth 3 -json @@ -169,6 +171,8 @@ $(LIMA_OUTDIR)/bin/ssh.exe: # Required by ssh.exe, from https://packages.msys2.org/package/libopenssl?repo=msys&variant=x86_64 cp $(WINGIT_TEMP_DIR)/usr/bin/msys-crypto-3.dll $(LIMA_OUTDIR)/bin/ + # Required by ssh-keygen.exe, from https://packages.msys2.org/package/libopenssl?repo=msys&variant=x86_64 + cp $(WINGIT_TEMP_DIR)/usr/bin/msys-crypto-1.1.dll $(LIMA_OUTDIR)/bin/ # Required by ssh.exe, from https://packages.msys2.org/package/zlib-devel?repo=msys&variant=x86_64 cp $(WINGIT_TEMP_DIR)/usr/bin/msys-z.dll $(LIMA_OUTDIR)/bin/ # Required by ssh.exe, from https://packages.msys2.org/package/libcrypt?repo=msys&variant=x86_64 From 3090054bd06fe85625d9f795394fee51fb6dd9b3 Mon Sep 17 00:00:00 2001 From: Justin Date: Thu, 12 Oct 2023 18:22:09 -0400 Subject: [PATCH 11/14] fix: remove old version of msys-crypto (#189) Issue #, if available: *Description of changes:* - Remove old version of msys-crypto - Accidentally added because I looked at the DLLs required for an older version of `ssh-keygen.exe`, newer versions don't need this file *Testing done:* - Tested on my windows machine - [x] I've reviewed the guidance in CONTRIBUTING.md #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. Signed-off-by: Justin Alvarez Signed-off-by: Vishwas Siravara --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index 08a40e7..b1d3570 100644 --- a/Makefile +++ b/Makefile @@ -171,8 +171,6 @@ $(LIMA_OUTDIR)/bin/ssh.exe: # Required by ssh.exe, from https://packages.msys2.org/package/libopenssl?repo=msys&variant=x86_64 cp $(WINGIT_TEMP_DIR)/usr/bin/msys-crypto-3.dll $(LIMA_OUTDIR)/bin/ - # Required by ssh-keygen.exe, from https://packages.msys2.org/package/libopenssl?repo=msys&variant=x86_64 - cp $(WINGIT_TEMP_DIR)/usr/bin/msys-crypto-1.1.dll $(LIMA_OUTDIR)/bin/ # Required by ssh.exe, from https://packages.msys2.org/package/zlib-devel?repo=msys&variant=x86_64 cp $(WINGIT_TEMP_DIR)/usr/bin/msys-z.dll $(LIMA_OUTDIR)/bin/ # Required by ssh.exe, from https://packages.msys2.org/package/libcrypt?repo=msys&variant=x86_64 From fbe38d496e06d93683cde1be7d99756cfd992e86 Mon Sep 17 00:00:00 2001 From: Gavin Inglis <43075615+ginglis13@users.noreply.github.com> Date: Thu, 12 Oct 2023 19:45:54 -0400 Subject: [PATCH 12/14] fix: use --force-local in tar (#191) Issue #, if available: *Description of changes:* tar option --force-local is used to instruct tar that the input is known to be a local file even if it is interpreted by tar to be a remote file; this appears to have been the case for the wingit local archive as seen in https://github.com/runfinch/finch/actions/runs/6501797014/job/17659749228 https://www.gnu.org/software/tar/manual/html_section/All-Options.html *Testing done:* `make` on windows instance - [x] I've reviewed the guidance in CONTRIBUTING.md #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. Signed-off-by: Gavin Inglis Signed-off-by: Vishwas Siravara --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b1d3570..b3e2c2e 100644 --- a/Makefile +++ b/Makefile @@ -139,7 +139,7 @@ $(LIMA_OUTDIR)/bin/ssh.exe: pwsh.exe -NoLogo -NoProfile -c ./verify_hash.ps1 "$(DEPENDENCIES_DOWNLOAD_DIR)\$(WINGIT_x86_BASENAME)" $(WINGIT_x86_HASH) mkdir -p $(WINGIT_TEMP_DIR) # this takes a long time because of an almost 4:1 compression ratio and needing to extract many small files - tar -xvjf "$(DEPENDENCIES_DOWNLOAD_DIR)\$(WINGIT_x86_BASENAME)" -C $(WINGIT_TEMP_DIR) + tar --force-local -xvjf "$(DEPENDENCIES_DOWNLOAD_DIR)\$(WINGIT_x86_BASENAME)" -C $(WINGIT_TEMP_DIR) # Lima runtime dependencies mkdir -p $(LIMA_OUTDIR)/bin From 12b9895b24cf54344eeaeb3aa3f2515359f9397a Mon Sep 17 00:00:00 2001 From: Vishwas Siravara Date: Fri, 13 Oct 2023 16:53:36 -0700 Subject: [PATCH 13/14] fix LIMA_URL to most recent Signed-off-by: Vishwas Siravara --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b3e2c2e..59c507e 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ WINGIT_x86_HASH := $(or $(WINGIT_x86_HASH),"sha256:c192e56f8ed3d364acc87ad04d1f5 ifneq (,$(findstring arm64,$(ARCH))) LIMA_ARCH = aarch64 - LIMA_URL ?= https://deps.runfinch.com/aarch64/lima-and-qemu.macos-aarch64.1691201350.tar.gz + LIMA_URL ?= https://deps.runfinch.com/aarch64/lima-and-qemu.macos-aarch64.1695247723.tar.gz FINCH_OS_BASENAME := $(notdir $(FINCH_OS_AARCH64_URL)) FINCH_OS_IMAGE_URL := $(FINCH_OS_AARCH64_URL) FINCH_OS_DIGEST ?= $(FINCH_OS_AARCH64_DIGEST) @@ -48,7 +48,7 @@ ifneq (,$(findstring arm64,$(ARCH))) else ifneq (,$(findstring x86_64,$(ARCH))) LIMA_ARCH = x86_64 - LIMA_URL ?= https://deps.runfinch.com/x86-64/lima-and-qemu.macos-x86_64.1691201350.tar.gz + LIMA_URL ?= https://deps.runfinch.com/x86-64/lima-and-qemu.macos-x86_64.1695247723.tar.gz FINCH_OS_BASENAME := $(notdir $(FINCH_OS_x86_URL)) FINCH_OS_IMAGE_URL := $(FINCH_OS_x86_URL) FINCH_OS_DIGEST ?= $(FINCH_OS_x86_DIGEST) From 3c119e6ae6fa017ae357b352e3719e225b945b53 Mon Sep 17 00:00:00 2001 From: Vishwas Siravara Date: Fri, 13 Oct 2023 17:59:04 -0700 Subject: [PATCH 14/14] address PR comments Signed-off-by: Vishwas Siravara --- Makefile | 11 +---------- verify_hash.ps1 => bin/verify_hash.ps1 | 0 2 files changed, 1 insertion(+), 10 deletions(-) rename verify_hash.ps1 => bin/verify_hash.ps1 (100%) diff --git a/Makefile b/Makefile index 59c507e..2f7db92 100644 --- a/Makefile +++ b/Makefile @@ -74,14 +74,6 @@ all: binaries # Rootfs required for Windows, require full OS for Linux and Mac FINCH_IMAGE_LOCATION ?= FINCH_IMAGE_DIGEST ?= -# ifeq ($(GOOS),windows) -# FINCH_IMAGE_LOCATION := $(FINCH_ROOTFS_LOCATION) -# FINCH_IMAGE_DIGEST := $(FINCH_ROOTFS_DIGEST) -# else -# FINCH_IMAGE_LOCATION := $(FINCH_OS_IMAGE_LOCATION) -# FINCH_IMAGE_DIGEST := $(FINCH_OS_DIGEST) -# endif - FEDORA_YAML ?= BUILD_OS ?= $(OS) ifeq ($(BUILD_OS), Windows_NT) @@ -113,7 +105,6 @@ $(ROOTFS_DOWNLOAD_DIR)/$(FINCH_ROOTFS_BASENAME): .PHONY: download.os download.os: $(OS_DOWNLOAD_DIR)/$(FINCH_OS_BASENAME) -# TODO: getting sha PoC only for now .PHONY: download.rootfs download.rootfs: $(ROOTFS_DOWNLOAD_DIR)/$(FINCH_ROOTFS_BASENAME) $(eval FINCH_ROOTFS_DIGEST := "sha256:$(sha256 $(ROOTFS_DOWNLOAD_DIR)/$(FINCH_ROOTFS_BASENAME))") @@ -136,7 +127,7 @@ $(LIMA_OUTDIR)/bin/ssh.exe: mkdir -p $(OUTDIR)/bin curl -L --fail $(WINGIT_x86_URL) > $(DEPENDENCIES_DOWNLOAD_DIR)/$(WINGIT_x86_BASENAME) - pwsh.exe -NoLogo -NoProfile -c ./verify_hash.ps1 "$(DEPENDENCIES_DOWNLOAD_DIR)\$(WINGIT_x86_BASENAME)" $(WINGIT_x86_HASH) + pwsh.exe -NoLogo -NoProfile -c ./bin/verify_hash.ps1 "$(DEPENDENCIES_DOWNLOAD_DIR)\$(WINGIT_x86_BASENAME)" $(WINGIT_x86_HASH) mkdir -p $(WINGIT_TEMP_DIR) # this takes a long time because of an almost 4:1 compression ratio and needing to extract many small files tar --force-local -xvjf "$(DEPENDENCIES_DOWNLOAD_DIR)\$(WINGIT_x86_BASENAME)" -C $(WINGIT_TEMP_DIR) diff --git a/verify_hash.ps1 b/bin/verify_hash.ps1 similarity index 100% rename from verify_hash.ps1 rename to bin/verify_hash.ps1