Skip to content

Commit 55ed3fc

Browse files
committed
Rework dependency bundles
1 parent 0bd3b3a commit 55ed3fc

8 files changed

+173
-124
lines changed

.github/workflows/prepare-go-wsllinks-release.yml

+15
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@ on:
66
gowsllinks_version:
77
description: go-wsllinks version"
88
value: ${{ jobs.build.outputs.gowsllinks_version }}
9+
bundles_version:
10+
description: bundles version"
11+
value: ${{ jobs.build.outputs.bundles_version }}
912
env:
1013
GOWSLLINKS_GITURL: https://github.com/arixmkii/go-wsllinks.git
1114
GOWSLLINKS_SHA: a2b50fd156e35cea31399ed199f3c297838f02fc # v0.0.6
1215
GOWSLLINKS_VERSION: 0.0.6
16+
BUNDLES_VERSION: 0.0.1
1317
jobs:
1418
build:
1519
runs-on: windows-latest
1620
outputs:
1721
gowsllinks_version: ${{ steps.make_versions.outputs.gowsllinks }}
22+
bundles_version: ${{ steps.make_versions.outputs.bundles }}
1823
steps:
1924
- name: "🏗️ Install msys2"
2025
uses: msys2/setup-msys2@v2
@@ -38,16 +43,25 @@ jobs:
3843
git remote add origin $GOWSLLINKS_GITURL
3944
git fetch --depth 1 origin $GOWSLLINKS_SHA
4045
git checkout FETCH_HEAD
46+
patch --binary -l -p 1 < ../patches/go-wsllinks/0001-Create-Lima-dependency-bundles.patch
4147
- name: "🛠️ Build go-wsllinks"
4248
working-directory: go-wsllinks-release
4349
shell: msys2 {0}
4450
run: |
4551
go build -ldflags="-s -w"
52+
cp go-wsllinks.exe ./bundle-git
53+
cp go-wsllinks.exe ./bundle-wsl
4654
- name: "📦 Pack go-wsllinks"
4755
shell: msys2 {0}
4856
run: |
4957
mkdir -p qcw
5058
cp "go-wsllinks-release/go-wsllinks.exe" qcw/
59+
mkdir -p qcw-tmp
60+
cp -r "go-wsllinks-release/bundle-git" qcw-tmp/bundle-git
61+
cp -r "go-wsllinks-release/bundle-wsl" qcw-tmp/bundle-wsl
62+
pushd qcw-tmp/
63+
zip -9 -r ../qcw/bundles.zip .
64+
popd
5165
cd qcw
5266
find . -type f \( ! -iname "*.checksums" \) -exec sha256sum -b {} \; > sha.checksums
5367
find . -type f \( ! -iname "*.checksums" \) -exec sha512sum -b {} \; >> sha.checksums
@@ -57,6 +71,7 @@ jobs:
5771
shell: msys2 {0}
5872
run: |
5973
echo "gowsllinks=$GOWSLLINKS_VERSION" >> "$GITHUB_OUTPUT"
74+
echo "bundles=$BUNDLES_VERSION" >> "$GITHUB_OUTPUT"
6075
- name: "🚀 Upload artifact"
6176
uses: actions/upload-artifact@v4
6277
with:

.github/workflows/prepare-lima-release.yml

