From 101abb3004516f396add3be90676cd83cf518641 Mon Sep 17 00:00:00 2001 From: Andreas T Jonsson Date: Thu, 25 Apr 2024 12:46:55 +0200 Subject: [PATCH 01/10] Simple CI setup for NetBSD --- .github/workflows/ci.yml | 22 ++++++++++++++++++ tests/core/Makefile | 48 +++++++++++++++++++++------------------- tests/internal/Makefile | 4 +++- 3 files changed, 50 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0cbe8ad23..b34cc6a78 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,28 @@ name: CI on: [push, pull_request, workflow_dispatch] jobs: + build_netbsd: + name: NetBSD Build, Check, and Test + runs-on: ubuntu-latest + env: + PKGSRC_BRANCH: 2024Q1 + steps: + - uses: actions/checkout@v4 + - name: Build and Test + id: netbsd + uses: vmactions/netbsd-vm@v1 + with: + release: "10.0" + envs: PKGSRC_BRANCH + usesh: true + copyback: false + prepare: | + export PKG_PATH="https://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r | cut -d_ -f1)_${PKGSRC_BRANCH}/All" /usr/sbin/pkg_add pkgin + pkgin -y in llvm clang gmake git bash + run: | + gmake release + (cd tests/core; gmake) + (cd tests/internal; gmake) build_linux: name: Ubuntu Build, Check, and Test runs-on: ubuntu-latest diff --git a/tests/core/Makefile b/tests/core/Makefile index dcb3c9906..d702c4e1d 100644 --- a/tests/core/Makefile +++ b/tests/core/Makefile @@ -3,29 +3,31 @@ PYTHON=$(shell which python3) COMMON=-vet -strict-style COLLECTION=-collection:tests=.. -all: c_libc_test \ - compress_test \ - container_test \ - crypto_test \ - download_test_assets \ - encoding_test \ - filepath_test \ - fmt_test \ - hash_test \ - i18n_test \ - image_test \ - linalg_glsl_math_test \ - match_test \ - math_test \ - net_test \ - noise_test \ - os_exit_test \ - reflect_test \ - slice_test \ - strings_test \ - thread_test \ - runtime_test \ - time_test +all: all_bsd \ + net_test + +all_bsd: c_libc_test \ + compress_test \ + container_test \ + crypto_test \ + download_test_assets \ + encoding_test \ + filepath_test \ + fmt_test \ + hash_test \ + i18n_test \ + image_test \ + linalg_glsl_math_test \ + match_test \ + math_test \ + noise_test \ + os_exit_test \ + reflect_test \ + slice_test \ + strings_test \ + thread_test \ + runtime_test \ + time_test download_test_assets: $(PYTHON) download_assets.py diff --git a/tests/internal/Makefile b/tests/internal/Makefile index c5c612cdd..e892c3145 100644 --- a/tests/internal/Makefile +++ b/tests/internal/Makefile @@ -1,6 +1,8 @@ ODIN=../../odin -all: rtti_test map_test pow_test 128_test asan_test +all: all_bsd asan_test + +all_bsd: rtti_test map_test pow_test 128_test rtti_test: $(ODIN) run test_rtti.odin -file -vet -strict-style -o:minimal From 2b8836e29abaf2f7a9762db6ce146cd46548ba92 Mon Sep 17 00:00:00 2001 From: Andreas T Jonsson Date: Thu, 25 Apr 2024 13:03:19 +0200 Subject: [PATCH 02/10] Fixed broken export --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b34cc6a78..975015dc1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,12 +18,15 @@ jobs: usesh: true copyback: false prepare: | - export PKG_PATH="https://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r | cut -d_ -f1)_${PKGSRC_BRANCH}/All" /usr/sbin/pkg_add pkgin - pkgin -y in llvm clang gmake git bash + PKG_PATH="https://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r | cut -d_ -f1)_${PKGSRC_BRANCH}/All" /usr/sbin/pkg_add pkgin + pkgin -y in llvm clang gmake git bash python312 + ln -s /usr/pkg/bin/python3.12 /usr/bin/python3 + ln -s /usr/pkg/bin/bash /bin/bash run: | gmake release (cd tests/core; gmake) (cd tests/internal; gmake) + (cd tests/issues; ./run.sh) build_linux: name: Ubuntu Build, Check, and Test runs-on: ubuntu-latest From 4c9c0899a9243ce3d44b28691c3e54771100adf8 Mon Sep 17 00:00:00 2001 From: Andreas T Jonsson Date: Thu, 25 Apr 2024 13:14:09 +0200 Subject: [PATCH 03/10] Added git safe directory config --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 975015dc1..500fb5c33 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,7 @@ jobs: prepare: | PKG_PATH="https://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r | cut -d_ -f1)_${PKGSRC_BRANCH}/All" /usr/sbin/pkg_add pkgin pkgin -y in llvm clang gmake git bash python312 + git config --global --add safe.directory $(pwd) ln -s /usr/pkg/bin/python3.12 /usr/bin/python3 ln -s /usr/pkg/bin/bash /bin/bash run: | From f53abf736bbd36842cf56443c09eca55274e34fb Mon Sep 17 00:00:00 2001 From: Andreas T Jonsson Date: Thu, 25 Apr 2024 13:25:46 +0200 Subject: [PATCH 04/10] Print the path of the git safe directory --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 500fb5c33..f7a1da659 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,9 @@ jobs: PKG_PATH="https://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r | cut -d_ -f1)_${PKGSRC_BRANCH}/All" /usr/sbin/pkg_add pkgin pkgin -y in llvm clang gmake git bash python312 git config --global --add safe.directory $(pwd) + echo XXXXXXXXXXXXXXXXXXXXXXXX + echo $(pwd) + echo XXXXXXXXXXXXXXXXXXXXXXXX ln -s /usr/pkg/bin/python3.12 /usr/bin/python3 ln -s /usr/pkg/bin/bash /bin/bash run: | From b6eaadb9a8fc22eab36c4b12f34e4bac8cea21a7 Mon Sep 17 00:00:00 2001 From: Andreas T Jonsson Date: Thu, 25 Apr 2024 13:31:33 +0200 Subject: [PATCH 05/10] Fixed invalid git path --- .github/workflows/ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7a1da659..0e490d188 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,13 +20,10 @@ jobs: prepare: | PKG_PATH="https://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r | cut -d_ -f1)_${PKGSRC_BRANCH}/All" /usr/sbin/pkg_add pkgin pkgin -y in llvm clang gmake git bash python312 - git config --global --add safe.directory $(pwd) - echo XXXXXXXXXXXXXXXXXXXXXXXX - echo $(pwd) - echo XXXXXXXXXXXXXXXXXXXXXXXX ln -s /usr/pkg/bin/python3.12 /usr/bin/python3 ln -s /usr/pkg/bin/bash /bin/bash run: | + git config --global --add safe.directory $(pwd) gmake release (cd tests/core; gmake) (cd tests/internal; gmake) From c1ff7894dfcc1edfd420a10ab81eef00f2e36b10 Mon Sep 17 00:00:00 2001 From: Andreas T Jonsson Date: Thu, 25 Apr 2024 13:47:55 +0200 Subject: [PATCH 06/10] Should only run BSD tests --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e490d188..1c43fca2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,8 +25,8 @@ jobs: run: | git config --global --add safe.directory $(pwd) gmake release - (cd tests/core; gmake) - (cd tests/internal; gmake) + (cd tests/core; gmake all_bsd) + (cd tests/internal; gmake all_bsd) (cd tests/issues; ./run.sh) build_linux: name: Ubuntu Build, Check, and Test From 9de92235785db2b03e8e1a46c49035486148fcf3 Mon Sep 17 00:00:00 2001 From: Andreas T Jonsson Date: Thu, 2 May 2024 14:38:54 +0200 Subject: [PATCH 07/10] Use custom llvm binaries --- .github/workflows/ci.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07e89f3fb..2a5910b88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,8 +9,8 @@ jobs: PKGSRC_BRANCH: 2024Q1 steps: - uses: actions/checkout@v4 - - name: Build and Test - id: netbsd + - name: Build, Check, and Test + timeout-minutes: 25 uses: vmactions/netbsd-vm@v1 with: release: "10.0" @@ -19,12 +19,17 @@ jobs: copyback: false prepare: | PKG_PATH="https://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r | cut -d_ -f1)_${PKGSRC_BRANCH}/All" /usr/sbin/pkg_add pkgin - pkgin -y in llvm clang gmake git bash python312 - ln -s /usr/pkg/bin/python3.12 /usr/bin/python3 + pkgin -y in gmake git bash python311 + pkgin -y in libxml2 perl5 zstd + /usr/sbin/pkg_add https://github.com/andreas-jonsson/llvm17-netbsd-bin/releases/download/pkgsrc-current/llvm-17.0.6.tgz + ln -s /usr/pkg/bin/python3.11 /usr/bin/python3 ln -s /usr/pkg/bin/bash /bin/bash run: | git config --global --add safe.directory $(pwd) gmake release + ./odin version + ./odin report + ./odin check examples/demo -vet (cd tests/core; gmake all_bsd) (cd tests/internal; gmake all_bsd) (cd tests/issues; ./run.sh) From ecaa26710b3d4be658c48d1dde3803258ee442b0 Mon Sep 17 00:00:00 2001 From: Andreas T Jonsson Date: Thu, 2 May 2024 14:50:13 +0200 Subject: [PATCH 08/10] Fixed invalid package name --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a5910b88..e8a91b1d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: prepare: | PKG_PATH="https://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r | cut -d_ -f1)_${PKGSRC_BRANCH}/All" /usr/sbin/pkg_add pkgin pkgin -y in gmake git bash python311 - pkgin -y in libxml2 perl5 zstd + pkgin -y in libxml2 perl zstd /usr/sbin/pkg_add https://github.com/andreas-jonsson/llvm17-netbsd-bin/releases/download/pkgsrc-current/llvm-17.0.6.tgz ln -s /usr/pkg/bin/python3.11 /usr/bin/python3 ln -s /usr/pkg/bin/bash /bin/bash From 1d3845abf55325d5a973a618b95ebc1a18da3d5e Mon Sep 17 00:00:00 2001 From: Andreas T Jonsson Date: Thu, 2 May 2024 16:52:46 +0200 Subject: [PATCH 09/10] Added prebuilt clang17 --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8a91b1d6..2d3424128 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,7 @@ jobs: pkgin -y in gmake git bash python311 pkgin -y in libxml2 perl zstd /usr/sbin/pkg_add https://github.com/andreas-jonsson/llvm17-netbsd-bin/releases/download/pkgsrc-current/llvm-17.0.6.tgz + /usr/sbin/pkg_add https://github.com/andreas-jonsson/llvm17-netbsd-bin/releases/download/pkgsrc-current/clang-17.0.6.tgz ln -s /usr/pkg/bin/python3.11 /usr/bin/python3 ln -s /usr/pkg/bin/bash /bin/bash run: | From 5541f602335a74c357046a603119c6b49b63e25d Mon Sep 17 00:00:00 2001 From: Andreas T Jonsson Date: Mon, 13 May 2024 10:02:48 +0200 Subject: [PATCH 10/10] Check examples/all on NetBSD --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f55c8a861..ffb2077d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: gmake release ./odin version ./odin report - ./odin check examples/demo -vet + ./odin check examples/all -vet -strict-style -target:netbsd_amd64 (cd tests/core; gmake all_bsd) (cd tests/internal; gmake all_bsd) (cd tests/issues; ./run.sh)