From 47f43447d67898ea8b2abc677b14b648a29b3903 Mon Sep 17 00:00:00 2001 From: Arthur Sengileyev Date: Wed, 4 Dec 2024 07:37:34 +0200 Subject: [PATCH] Update Podman to 5.4.0-dev --- .github/workflows/prepare-podman-release.yml | 11 +- README.md | 4 +- ...issues-in-QEMU-machine-files-Windows.patch | 189 ------------------ ...ment-QEMU-Podman-machine-on-Windows.patch} | 0 ...-specific-URL-handling-in-podman-com.patch | 100 --------- 5 files changed, 6 insertions(+), 298 deletions(-) delete mode 100644 patches/podman/0001-Fix-compilation-issues-in-QEMU-machine-files-Windows.patch rename patches/podman/{0002-Implement-QEMU-Podman-machine-on-Windows.patch => 0001-Implement-QEMU-Podman-machine-on-Windows.patch} (100%) delete mode 100644 patches/podman/0003-Improve-platform-specific-URL-handling-in-podman-com.patch diff --git a/.github/workflows/prepare-podman-release.yml b/.github/workflows/prepare-podman-release.yml index 682699f..c94886c 100644 --- a/.github/workflows/prepare-podman-release.yml +++ b/.github/workflows/prepare-podman-release.yml @@ -10,9 +10,9 @@ on: env: PODMAN_GITURL: https://github.com/containers/podman.git - PODMAN_SHA: 4cbdfde5d862dcdbe450c0f1d76ad75360f67a3c # v5.3.1 - PODMAN_VERSION: 5.3.1 - PODMAN_REVISION_KIND: prod # prod|dev + PODMAN_SHA: b60df61c3fbc6f331ba70b49b3088ba60e9c28a9 # v5.4.0-dev + PODMAN_VERSION: 5.4.0-dev + PODMAN_REVISION_KIND: dev # prod|dev jobs: build: @@ -31,6 +31,7 @@ jobs: git unzip base-devel + man-db mingw-w64-ucrt-x86_64-toolchain zip mingw-w64-ucrt-x86_64-go @@ -69,9 +70,7 @@ jobs: git remote add origin $PODMAN_GITURL git fetch --depth 1 origin $PODMAN_SHA git checkout FETCH_HEAD - patch --binary -l -p 1 < ../patches/podman/0001-Fix-compilation-issues-in-QEMU-machine-files-Windows.patch - patch --binary -l -p 1 < ../patches/podman/0002-Implement-QEMU-Podman-machine-on-Windows.patch - patch --binary -l -p 1 < ../patches/podman/0003-Improve-platform-specific-URL-handling-in-podman-com.patch + patch --binary -l -p 1 < ../patches/podman/0001-Implement-QEMU-Podman-machine-on-Windows.patch - name: "⚗️ Prepare Test Podman" working-directory: podman-release diff --git a/README.md b/README.md index bd84118..8542c15 100644 --- a/README.md +++ b/README.md @@ -68,10 +68,8 @@ Version `v9.5.0.0` with 1 patch from Powershell OpenSSH fork PRs: #### `Podman` -Version `5.3.1` with 3 patch sets: -* Enable compilation for Windows on parts of QEMU machine provider +Version `5.4.0-dev` with 1 patch set: * Implement QEMU Podman machine on Windows -* Improve platform specific URL handling in podman compose for machines https://github.com/containers/podman/pull/23827 #### `Podman Desktop` diff --git a/patches/podman/0001-Fix-compilation-issues-in-QEMU-machine-files-Windows.patch b/patches/podman/0001-Fix-compilation-issues-in-QEMU-machine-files-Windows.patch deleted file mode 100644 index 75b1342..0000000 --- a/patches/podman/0001-Fix-compilation-issues-in-QEMU-machine-files-Windows.patch +++ /dev/null @@ -1,189 +0,0 @@ -From 7f6a20355841ad345f874f504d28482267653c01 Mon Sep 17 00:00:00 2001 -From: Arthur Sengileyev -Date: Wed, 27 Nov 2024 17:13:28 +0200 -Subject: [PATCH] Fix compilation issues in QEMU machine files (Windows - platform) - -Signed-off-by: Arthur Sengileyev ---- - pkg/machine/qemu/command/command.go | 9 --------- - pkg/machine/qemu/command/command_unix.go | 18 ++++++++++++++++++ - pkg/machine/qemu/command/command_windows.go | 15 +++++++++++++++ - pkg/machine/qemu/config.go | 2 +- - pkg/machine/qemu/machine.go | 2 +- - pkg/machine/qemu/machine_unsupported.go | 3 --- - pkg/machine/qemu/options_windows_amd64.go | 2 +- - pkg/machine/qemu/stubber.go | 2 +- - pkg/machine/qemu/virtiofsd.go | 2 +- - pkg/machine/vmconfigs/config_windows.go | 10 +++++++++- - 10 files changed, 47 insertions(+), 18 deletions(-) - create mode 100644 pkg/machine/qemu/command/command_unix.go - create mode 100644 pkg/machine/qemu/command/command_windows.go - delete mode 100644 pkg/machine/qemu/machine_unsupported.go - -diff --git a/pkg/machine/qemu/command/command.go b/pkg/machine/qemu/command/command.go -index 11994f85f..de94ab396 100644 ---- a/pkg/machine/qemu/command/command.go -+++ b/pkg/machine/qemu/command/command.go -@@ -10,7 +10,6 @@ import ( - "strconv" - "time" - -- "github.com/containers/common/pkg/strongunits" - "github.com/containers/podman/v5/pkg/machine/define" - "github.com/containers/storage/pkg/fileutils" - ) -@@ -33,14 +32,6 @@ func NewQemuBuilder(binary string, options []string) QemuCmd { - return append(q, options...) - } - --// SetMemory adds the specified amount of memory for the machine --func (q *QemuCmd) SetMemory(m strongunits.MiB) { -- serializedMem := strconv.FormatUint(uint64(m), 10) -- // In order to use virtiofsd, we must enable shared memory -- *q = append(*q, "-object", fmt.Sprintf("memory-backend-memfd,id=mem,size=%sM,share=on", serializedMem)) -- *q = append(*q, "-m", serializedMem) --} -- - // SetCPUs adds the number of CPUs the machine will have - func (q *QemuCmd) SetCPUs(c uint64) { - *q = append(*q, "-smp", strconv.FormatUint(c, 10)) -diff --git a/pkg/machine/qemu/command/command_unix.go b/pkg/machine/qemu/command/command_unix.go -new file mode 100644 -index 000000000..a9ecd4a7d ---- /dev/null -+++ b/pkg/machine/qemu/command/command_unix.go -@@ -0,0 +1,18 @@ -+//go:build dragonfly || freebsd || linux || netbsd || openbsd -+ -+package command -+ -+import ( -+ "fmt" -+ "strconv" -+ -+ "github.com/containers/common/pkg/strongunits" -+) -+ -+// SetMemory adds the specified amount of memory for the machine -+func (q *QemuCmd) SetMemory(m strongunits.MiB) { -+ serializedMem := strconv.FormatUint(uint64(m), 10) -+ // In order to use virtiofsd, we must enable shared memory -+ *q = append(*q, "-object", fmt.Sprintf("memory-backend-memfd,id=mem,size=%sM,share=on", serializedMem)) -+ *q = append(*q, "-m", serializedMem) -+} -diff --git a/pkg/machine/qemu/command/command_windows.go b/pkg/machine/qemu/command/command_windows.go -new file mode 100644 -index 000000000..61a5ffa4a ---- /dev/null -+++ b/pkg/machine/qemu/command/command_windows.go -@@ -0,0 +1,15 @@ -+//go:build windows -+ -+package command -+ -+import ( -+ "strconv" -+ -+ "github.com/containers/common/pkg/strongunits" -+) -+ -+// SetMemory adds the specified amount of memory for the machine -+func (q *QemuCmd) SetMemory(m strongunits.MiB) { -+ serializedMem := strconv.FormatUint(uint64(m), 10) -+ *q = append(*q, "-m", serializedMem) -+} -diff --git a/pkg/machine/qemu/config.go b/pkg/machine/qemu/config.go -index 7d86bb634..760df18ea 100644 ---- a/pkg/machine/qemu/config.go -+++ b/pkg/machine/qemu/config.go -@@ -1,4 +1,4 @@ --//go:build !darwin && !windows -+//go:build !darwin - - package qemu - -diff --git a/pkg/machine/qemu/machine.go b/pkg/machine/qemu/machine.go -index 64fb04a73..1a33ba3b0 100644 ---- a/pkg/machine/qemu/machine.go -+++ b/pkg/machine/qemu/machine.go -@@ -1,4 +1,4 @@ --//go:build linux || freebsd -+//go:build linux || freebsd || windows - - package qemu - -diff --git a/pkg/machine/qemu/machine_unsupported.go b/pkg/machine/qemu/machine_unsupported.go -deleted file mode 100644 -index d3b969dd4..000000000 ---- a/pkg/machine/qemu/machine_unsupported.go -+++ /dev/null -@@ -1,3 +0,0 @@ --//go:build !amd64 && !arm64 && darwin -- --package qemu -diff --git a/pkg/machine/qemu/options_windows_amd64.go b/pkg/machine/qemu/options_windows_amd64.go -index 1a929a5f3..6e0ba0271 100644 ---- a/pkg/machine/qemu/options_windows_amd64.go -+++ b/pkg/machine/qemu/options_windows_amd64.go -@@ -1,4 +1,4 @@ --//go:build tempoff -+//go:build windows && amd64 - - package qemu - -diff --git a/pkg/machine/qemu/stubber.go b/pkg/machine/qemu/stubber.go -index d9d657db3..a1fee675b 100644 ---- a/pkg/machine/qemu/stubber.go -+++ b/pkg/machine/qemu/stubber.go -@@ -1,4 +1,4 @@ --//go:build linux || freebsd -+//go:build linux || freebsd || windows - - package qemu - -diff --git a/pkg/machine/qemu/virtiofsd.go b/pkg/machine/qemu/virtiofsd.go -index fe2c69700..29f6ba215 100644 ---- a/pkg/machine/qemu/virtiofsd.go -+++ b/pkg/machine/qemu/virtiofsd.go -@@ -1,4 +1,4 @@ --//go:build linux || freebsd -+//go:build linux || freebsd || windows - - package qemu - -diff --git a/pkg/machine/vmconfigs/config_windows.go b/pkg/machine/vmconfigs/config_windows.go -index be39e2f95..bbb694412 100644 ---- a/pkg/machine/vmconfigs/config_windows.go -+++ b/pkg/machine/vmconfigs/config_windows.go -@@ -1,7 +1,9 @@ - package vmconfigs - - import ( -+ "github.com/containers/podman/v5/pkg/machine/define" - "github.com/containers/podman/v5/pkg/machine/hyperv/vsock" -+ "github.com/containers/podman/v5/pkg/machine/qemu/command" - ) - - type HyperVConfig struct { -@@ -17,10 +19,16 @@ type WSLConfig struct { - UserModeNetworking bool - } - -+type QEMUConfig struct { -+ // QMPMonitor is the qemu monitor object for sending commands -+ QMPMonitor command.Monitor -+ // QEMUPidPath is where to write the PID for QEMU when running -+ QEMUPidPath *define.VMFile -+} -+ - // Stubs - type AppleHVConfig struct{} - type LibKrunConfig struct{} --type QEMUConfig struct{} - - func getHostUID() int { - return 1000 --- -2.47.1 - diff --git a/patches/podman/0002-Implement-QEMU-Podman-machine-on-Windows.patch b/patches/podman/0001-Implement-QEMU-Podman-machine-on-Windows.patch similarity index 100% rename from patches/podman/0002-Implement-QEMU-Podman-machine-on-Windows.patch rename to patches/podman/0001-Implement-QEMU-Podman-machine-on-Windows.patch diff --git a/patches/podman/0003-Improve-platform-specific-URL-handling-in-podman-com.patch b/patches/podman/0003-Improve-platform-specific-URL-handling-in-podman-com.patch deleted file mode 100644 index eb742bc..0000000 --- a/patches/podman/0003-Improve-platform-specific-URL-handling-in-podman-com.patch +++ /dev/null @@ -1,100 +0,0 @@ -From 793dc325e9e0c22c233a738914f93038836a5729 Mon Sep 17 00:00:00 2001 -From: Arthur Sengileyev -Date: Sat, 31 Aug 2024 20:56:16 +0300 -Subject: [PATCH 3/3] Improve platform specific URL handling in `podman - compose` for machines - -Use filepath utility instead of generic string replace to convert path -on Windows. This also separates OS specific implementations to separate -compilation sources and removes redundant check for virtualization -provider on Windows platform. - -Signed-off-by: Arthur Sengileyev ---- - cmd/podman/compose_machine.go | 13 +------------ - cmd/podman/compose_machine_unix.go | 16 ++++++++++++++++ - cmd/podman/compose_machine_windows.go | 15 +++++++++++++++ - 3 files changed, 32 insertions(+), 12 deletions(-) - create mode 100644 cmd/podman/compose_machine_unix.go - create mode 100644 cmd/podman/compose_machine_windows.go - -diff --git a/cmd/podman/compose_machine.go b/cmd/podman/compose_machine.go -index 7d70cc84c..aadbfe42f 100644 ---- a/cmd/podman/compose_machine.go -+++ b/cmd/podman/compose_machine.go -@@ -3,11 +3,9 @@ - package main - - import ( -- "errors" - "fmt" - "net/url" - "strconv" -- "strings" - - "github.com/containers/podman/v5/pkg/machine/define" - "github.com/containers/podman/v5/pkg/machine/env" -@@ -55,16 +53,7 @@ func getMachineConn(connectionURI string, parsedConnection *url.URL) (string, er - if err != nil { - return "", err - } -- if machineProvider.VMType() == define.WSLVirt || machineProvider.VMType() == define.HyperVVirt { -- if podmanPipe == nil { -- return "", errors.New("pipe of machine is not set") -- } -- return strings.Replace(podmanPipe.Path, `\\.\pipe\`, "npipe:////./pipe/", 1), nil -- } -- if podmanSocket == nil { -- return "", errors.New("socket of machine is not set") -- } -- return "unix://" + podmanSocket.Path, nil -+ return extractConnectionString(podmanSocket, podmanPipe) - } - return "", fmt.Errorf("could not find a matching machine for connection %q", connectionURI) - } -diff --git a/cmd/podman/compose_machine_unix.go b/cmd/podman/compose_machine_unix.go -new file mode 100644 -index 000000000..de2fb2934 ---- /dev/null -+++ b/cmd/podman/compose_machine_unix.go -@@ -0,0 +1,16 @@ -+//go:build (amd64 || arm64) && !windows -+ -+package main -+ -+import ( -+ "errors" -+ -+ "github.com/containers/podman/v5/pkg/machine/define" -+) -+ -+func extractConnectionString(podmanSocket *define.VMFile, podmanPipe *define.VMFile) (string, error) { -+ if podmanSocket == nil { -+ return "", errors.New("socket of machine is not set") -+ } -+ return "unix://" + podmanSocket.Path, nil -+} -diff --git a/cmd/podman/compose_machine_windows.go b/cmd/podman/compose_machine_windows.go -new file mode 100644 -index 000000000..49b8be172 ---- /dev/null -+++ b/cmd/podman/compose_machine_windows.go -@@ -0,0 +1,15 @@ -+package main -+ -+import ( -+ "errors" -+ "path/filepath" -+ -+ "github.com/containers/podman/v5/pkg/machine/define" -+) -+ -+func extractConnectionString(podmanSocket *define.VMFile, podmanPipe *define.VMFile) (string, error) { -+ if podmanPipe == nil { -+ return "", errors.New("pipe of machine is not set") -+ } -+ return "npipe://" + filepath.ToSlash(podmanPipe.Path), nil -+} --- -2.47.0 -