+15-5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
gowsllinks_version:
1010
description: "go-wsllinks version"
1111
value: ${{ jobs.build.outputs.gowsllinks_version }}
12+
bundles_version:
13+
description: "bundles version"
14+
value: ${{ jobs.build.outputs.bundles_version }}
1215
alpine_version:
1316
description: "Alpine version"
1417
value: ${{ jobs.build.outputs.alpine_version }}
@@ -30,6 +33,7 @@ jobs:
3033
outputs:
3134
lima_version: ${{ steps.make_versions.outputs.lima }}
3235
gowsllinks_version: ${{ steps.make_versions.outputs.gowsllinks }}
36+
bundles_version: ${{ steps.make_versions.outputs.bundles }}
3337
alpine_version: ${{ steps.make_versions.outputs.alpine }}
3438
alpine_wsl_version: ${{ steps.make_versions.outputs.alpine_wsl }}
3539
steps:
@@ -97,8 +101,12 @@ jobs:
97101
working-directory: lima-release
98102
shell: msys2 {0}
99103
run: |
100-
cp -f ../qcw-art/qcw-go-wsllinks/go-wsllinks.exe ./contrib/go-wsllinks.exe
101-
make binaries add-bundles
104+
pushd ../qcw-art/qcw-go-wsllinks/
105+
unzip bundles.zip
106+
./bundle-git/install-tools.bat
107+
./bundle-wsl/install-tools.bat
108+
popd
109+
make binaries
102110
- name: "🧪 Test Lima WSL2 machine Git shell WSL2 (NAT)"
103111
working-directory: lima-release
104112
shell: msys2 {0}
@@ -138,7 +146,7 @@ jobs:
138146
export LIMACTL_CREATE_ARGS='--vm-type=wsl2 --mount-type=wsl2 --containerd=system'
139147
export HOME_HOST=$(cygpath $USERPROFILE)
140148
export HOME_GUEST=$(wsl -d lima-infra wslpath $(cygpath -m $USERPROFILE))
141-
_LIMA_WINDOWS_EXTRA_PATH=$PWD/_output/bin/bundle-git ./hack/test-templates.sh templates/experimental/wsl2.yaml
149+
_LIMA_WINDOWS_EXTRA_PATH=$PWD/../qcw-art/qcw-go-wsllinks/bundle-git ./hack/test-templates.sh templates/experimental/wsl2.yaml
142150
- name: "🧪 Test Lima QEMU machine WSL2 bundle WSL2 (NAT)"
143151
working-directory: lima-release
144152
shell: msys2 {0}
@@ -151,7 +159,7 @@ jobs:
151159
export LIMACTL_CREATE_ARGS='--vm-type=qemu'
152160
export HOME_HOST=$(cygpath $USERPROFILE)
153161
export HOME_GUEST=$(wsl -d lima-infra wslpath $(cygpath -m $USERPROFILE))
154-
_LIMA_WINDOWS_EXTRA_PATH=$PWD/_output/bin/bundle-wsl ./hack/test-templates.sh templates/default.yaml
162+
_LIMA_WINDOWS_EXTRA_PATH=$PWD/../qcw-art/qcw-go-wsllinks/bundle-wsl ./hack/test-templates.sh templates/default.yaml
155163
- name: "🧪 Test Lima WSL2 machine WSL2 bundle WSL2 (NAT)"
156164
working-directory: lima-release
157165
shell: msys2 {0}
@@ -164,7 +172,7 @@ jobs:
164172
export LIMACTL_CREATE_ARGS='--vm-type=wsl2 --mount-type=wsl2 --containerd=system'
165173
export HOME_HOST=$(cygpath $USERPROFILE)
166174
export HOME_GUEST=$(wsl -d lima-infra wslpath $(cygpath -m $USERPROFILE))
167-
_LIMA_WINDOWS_EXTRA_PATH=$PWD/_output/bin/bundle-wsl ./hack/test-templates.sh templates/experimental/wsl2.yaml
175+
_LIMA_WINDOWS_EXTRA_PATH=$PWD/../qcw-art/qcw-go-wsllinks/bundle-wsl ./hack/test-templates.sh templates/experimental/wsl2.yaml
168176
# - name: "⚙️ Configure WSL2 networking mode mirrored"
169177
# shell: msys2 {0}
170178
# run: |
@@ -194,12 +202,14 @@ jobs:
194202
name: "📌 Export versions"
195203
env:
196204
GOWSLLINKS_VERSION: ${{ needs.call-prepare-go-wsllinks.outputs.gowsllinks_version }}
205+
BUNDLES_VERSION: ${{ needs.call-prepare-go-wsllinks.outputs.bundles_version }}
197206
ALPINE_VERSION: ${{ needs.call-prepare-alpine-wsl.outputs.alpine_version }}
198207
ALPINEWSL_VERSION: ${{ needs.call-prepare-alpine-wsl.outputs.alpine_wsl_version }}
199208
shell: msys2 {0}
200209
run: |
201210
echo "lima=$LIMA_VERSION-$LIMA_SHA" >> "$GITHUB_OUTPUT"
202211
echo "gowsllinks=$GOWSLLINKS_VERSION" >> "$GITHUB_OUTPUT"
212+
echo "bundles=$BUNDLES_VERSION" >> "$GITHUB_OUTPUT"
203213
echo "alpine=$ALPINE_VERSION" >> "$GITHUB_OUTPUT"
204214
echo "alpine_wsl=$ALPINEWSL_VERSION" >> "$GITHUB_OUTPUT"
205215
- name: "🚀 Upload artifact"

