From 124e161721afd83c626fe63a7b894d427bff73be Mon Sep 17 00:00:00 2001 From: tg Date: Fri, 6 Jun 2025 21:59:48 +0000 Subject: [PATCH 01/27] add mb{i,f}to{,l,ll}u(value) macros from musl ML discussion by dalias and Andy Caldwell to check ingress type while casting to unsigned (from either floats-or-integers or just integers) --- mbsdcc.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/mbsdcc.h b/mbsdcc.h index add9736..234ad2d 100644 --- a/mbsdcc.h +++ b/mbsdcc.h @@ -5,7 +5,7 @@ */ #ifndef SYSKERN_MBSDCC_H -#define SYSKERN_MBSDCC_H "$MirOS: src/kern/include/mbsdcc.h,v 1.11 2025/02/11 03:56:07 tg Exp $" +#define SYSKERN_MBSDCC_H "$MirOS: src/kern/include/mbsdcc.h,v 1.12 2025/06/06 21:59:48 tg Exp $" /* * Note: this header uses the SIZE_MAX (or similar) definitions @@ -26,7 +26,7 @@ #include #endif -/* mbccABEND should be provided by the user, called by mbsd*.h only */ +/* mbccABEND is called by mbsd*.h and should be provided by the user */ #ifndef mbccABEND #define mbccABEND(reasonstr) abort() #endif @@ -242,4 +242,15 @@ template<> struct mbccCEX_sa { typedef int Type; }; #define SHIKATANAI (void) #endif +/* macros to cast to unsigned {int,long,long long} with ingress type check */ + +/* …from signed integers */ +#define mbitou(x) ((unsigned)((x)|0)) +#define mbitolu(x) ((unsigned long)((x)|0)) +#define mbitollu(x) ((unsigned long long)((x)|0)) +/* …from floats or signed integers */ +#define mbftou(x) ((unsigned)+(x)) +#define mbftolu(x) ((unsigned long)+(x)) +#define mbftollu(x) ((unsigned long long)+(x)) + #endif /* !SYSKERN_MBSDCC_H */ From 67179018df51f299eac905a5f4539f0922a2dbbe Mon Sep 17 00:00:00 2001 From: tg Date: Fri, 6 Jun 2025 22:00:08 +0000 Subject: [PATCH 02/27] fix indent --- mbsdcc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mbsdcc.h b/mbsdcc.h index 234ad2d..4d7fc3a 100644 --- a/mbsdcc.h +++ b/mbsdcc.h @@ -5,7 +5,7 @@ */ #ifndef SYSKERN_MBSDCC_H -#define SYSKERN_MBSDCC_H "$MirOS: src/kern/include/mbsdcc.h,v 1.12 2025/06/06 21:59:48 tg Exp $" +#define SYSKERN_MBSDCC_H "$MirOS: src/kern/include/mbsdcc.h,v 1.14 2025/06/06 22:00:08 tg Exp $" /* * Note: this header uses the SIZE_MAX (or similar) definitions @@ -28,7 +28,7 @@ /* mbccABEND is called by mbsd*.h and should be provided by the user */ #ifndef mbccABEND -#define mbccABEND(reasonstr) abort() +#define mbccABEND(reasonstr) abort() #endif /* monkey-patch known-bad offsetof versions */ From c4cf50f5bc3453d182de45ed6fd8c02fd290941b Mon Sep 17 00:00:00 2001 From: mirabilos Date: Mon, 9 Jun 2025 21:24:27 +0200 Subject: [PATCH 03/27] run GHAV updater --- .github/workflows/vm-slowlartus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vm-slowlartus.yml b/.github/workflows/vm-slowlartus.yml index 0f34a87..a2acc65 100644 --- a/.github/workflows/vm-slowlartus.yml +++ b/.github/workflows/vm-slowlartus.yml @@ -10,7 +10,7 @@ "run": "(git gc --quiet || :)" }, { - "uses": "vmactions/solaris-vm@v1.1.1", + "uses": "vmactions/solaris-vm@v1.1.4", "with": { "copyback": false, "mem": 2048, From 742f07645786504f46e421b0cde0e777774d4885 Mon Sep 17 00:00:00 2001 From: mirabilos Date: Mon, 9 Jun 2025 21:28:22 +0200 Subject: [PATCH 04/27] complete apt.conf across all releases --- .extra/debeol.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.extra/debeol.sh b/.extra/debeol.sh index a9bd06b..2006569 100644 --- a/.extra/debeol.sh +++ b/.extra/debeol.sh @@ -52,7 +52,12 @@ HAVE_CAN_XIPO_0=0 export HAVE_CAN_QNOIPA HAVE_CAN_XIPO_0 cat >>/etc/apt/apt.conf <<\EOF debug::pkgproblemresolver "true"; +Dpkg::Progress-Fancy "false"; +// undo lenny breakage APT::Install-Recommends "0"; +APT::Install-Suggests "0"; +APT::Get::Always-Include-Phased-Updates "true"; +APT::Periodic::Enable "0"; EOF apt-get update case $1 in From 5c76be6dc8b3eb19a80c5d101517d97ef19bec2e Mon Sep 17 00:00:00 2001 From: mirabilos Date: Mon, 9 Jun 2025 21:31:04 +0200 Subject: [PATCH 05/27] get glibc from experimental as well if present --- .extra/debeol.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.extra/debeol.sh b/.extra/debeol.sh index 2006569..e66b7ef 100644 --- a/.extra/debeol.sh +++ b/.extra/debeol.sh @@ -75,7 +75,7 @@ slink) ;; experimental) apt-get install -t experimental -y bc build-essential \ - binutils cpp gcc g++ + binutils cpp gcc g++ libc6-dev ;; *) apt-get install -y bc build-essential From 9aa30a8171dea63b62924aa3d1d2b1de3908bb03 Mon Sep 17 00:00:00 2001 From: mirabilos Date: Mon, 9 Jun 2025 21:34:04 +0200 Subject: [PATCH 06/27] address qemu/sid packaging changes --- .extra/cross.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.extra/cross.sh b/.extra/cross.sh index 12f52f8..b2589b4 100644 --- a/.extra/cross.sh +++ b/.extra/cross.sh @@ -7,7 +7,7 @@ set -ex LC_ALL=C.UTF-8 LANGUAGE=C DEBIAN_FRONTEND=noninteractive export LC_ALL DEBIAN_FRONTEND unset LANGUAGE -xarch=$1 xtriplet=$2 xqemu=$3-static +xarch=$1 xtriplet=$2 xqemu=$3 echo ::group::Setup $0 on Debian sid/$xarch nocxx=false cat >dummy.c <<\EOF @@ -71,7 +71,7 @@ else fi echo ::endgroup:: echo ::group::Installing qemu-user -apt-get install -y qemu-user-static +apt-get install -y qemu-user echo ::endgroup:: echo ::group::Running under qemu-user $xqemu ./.result-c From 19b00c4d5fb8d09f0737af341b82ecccfe059c93 Mon Sep 17 00:00:00 2001 From: mirabilos Date: Mon, 9 Jun 2025 21:36:42 +0200 Subject: [PATCH 07/27] Revert "drop sh4 for now, qemu-sh4 just sits there, doing nothing" This reverts commit 627eb9bc262b2bd4d8aa81bc048a69354100068e. --- .github/workflows/deb-cross.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/deb-cross.yml b/.github/workflows/deb-cross.yml index 5b9ad3a..9570111 100644 --- a/.github/workflows/deb-cross.yml +++ b/.github/workflows/deb-cross.yml @@ -119,6 +119,23 @@ "fail-fast": true } }, + "sh4": { + "runs-on": "ubuntu-latest", + "steps": [ + { + "uses": "actions/checkout@v4.2.2" + }, + { + "uses": "docker://debian:sid-slim", + "with": { + "args": "sh .extra/cross.sh sh4 sh4-linux-gnu qemu-sh4" + } + } + ], + "strategy": { + "fail-fast": true + } + }, "sparc64": { "runs-on": "ubuntu-latest", "steps": [ From ee05f6011830db72fb02344422bffddbd59b8ca4 Mon Sep 17 00:00:00 2001 From: mirabilos Date: Mon, 9 Jun 2025 21:58:57 +0200 Subject: [PATCH 08/27] =?UTF-8?q?don=E2=80=99t=20skip=20arches=20we=20also?= =?UTF-8?q?=20cover=20via=20Alpine=20Linux=20due=20to=20the=20libc=20diffe?= =?UTF-8?q?rence?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deb-cross.yml | 102 ++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/.github/workflows/deb-cross.yml b/.github/workflows/deb-cross.yml index 9570111..1c144a5 100644 --- a/.github/workflows/deb-cross.yml +++ b/.github/workflows/deb-cross.yml @@ -17,6 +17,23 @@ "fail-fast": true } }, + "arm64": { + "runs-on": "ubuntu-latest", + "steps": [ + { + "uses": "actions/checkout@v4.2.2" + }, + { + "uses": "docker://debian:sid-slim", + "with": { + "args": "sh .extra/cross.sh arm64 aarch64-linux-gnu qemu-arm64" + } + } + ], + "strategy": { + "fail-fast": true + } + }, "armel": { "runs-on": "ubuntu-latest", "steps": [ @@ -34,6 +51,23 @@ "fail-fast": true } }, + "armhf": { + "runs-on": "ubuntu-latest", + "steps": [ + { + "uses": "actions/checkout@v4.2.2" + }, + { + "uses": "docker://debian:sid-slim", + "with": { + "args": "sh .extra/cross.sh armhf arm-linux-gnueabihf qemu-armhf" + } + } + ], + "strategy": { + "fail-fast": true + } + }, "hppa": { "runs-on": "ubuntu-latest", "steps": [ @@ -51,6 +85,23 @@ "fail-fast": true } }, + "loong64": { + "runs-on": "ubuntu-latest", + "steps": [ + { + "uses": "actions/checkout@v4.2.2" + }, + { + "uses": "docker://debian:sid-slim", + "with": { + "args": "sh .extra/cross.sh loong64 loongarch64-linux-gnu qemu-loong64" + } + } + ], + "strategy": { + "fail-fast": true + } + }, "m68k": { "runs-on": "ubuntu-latest", "steps": [ @@ -119,6 +170,57 @@ "fail-fast": true } }, + "ppc64el": { + "runs-on": "ubuntu-latest", + "steps": [ + { + "uses": "actions/checkout@v4.2.2" + }, + { + "uses": "docker://debian:sid-slim", + "with": { + "args": "sh .extra/cross.sh ppc64el powerpc64le-linux-gnu qemu-ppc64el" + } + } + ], + "strategy": { + "fail-fast": true + } + }, + "riscv64": { + "runs-on": "ubuntu-latest", + "steps": [ + { + "uses": "actions/checkout@v4.2.2" + }, + { + "uses": "docker://debian:sid-slim", + "with": { + "args": "sh .extra/cross.sh riscv64 riscv64-linux-gnu qemu-riscv64" + } + } + ], + "strategy": { + "fail-fast": true + } + }, + "s390x": { + "runs-on": "ubuntu-latest", + "steps": [ + { + "uses": "actions/checkout@v4.2.2" + }, + { + "uses": "docker://debian:sid-slim", + "with": { + "args": "sh .extra/cross.sh s390x s390x-linux-gnu qemu-s390x" + } + } + ], + "strategy": { + "fail-fast": true + } + }, "sh4": { "runs-on": "ubuntu-latest", "steps": [ From 9057cec6629b099b4daf0f10ef0202480eec54f1 Mon Sep 17 00:00:00 2001 From: mirabilos Date: Mon, 9 Jun 2025 21:59:48 +0200 Subject: [PATCH 09/27] update Alpine Linux arch list --- .github/workflows/build-and-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 6f1dfda..f686a66 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -97,6 +97,7 @@ "aarch64", "armhf", "armv7", + "loongarch64", "ppc64le", "riscv64", "s390x", From 3e7c91a57fad98f5f76065ba6de5653ed920466c Mon Sep 17 00:00:00 2001 From: mirabilos Date: Mon, 9 Jun 2025 22:25:42 +0200 Subject: [PATCH 10/27] disable all automatic workflow runs for this branch --- .github/workflows/build-and-test.yml | 5 ----- .github/workflows/codeql-analysis.yml | 5 ----- .github/workflows/deb-cross.yml | 5 ----- .github/workflows/deb-eol.yml | 5 ----- .github/workflows/deb-i386-clang.yml | 5 ----- .github/workflows/deb-i386-gcc.yml | 5 ----- .github/workflows/deb-i386.yml | 5 ----- .github/workflows/vm-dfbsd.yml | 5 ----- .github/workflows/vm-fbsd.yml | 5 ----- .github/workflows/vm-nbsd.yml | 5 ----- .github/workflows/vm-obsd.yml | 5 ----- .github/workflows/windhoos.yml | 5 ----- 12 files changed, 60 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index f686a66..0aa327f 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -110,11 +110,6 @@ }, "name": "build-and-test", "on": { - "push": { - "branches": [ - "GHA" - ] - }, "workflow_dispatch": null } } diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index e57a298..017d9be 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -44,11 +44,6 @@ }, "name": "CodeQL", "on": { - "push": { - "branches": [ - "GHA" - ] - }, "workflow_dispatch": null } } diff --git a/.github/workflows/deb-cross.yml b/.github/workflows/deb-cross.yml index 1c144a5..83f6e52 100644 --- a/.github/workflows/deb-cross.yml +++ b/.github/workflows/deb-cross.yml @@ -258,11 +258,6 @@ }, "name": "deb-cross", "on": { - "push": { - "branches": [ - "GHA" - ] - }, "workflow_dispatch": null } } diff --git a/.github/workflows/deb-eol.yml b/.github/workflows/deb-eol.yml index 1a120cc..dd19333 100644 --- a/.github/workflows/deb-eol.yml +++ b/.github/workflows/deb-eol.yml @@ -255,11 +255,6 @@ }, "name": "deb-eol", "on": { - "push": { - "branches": [ - "GHA" - ] - }, "workflow_dispatch": null } } diff --git a/.github/workflows/deb-i386-clang.yml b/.github/workflows/deb-i386-clang.yml index 9c91409..2fc590a 100644 --- a/.github/workflows/deb-i386-clang.yml +++ b/.github/workflows/deb-i386-clang.yml @@ -190,11 +190,6 @@ }, "name": "clang-deb-i386", "on": { - "push": { - "branches": [ - "GHA" - ] - }, "workflow_dispatch": null } } diff --git a/.github/workflows/deb-i386-gcc.yml b/.github/workflows/deb-i386-gcc.yml index 62c3ba0..9b4eb38 100644 --- a/.github/workflows/deb-i386-gcc.yml +++ b/.github/workflows/deb-i386-gcc.yml @@ -207,11 +207,6 @@ }, "name": "gcc-deb-i386", "on": { - "push": { - "branches": [ - "GHA" - ] - }, "workflow_dispatch": null } } diff --git a/.github/workflows/deb-i386.yml b/.github/workflows/deb-i386.yml index c629cf0..1b3427a 100644 --- a/.github/workflows/deb-i386.yml +++ b/.github/workflows/deb-i386.yml @@ -182,11 +182,6 @@ }, "name": "deb-i386", "on": { - "push": { - "branches": [ - "GHA" - ] - }, "workflow_dispatch": null } } diff --git a/.github/workflows/vm-dfbsd.yml b/.github/workflows/vm-dfbsd.yml index 0eba9e5..807ffa2 100644 --- a/.github/workflows/vm-dfbsd.yml +++ b/.github/workflows/vm-dfbsd.yml @@ -23,11 +23,6 @@ }, "name": "vm-dfbsd", "on": { - "push": { - "branches": [ - "GHA" - ] - }, "workflow_dispatch": null } } diff --git a/.github/workflows/vm-fbsd.yml b/.github/workflows/vm-fbsd.yml index 57e6bcb..db81b88 100644 --- a/.github/workflows/vm-fbsd.yml +++ b/.github/workflows/vm-fbsd.yml @@ -23,11 +23,6 @@ }, "name": "vm-fbsd", "on": { - "push": { - "branches": [ - "GHA" - ] - }, "workflow_dispatch": null } } diff --git a/.github/workflows/vm-nbsd.yml b/.github/workflows/vm-nbsd.yml index 48eb883..f37693f 100644 --- a/.github/workflows/vm-nbsd.yml +++ b/.github/workflows/vm-nbsd.yml @@ -23,11 +23,6 @@ }, "name": "vm-nbsd", "on": { - "push": { - "branches": [ - "GHA" - ] - }, "workflow_dispatch": null } } diff --git a/.github/workflows/vm-obsd.yml b/.github/workflows/vm-obsd.yml index 8cc6955..a58b701 100644 --- a/.github/workflows/vm-obsd.yml +++ b/.github/workflows/vm-obsd.yml @@ -23,11 +23,6 @@ }, "name": "vm-obsd", "on": { - "push": { - "branches": [ - "GHA" - ] - }, "workflow_dispatch": null } } diff --git a/.github/workflows/windhoos.yml b/.github/workflows/windhoos.yml index df3d0a7..3d15c46 100644 --- a/.github/workflows/windhoos.yml +++ b/.github/workflows/windhoos.yml @@ -71,11 +71,6 @@ }, "name": "Win32", "on": { - "push": { - "branches": [ - "GHA" - ] - }, "workflow_dispatch": null } } From 9bdc6b1f0f87420f10018cf4c02ea367ebca8e2c Mon Sep 17 00:00:00 2001 From: mirabilos Date: Mon, 9 Jun 2025 22:28:56 +0200 Subject: [PATCH 11/27] =?UTF-8?q?let=E2=80=99s=20see=20if=20we=20can=20fig?= =?UTF-8?q?ure=20out=20windows/arm=20builds=20with=20this?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/winarm-tmate.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/winarm-tmate.yml diff --git a/.github/workflows/winarm-tmate.yml b/.github/workflows/winarm-tmate.yml new file mode 100644 index 0000000..36063ee --- /dev/null +++ b/.github/workflows/winarm-tmate.yml @@ -0,0 +1,19 @@ +{ + "jobs": { + "Debug with action-tmate": { + "runs-on": "windows-11-arm", + "steps": [ + { + "uses": "actions/checkout@v4" + }, + { + "uses": "mxschmitt/action-tmate@v3" + } + ] + } + }, + "name": "action-tmate windows-11-arm", + "on": { + "workflow_dispatch": null + } +} From 7b491f1463a2ac7bac22114b9f1621fc14e3822e Mon Sep 17 00:00:00 2001 From: mirabilos Date: Mon, 9 Jun 2025 22:32:59 +0200 Subject: [PATCH 12/27] try to run this cf. https://thomaslevesque.com/2024/04/25/running-a-github-actions-workflow-that-doesnt-exist-yet-on-the-default-branch/ --- .github/workflows/winarm-tmate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/winarm-tmate.yml b/.github/workflows/winarm-tmate.yml index 36063ee..e2627e9 100644 --- a/.github/workflows/winarm-tmate.yml +++ b/.github/workflows/winarm-tmate.yml @@ -14,6 +14,7 @@ }, "name": "action-tmate windows-11-arm", "on": { + "pull_request": null, "workflow_dispatch": null } } From a9f32f43873a16c605bb3a9f5ef3e3e0a7ca3dc0 Mon Sep 17 00:00:00 2001 From: mirabilos Date: Mon, 9 Jun 2025 22:34:39 +0200 Subject: [PATCH 13/27] rename the ID --- .github/workflows/winarm-tmate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/winarm-tmate.yml b/.github/workflows/winarm-tmate.yml index e2627e9..c1eeeb5 100644 --- a/.github/workflows/winarm-tmate.yml +++ b/.github/workflows/winarm-tmate.yml @@ -1,6 +1,6 @@ { "jobs": { - "Debug with action-tmate": { + "action-tmate": { "runs-on": "windows-11-arm", "steps": [ { From 7e087a127c82f2eaa7260b0515f698c74640056d Mon Sep 17 00:00:00 2001 From: mirabilos Date: Mon, 9 Jun 2025 22:37:38 +0200 Subject: [PATCH 14/27] to test the build we definitely need WSL and no CRLF --- .github/workflows/winarm-tmate.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/winarm-tmate.yml b/.github/workflows/winarm-tmate.yml index c1eeeb5..530f112 100644 --- a/.github/workflows/winarm-tmate.yml +++ b/.github/workflows/winarm-tmate.yml @@ -3,6 +3,18 @@ "action-tmate": { "runs-on": "windows-11-arm", "steps": [ + { + "uses": "Vampire/setup-wsl@v5.0.1", + "with": { + "additional-packages": "bc build-essential", + "update": true, + "wsl-version": 1 + } + }, + { + "name": "unfuck line endings (GitHub by default converts them on checkout)", + "run": "git config --global core.autocrlf false\ngit config --global core.eol lf" + }, { "uses": "actions/checkout@v4" }, From 8b37f4dd6aae23e5aca18699b429b3d155e6a09f Mon Sep 17 00:00:00 2001 From: mirabilos Date: Mon, 9 Jun 2025 22:38:44 +0200 Subject: [PATCH 15/27] https://github.com/mxschmitt/action-tmate#use-a-different-msys2-location --- .github/workflows/winarm-tmate.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/winarm-tmate.yml b/.github/workflows/winarm-tmate.yml index 530f112..81f6074 100644 --- a/.github/workflows/winarm-tmate.yml +++ b/.github/workflows/winarm-tmate.yml @@ -19,7 +19,14 @@ "uses": "actions/checkout@v4" }, { - "uses": "mxschmitt/action-tmate@v3" + "id": "setup-msys2", + "uses": "msys2/setup-msys2@v2" + }, + { + "uses": "mxschmitt/action-tmate@v3", + "with": { + "msys2-location": "${{ steps.setup-msys2.outputs.msys2-location }}" + } } ] } From 4526c4ae1677fc2db9bf011f7be08dad25a6c5ba Mon Sep 17 00:00:00 2001 From: mirabilos Date: Mon, 9 Jun 2025 22:41:58 +0200 Subject: [PATCH 16/27] drop WSL for now until fixed https://github.com/Vampire/setup-wsl/issues/74 --- .github/workflows/winarm-tmate.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/winarm-tmate.yml b/.github/workflows/winarm-tmate.yml index 81f6074..9985154 100644 --- a/.github/workflows/winarm-tmate.yml +++ b/.github/workflows/winarm-tmate.yml @@ -3,14 +3,6 @@ "action-tmate": { "runs-on": "windows-11-arm", "steps": [ - { - "uses": "Vampire/setup-wsl@v5.0.1", - "with": { - "additional-packages": "bc build-essential", - "update": true, - "wsl-version": 1 - } - }, { "name": "unfuck line endings (GitHub by default converts them on checkout)", "run": "git config --global core.autocrlf false\ngit config --global core.eol lf" From 3d3cf2322c576ed5da3e6579d051631e57b83e71 Mon Sep 17 00:00:00 2001 From: mirabilos Date: Mon, 9 Jun 2025 23:06:50 +0200 Subject: [PATCH 17/27] we might be able to do it with msys2 --- .github/workflows/winarm-tmate.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/winarm-tmate.yml b/.github/workflows/winarm-tmate.yml index 9985154..6d3dc2e 100644 --- a/.github/workflows/winarm-tmate.yml +++ b/.github/workflows/winarm-tmate.yml @@ -12,7 +12,11 @@ }, { "id": "setup-msys2", - "uses": "msys2/setup-msys2@v2" + "uses": "msys2/setup-msys2@v2", + "with": { + "install": "bc ed", + "update": true + } }, { "uses": "mxschmitt/action-tmate@v3", From f3af442377f90f67d8c542f53b0a32ec32221fe4 Mon Sep 17 00:00:00 2001 From: mirabilos Date: Mon, 9 Jun 2025 23:17:42 +0200 Subject: [PATCH 18/27] stop the tmate --- .github/workflows/winarm-tmate.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/winarm-tmate.yml b/.github/workflows/winarm-tmate.yml index 6d3dc2e..b517796 100644 --- a/.github/workflows/winarm-tmate.yml +++ b/.github/workflows/winarm-tmate.yml @@ -29,7 +29,6 @@ }, "name": "action-tmate windows-11-arm", "on": { - "pull_request": null, "workflow_dispatch": null } } From 390901a13e1e3c2ebfba844fdb41d00401cd3ea3 Mon Sep 17 00:00:00 2001 From: mirabilos Date: Mon, 9 Jun 2025 23:17:48 +0200 Subject: [PATCH 19/27] experiment with an MSYS2-based ARM build (ipv WSL) --- .github/workflows/winarm-build.yml | 52 ++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/winarm-build.yml diff --git a/.github/workflows/winarm-build.yml b/.github/workflows/winarm-build.yml new file mode 100644 index 0000000..cc48628 --- /dev/null +++ b/.github/workflows/winarm-build.yml @@ -0,0 +1,52 @@ +{ + "jobs": { + "build": { + "runs-on": "windows-11-arm", + "steps": [ + { + "name": "unfuck line endings (GitHub by default converts them on checkout)", + "run": "git config --global core.autocrlf false\ngit config --global core.eol lf" + }, + { + "uses": "actions/checkout@v4.2.2" + }, + { + "id": "setup-msys2", + "uses": "msys2/setup-msys2@v2", + "with": { + "install": "bc ed", + "update": true + } + }, + { + "name": "prepare batch wrapper for MSYS", + "run": "msys2 -c 'printf \"%s\\n\" \"/wsl .bin.sh/s//msys2/\" \"s/...wslpath ..COMSPEC..../cmd/\" i \"set MSYS_NO_PATHCONV=1\" . w q | ed -s mkt-int.bat'", + "shell": "cmd" + }, + { + "name": "prepare arm64 C and C++", + "run": "find-cl.bat arm64", + "shell": "cmd" + }, + { + "name": "build arm64 C", + "run": "mkt-int.bat", + "shell": "cmd" + }, + { + "name": "build arm64 C++", + "run": "mkt-int.bat -cxx", + "shell": "cmd" + } + ], + "strategy": { + "fail-fast": true + } + } + }, + "name": "Windows/ARM", + "on": { + "pull_request": null, + "workflow_dispatch": null + } +} From 93a4d4c1af01eaed70b9e2edc807b90d9dde55a0 Mon Sep 17 00:00:00 2001 From: mirabilos Date: Mon, 9 Jun 2025 23:20:28 +0200 Subject: [PATCH 20/27] =?UTF-8?q?don=E2=80=99t=20upgrade=20the=20MSYS2=20e?= =?UTF-8?q?nvironment=20needlessly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/winarm-build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/winarm-build.yml b/.github/workflows/winarm-build.yml index cc48628..1bef96d 100644 --- a/.github/workflows/winarm-build.yml +++ b/.github/workflows/winarm-build.yml @@ -14,8 +14,7 @@ "id": "setup-msys2", "uses": "msys2/setup-msys2@v2", "with": { - "install": "bc ed", - "update": true + "install": "bc ed" } }, { From 4ed3f89d7c9edf26c2d945bb774b91d2db79b2e3 Mon Sep 17 00:00:00 2001 From: mirabilos Date: Mon, 9 Jun 2025 23:22:11 +0200 Subject: [PATCH 21/27] test again --- .github/workflows/winarm-build.yml | 1 - .github/workflows/winarm-tmate.yml | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/winarm-build.yml b/.github/workflows/winarm-build.yml index 1bef96d..b643d75 100644 --- a/.github/workflows/winarm-build.yml +++ b/.github/workflows/winarm-build.yml @@ -45,7 +45,6 @@ }, "name": "Windows/ARM", "on": { - "pull_request": null, "workflow_dispatch": null } } diff --git a/.github/workflows/winarm-tmate.yml b/.github/workflows/winarm-tmate.yml index b517796..a1fd57f 100644 --- a/.github/workflows/winarm-tmate.yml +++ b/.github/workflows/winarm-tmate.yml @@ -14,8 +14,7 @@ "id": "setup-msys2", "uses": "msys2/setup-msys2@v2", "with": { - "install": "bc ed", - "update": true + "install": "bc ed" } }, { @@ -29,6 +28,7 @@ }, "name": "action-tmate windows-11-arm", "on": { + "pull_request": null, "workflow_dispatch": null } } From f7fc1361e418f4bcf7f7230581b03297542d5ccd Mon Sep 17 00:00:00 2001 From: mirabilos Date: Mon, 9 Jun 2025 23:25:27 +0200 Subject: [PATCH 22/27] untest again --- .github/workflows/winarm-build.yml | 1 + .github/workflows/winarm-tmate.yml | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/winarm-build.yml b/.github/workflows/winarm-build.yml index b643d75..1bef96d 100644 --- a/.github/workflows/winarm-build.yml +++ b/.github/workflows/winarm-build.yml @@ -45,6 +45,7 @@ }, "name": "Windows/ARM", "on": { + "pull_request": null, "workflow_dispatch": null } } diff --git a/.github/workflows/winarm-tmate.yml b/.github/workflows/winarm-tmate.yml index a1fd57f..867c629 100644 --- a/.github/workflows/winarm-tmate.yml +++ b/.github/workflows/winarm-tmate.yml @@ -28,7 +28,6 @@ }, "name": "action-tmate windows-11-arm", "on": { - "pull_request": null, "workflow_dispatch": null } } From 33dc595bbb2717399e3d8ba02fee2bd23f553d96 Mon Sep 17 00:00:00 2001 From: mirabilos Date: Mon, 9 Jun 2025 23:29:13 +0200 Subject: [PATCH 23/27] =?UTF-8?q?the=20pipe=20was=20interpreted=20by=20cmd?= =?UTF-8?q?=20=F0=9F=99=80=20hack=20the=20.bat=20instead?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/winarm-build.yml | 14 +++++++------- mkt-int.bat | 7 +++++++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/winarm-build.yml b/.github/workflows/winarm-build.yml index 1bef96d..69e0dd3 100644 --- a/.github/workflows/winarm-build.yml +++ b/.github/workflows/winarm-build.yml @@ -18,23 +18,23 @@ } }, { - "name": "prepare batch wrapper for MSYS", - "run": "msys2 -c 'printf \"%s\\n\" \"/wsl .bin.sh/s//msys2/\" \"s/...wslpath ..COMSPEC..../cmd/\" i \"set MSYS_NO_PATHCONV=1\" . w q | ed -s mkt-int.bat'", + "name": "prepare arm64 C", + "run": "find-cl.bat arm64", "shell": "cmd" }, { - "name": "prepare arm64 C and C++", - "run": "find-cl.bat arm64", + "name": "build arm64 C", + "run": "mkt-int.bat -msys", "shell": "cmd" }, { - "name": "build arm64 C", - "run": "mkt-int.bat", + "name": "prepare arm64 C++", + "run": "find-cl.bat arm64", "shell": "cmd" }, { "name": "build arm64 C++", - "run": "mkt-int.bat -cxx", + "run": "mkt-int.bat -cxx -msys", "shell": "cmd" } ], diff --git a/mkt-int.bat b/mkt-int.bat index 313d4ff..bfadb14 100644 --- a/mkt-int.bat +++ b/mkt-int.bat @@ -19,6 +19,12 @@ set x=-x set args=%args:~3% shift :nocross +if not "%1" == "-msys" goto nomsys +msys2 mkt-int.sh %cxx% %x% cmd /c do-cl.bat -DWINVER=0x0602 -D_WIN32_WINNT=0x0602 -DNTDDI_VERSION=NTDDI_WIN8 /Wall -D__STDC_WANT_SECURE_LIB__=1 /wd4514 /wd5045 -DMBSDINT_H_WANT_PTR_IN_SIZET -DMBSDINT_H_WANT_INT32 -DMBSDINT_H_WANT_LRG64 -DMBSDINT_H_WANT_SAFEC %args% /nologo +if errorlevel 1 goto doerror +del do-cl.bat +exit /b 0 +:nomsys wsl /bin/sh mkt-int.sh %cxx% %x% "$(wslpath "%COMSPEC%")" /c do-cl.bat -DWINVER=0x0602 -D_WIN32_WINNT=0x0602 -DNTDDI_VERSION=NTDDI_WIN8 /Wall -D__STDC_WANT_SECURE_LIB__=1 /wd4514 /wd5045 -DMBSDINT_H_WANT_PTR_IN_SIZET -DMBSDINT_H_WANT_INT32 -DMBSDINT_H_WANT_LRG64 -DMBSDINT_H_WANT_SAFEC %args% /nologo if errorlevel 1 goto doerror del do-cl.bat @@ -32,5 +38,6 @@ echo Call find-cl.bat first, with e.g. x86 or amd64 as parameter. echo Afterwards, run mkt-int.bat with an optional first parameter echo of -x when cross-compiling plus optional CL.EXE arguments. echo Pass an initial -cxx before everything else to build as C++ not C. +echo After an optional -cxx and -x pass -msys should WSL be missing. echo. exit /b 1 From a2b3760680a4b833fb82790d2de31ddccba3035b Mon Sep 17 00:00:00 2001 From: mirabilos Date: Tue, 10 Jun 2025 00:42:02 +0200 Subject: [PATCH 24/27] =?UTF-8?q?avoid=20MSYS2=20converting=20single=20sla?= =?UTF-8?q?shes=20to=20backslashes=20(WTF=E2=80=BD)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mkt-int.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/mkt-int.bat b/mkt-int.bat index bfadb14..ab4ef87 100644 --- a/mkt-int.bat +++ b/mkt-int.bat @@ -20,6 +20,7 @@ set args=%args:~3% shift :nocross if not "%1" == "-msys" goto nomsys +set MSYS_NO_PATHCONV=1 msys2 mkt-int.sh %cxx% %x% cmd /c do-cl.bat -DWINVER=0x0602 -D_WIN32_WINNT=0x0602 -DNTDDI_VERSION=NTDDI_WIN8 /Wall -D__STDC_WANT_SECURE_LIB__=1 /wd4514 /wd5045 -DMBSDINT_H_WANT_PTR_IN_SIZET -DMBSDINT_H_WANT_INT32 -DMBSDINT_H_WANT_LRG64 -DMBSDINT_H_WANT_SAFEC %args% /nologo if errorlevel 1 goto doerror del do-cl.bat From f1633ac4e3ffcfa8fd1f5ae3cd89728afb9a7924 Mon Sep 17 00:00:00 2001 From: mirabilos Date: Tue, 10 Jun 2025 00:53:23 +0200 Subject: [PATCH 25/27] =?UTF-8?q?=F0=9F=90=88=E2=80=8D=E2=AC=9B?= =?UTF-8?q?=F0=9F=A4=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mkt-int.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/mkt-int.bat b/mkt-int.bat index ab4ef87..e230880 100644 --- a/mkt-int.bat +++ b/mkt-int.bat @@ -21,6 +21,7 @@ shift :nocross if not "%1" == "-msys" goto nomsys set MSYS_NO_PATHCONV=1 +set args=%args:~6% msys2 mkt-int.sh %cxx% %x% cmd /c do-cl.bat -DWINVER=0x0602 -D_WIN32_WINNT=0x0602 -DNTDDI_VERSION=NTDDI_WIN8 /Wall -D__STDC_WANT_SECURE_LIB__=1 /wd4514 /wd5045 -DMBSDINT_H_WANT_PTR_IN_SIZET -DMBSDINT_H_WANT_INT32 -DMBSDINT_H_WANT_LRG64 -DMBSDINT_H_WANT_SAFEC %args% /nologo if errorlevel 1 goto doerror del do-cl.bat From 1203190d0ab029cfe35dd9fe6847e4859fa8f029 Mon Sep 17 00:00:00 2001 From: mirabilos Date: Tue, 10 Jun 2025 00:54:57 +0200 Subject: [PATCH 26/27] =?UTF-8?q?=F0=9F=AA=9F=F0=9F=A4=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mkt-int.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkt-int.bat b/mkt-int.bat index e230880..7a14698 100644 --- a/mkt-int.bat +++ b/mkt-int.bat @@ -22,12 +22,12 @@ shift if not "%1" == "-msys" goto nomsys set MSYS_NO_PATHCONV=1 set args=%args:~6% -msys2 mkt-int.sh %cxx% %x% cmd /c do-cl.bat -DWINVER=0x0602 -D_WIN32_WINNT=0x0602 -DNTDDI_VERSION=NTDDI_WIN8 /Wall -D__STDC_WANT_SECURE_LIB__=1 /wd4514 /wd5045 -DMBSDINT_H_WANT_PTR_IN_SIZET -DMBSDINT_H_WANT_INT32 -DMBSDINT_H_WANT_LRG64 -DMBSDINT_H_WANT_SAFEC %args% /nologo +msys2 mkt-int.sh %cxx% %x% cmd /c do-cl.bat -DWINVER=0x0602 -D_WIN32_WINNT=0x0602 -DNTDDI_VERSION=NTDDI_WIN8 /Wall -D__STDC_WANT_SECURE_LIB__=1 /wd4514 /wd4746 /wd5045 -DMBSDINT_H_WANT_PTR_IN_SIZET -DMBSDINT_H_WANT_INT32 -DMBSDINT_H_WANT_LRG64 -DMBSDINT_H_WANT_SAFEC %args% /nologo if errorlevel 1 goto doerror del do-cl.bat exit /b 0 :nomsys -wsl /bin/sh mkt-int.sh %cxx% %x% "$(wslpath "%COMSPEC%")" /c do-cl.bat -DWINVER=0x0602 -D_WIN32_WINNT=0x0602 -DNTDDI_VERSION=NTDDI_WIN8 /Wall -D__STDC_WANT_SECURE_LIB__=1 /wd4514 /wd5045 -DMBSDINT_H_WANT_PTR_IN_SIZET -DMBSDINT_H_WANT_INT32 -DMBSDINT_H_WANT_LRG64 -DMBSDINT_H_WANT_SAFEC %args% /nologo +wsl /bin/sh mkt-int.sh %cxx% %x% "$(wslpath "%COMSPEC%")" /c do-cl.bat -DWINVER=0x0602 -D_WIN32_WINNT=0x0602 -DNTDDI_VERSION=NTDDI_WIN8 /Wall -D__STDC_WANT_SECURE_LIB__=1 /wd4514 /wd4746 /wd5045 -DMBSDINT_H_WANT_PTR_IN_SIZET -DMBSDINT_H_WANT_INT32 -DMBSDINT_H_WANT_LRG64 -DMBSDINT_H_WANT_SAFEC %args% /nologo if errorlevel 1 goto doerror del do-cl.bat exit /b 0 From ca099371189416a62d4933e52c72d09a182a6f4a Mon Sep 17 00:00:00 2001 From: mirabilos Date: Tue, 10 Jun 2025 01:02:24 +0200 Subject: [PATCH 27/27] Revert "untest again" This reverts commit f7fc1361e418f4bcf7f7230581b03297542d5ccd. --- .github/workflows/winarm-build.yml | 1 - .github/workflows/winarm-tmate.yml | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/winarm-build.yml b/.github/workflows/winarm-build.yml index 69e0dd3..9abb4b8 100644 --- a/.github/workflows/winarm-build.yml +++ b/.github/workflows/winarm-build.yml @@ -45,7 +45,6 @@ }, "name": "Windows/ARM", "on": { - "pull_request": null, "workflow_dispatch": null } } diff --git a/.github/workflows/winarm-tmate.yml b/.github/workflows/winarm-tmate.yml index 867c629..a1fd57f 100644 --- a/.github/workflows/winarm-tmate.yml +++ b/.github/workflows/winarm-tmate.yml @@ -28,6 +28,7 @@ }, "name": "action-tmate windows-11-arm", "on": { + "pull_request": null, "workflow_dispatch": null } }