.github/workflows/publish-qcw-release.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,23 @@ on:
33
workflow_dispatch:
44
inputs:
55
release_name:
6-
description: 'Release name'
6+
description: 'Release name (noramlly X.Y.Z)'
77
required: true
88
type: string
99
release_tag:
10-
description: 'Release tag'
10+
description: 'Release tag (normally vX.Y.Z)'
1111
required: true
1212
type: string
1313
release_highlights:
1414
description: 'Release highlights'
1515
default: 'TBD.'
1616
required: true
1717
type: string
18+
dry_run:
19+
description: "Skip publishing to releases (dry run)"
20+
default: false
21+
required: true
22+
type: boolean
1823
jobs:
1924
call-prepare-docker:
2025
uses: ./.github/workflows/prepare-docker-release.yml
@@ -45,6 +50,7 @@ jobs:
4550
DOCKER_VERSION: ${{ needs.call-prepare-docker.outputs.cli_version }}
4651
DOCKER_COMPOSE_VERSION: ${{ needs.call-prepare-docker.outputs.compose_version }}
4752
GOWSLLINKS_VERSION: ${{ needs.call-prepare-lima.outputs.gowsllinks_version }}
53+
BUNDLES_VERSION: ${{ needs.call-prepare-lima.outputs.bundles_version }}
4854
LIMA_VERSION: ${{ needs.call-prepare-lima.outputs.lima_version }}
4955
PODMAN_VERSION: ${{ needs.call-prepare-podman.outputs.podman_version }}
5056
QEMU_VERSION: ${{ needs.call-prepare-qemu.outputs.qemu_version }}
@@ -64,6 +70,7 @@ jobs:
6470
sed "s/<<DOCKER_VERSION>>/$DOCKER_VERSION/g" -i release.template.md
6571
sed "s/<<DOCKER_COMPOSE_VERSION>>/$DOCKER_COMPOSE_VERSION/g" -i release.template.md
6672
sed "s/<<GOWSLLINKS_VERSION>>/$GOWSLLINKS_VERSION/g" -i release.template.md
73+
sed "s/<<BUNDLES_VERSION>>/$BUNDLES_VERSION/g" -i release.template.md
6774
sed "s/<<LIMA_VERSION>>/$LIMA_VERSION/g" -i release.template.md
6875
sed "s/<<PODMAN_VERSION>>/$PODMAN_VERSION/g" -i release.template.md
6976
sed "s/<<QEMU_VERSION>>/$QEMU_VERSION/g" -i release.template.md
@@ -72,6 +79,7 @@ jobs:
7279
cat qcw/checksums.sha256
7380
cat qcw/checksums.sha512
7481
- name: "🏷️ Publish release"
82+
if: ${{ !inputs.dry_run }}
7583
uses: ncipollo/release-action@v1
7684
with:
7785
name: ${{ inputs.release_name }}

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ Version `v0.0.6`. Rebuilt for Windows amd64 platform.
8080
#### `Lima`
8181

8282
Development main branch from revision `88f350be30e395b2f4ca54c48d4ca0760e273a4c` with 6 patch sets:
83-
* Add Temp placeholder support to templates
84-
* Improve subsystem path handling in SHELL and USER processing
83+
* Add Temp placeholder support to templates from https://github.com/lima-vm/lima/pull/3318
84+
* Improve subsystem path handling in SHELL and USER processing from https://github.com/lima-vm/lima/pull/3304
8585
* Fix mounts to support Windows
86-
* Customizadle additional PATH for Windows builds
86+
* Customizadle additional PATH for Windows builds from https://github.com/lima-vm/lima/pull/3347
8787
* Support WSL2 as a replacement for msys2/cygwin
8888
* Enable QEMU support in Lima for Windows
8989

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
From 9fd60e1d97ce5facbc15d6422bad929ef2fe86f9 Mon Sep 17 00:00:00 2001
2+
From: Arthur Sengileyev <[email protected]>
3+
Date: Wed, 12 Mar 2025 20:11:22 +0200
4+
Subject: [PATCH] Create Lima dependency bundles
5+
6+
---
7+
bundle-git/install-tools.bat | 10 ++++++++++
8+
bundle-git/sftp-server.ini | 1 +
9+
bundle-git/wsllinks.ini | 2 ++
10+
bundle-wsl/install-tools.bat | 12 ++++++++++++
11+
bundle-wsl/sftp-server.ini | 1 +
12+
bundle-wsl/ssh-keygen.ini | 1 +
13+
bundle-wsl/wsllinks.ini | 2 ++
14+
7 files changed, 29 insertions(+)
15+
create mode 100644 bundle-git/install-tools.bat
16+
create mode 100644 bundle-git/sftp-server.ini
17+
create mode 100644 bundle-git/wsllinks.ini
18+
create mode 100644 bundle-wsl/install-tools.bat
19+
create mode 100644 bundle-wsl/sftp-server.ini
20+
create mode 100644 bundle-wsl/ssh-keygen.ini
21+
create mode 100644 bundle-wsl/wsllinks.ini
22+
23+
diff --git a/bundle-git/install-tools.bat b/bundle-git/install-tools.bat
24+
new file mode 100644
25+
index 0000000..710ebf6
26+
--- /dev/null
27+
+++ b/bundle-git/install-tools.bat
28+
@@ -0,0 +1,10 @@
29+
+@ECHO OFF
30+
+
31+
+copy /Y "%~dp0\go-wsllinks.exe" "%~dp0\bzip2.exe" 1>nul
32+
+copy /Y "%~dp0\go-wsllinks.exe" "%~dp0\cygpath.exe" 1>nul
33+
+copy /Y "%~dp0\go-wsllinks.exe" "%~dp0\gzip.exe" 1>nul
34+
+copy /Y "%~dp0\go-wsllinks.exe" "%~dp0\id.exe" 1>nul
35+
+copy /Y "%~dp0\go-wsllinks.exe" "%~dp0\scp.exe" 1>nul
36+
+copy /Y "%~dp0\go-wsllinks.exe" "%~dp0\sftp-server.exe" 1>nul
37+
+copy /Y "%~dp0\go-wsllinks.exe" "%~dp0\ssh-keygen.exe" 1>nul
38+
+copy /Y "%~dp0\go-wsllinks.exe" "%~dp0\ssh.exe" 1>nul
39+
diff --git a/bundle-git/sftp-server.ini b/bundle-git/sftp-server.ini
40+
new file mode 100644
41+
index 0000000..79cf2da
42+
--- /dev/null
43+
+++ b/bundle-git/sftp-server.ini
44+
@@ -0,0 +1 @@
45+
+baseDir = C:\Program Files\Git\usr\lib\ssh
46+
diff --git a/bundle-git/wsllinks.ini b/bundle-git/wsllinks.ini
47+
new file mode 100644
48+
index 0000000..eece20f
49+
--- /dev/null
50+
+++ b/bundle-git/wsllinks.ini
51+
@@ -0,0 +1,2 @@
52+
+mode = direct
53+
+baseDir = C:\Program Files\Git\usr\bin
54+
diff --git a/bundle-wsl/install-tools.bat b/bundle-wsl/install-tools.bat
55+
new file mode 100644
56+
index 0000000..351856a
57+
--- /dev/null
58+
+++ b/bundle-wsl/install-tools.bat
59+
@@ -0,0 +1,12 @@
60+
+@ECHO OFF
61+
+
62+
+copy /Y "%~dp0\go-wsllinks.exe" "%~dp0\bzip2.exe" 1>nul
63+
+copy /Y "%~dp0\go-wsllinks.exe" "%~dp0\cygpath.exe" 1>nul
64+
+copy /Y "%~dp0\go-wsllinks.exe" "%~dp0\gzip.exe" 1>nul
65+
+copy /Y "%~dp0\go-wsllinks.exe" "%~dp0\id.exe" 1>nul
66+
+copy /Y "%~dp0\go-wsllinks.exe" "%~dp0\scp.exe" 1>nul
67+
+copy /Y "%~dp0\go-wsllinks.exe" "%~dp0\sftp-server.exe" 1>nul
68+
+copy /Y "%~dp0\go-wsllinks.exe" "%~dp0\ssh-keygen.exe" 1>nul
69+
+copy /Y "%~dp0\go-wsllinks.exe" "%~dp0\ssh.exe" 1>nul
70+
+copy /Y "%~dp0\go-wsllinks.exe" "%~dp0\xz.exe" 1>nul
71+
+copy /Y "%~dp0\go-wsllinks.exe" "%~dp0\zstd.exe" 1>nul
72+
diff --git a/bundle-wsl/sftp-server.ini b/bundle-wsl/sftp-server.ini
73+
new file mode 100644
74+
index 0000000..4ad96ac
75+
--- /dev/null
76+
+++ b/bundle-wsl/sftp-server.ini
77+
@@ -0,0 +1 @@
78+
+binary = /usr/lib/ssh/sftp-server
79+
diff --git a/bundle-wsl/ssh-keygen.ini b/bundle-wsl/ssh-keygen.ini
80+
new file mode 100644
81+
index 0000000..0e29002
82+
--- /dev/null
83+
+++ b/bundle-wsl/ssh-keygen.ini
84+
@@ -0,0 +1 @@
85+
+shellType = standard
86+
diff --git a/bundle-wsl/wsllinks.ini b/bundle-wsl/wsllinks.ini
87+
new file mode 100644
88+
index 0000000..6f27450
89+
--- /dev/null
90+
+++ b/bundle-wsl/wsllinks.ini
91+
@@ -0,0 +1,2 @@
92+
+distro = lima-infra
93+
+user = lima
94+
--
95+
2.48.1
96+
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1-
From b05bb1a70b1dcf2c82cf91da4b88bc19ec6693aa Mon Sep 17 00:00:00 2001
1+
From fc2c5f1474e9b4c7c490ebeed27adcaf9fdc8409 Mon Sep 17 00:00:00 2001
22
From: Arthur Sengileyev <[email protected]>
33
Date: Sat, 8 Mar 2025 23:29:38 +0200
4-
Subject: [PATCH 3/4] Add additional PATH env var for tooling on Windows
4+
Subject: [PATCH] Support setting extra entries for PATH env variable on
5+
Windows hosts
6+
7+
During startup `limactl.exe` will check new experimental
8+
`_LIMA_WINDOWS_EXTRA_PATH` environment variable and when found it
9+
will be added to PATH environment variable for the running process.
510

611
Signed-off-by: Arthur Sengileyev <[email protected]>
712
---
8-
cmd/limactl/main.go | 10 ++++++++++
9-
1 file changed, 10 insertions(+)
13+
cmd/limactl/main.go | 10 ++++++++++
14+
.../content/en/docs/config/environment-variables.md | 12 ++++++++++++
15+
2 files changed, 22 insertions(+)
1016

1117
diff --git a/cmd/limactl/main.go b/cmd/limactl/main.go
12-
index 268fad0d..576489c3 100644
18+
index 268fad0dcf3..d475f902810 100644
1319
--- a/cmd/limactl/main.go
1420
+++ b/cmd/limactl/main.go
1521
@@ -28,6 +28,16 @@ const (
@@ -22,13 +28,30 @@ index 268fad0d..576489c3 100644
2228
+ p := os.Getenv("PATH")
2329
+ err := os.Setenv("PATH", strings.TrimSpace(extras)+string(filepath.ListSeparator)+p)
2430
+ if err != nil {
25-
+ logrus.Warning("Can't add extras to PATH, relying fully on system PATH")
31+
+ logrus.Warning("Can't add extras to PATH, relying entirely on system PATH")
2632
+ }
2733
+ }
2834
+ }
2935
if err := newApp().Execute(); err != nil {
3036
handleExitCoder(err)
3137
logrus.Fatal(err)
32-
--
33-
2.48.1
34-
38+
diff --git a/website/content/en/docs/config/environment-variables.md b/website/content/en/docs/config/environment-variables.md
39+
index b769e95a632..d767e28ada1 100644
40+
--- a/website/content/en/docs/config/environment-variables.md
41+
+++ b/website/content/en/docs/config/environment-variables.md
42+
@@ -77,3 +77,15 @@ This page documents the environment variables used in Lima.
43+
```
44+
- **Note**: It is expected that this variable will be set to `false` by default in future
45+
when QEMU supports `pflash` UEFI for accelerated guests on Windows.
46+
+
47+
+### `_LIMA_WINDOWS_EXTRA_PATH`
48+
+
49+
+- **Description**: Additional directories which will be added to PATH by `limactl.exe` process to search for
50+
+ tools. Is is Windows specific and does nothing for other platforms.
51+
+- **Default**: unset
52+
+- **Usage**:
53+
+ ```bat
54+
+ set _LIMA_WINDOWS_EXTRA_PATH=C:\Program Files\Git\usr\bin
55+
+ ```
56+
+- **Note**: It is an experimental setting and has no guarantees being ever promoted to stable. It may be removed
57+
+ or changed at any stage of project development.

0 commit comments

Comments
 (0)