diff --git a/.github/workflows/tests_nix.yml b/.github/workflows/tests_nix.yml index 6763053..dc654b0 100644 --- a/.github/workflows/tests_nix.yml +++ b/.github/workflows/tests_nix.yml @@ -9,7 +9,12 @@ concurrency: jobs: build-and-test: - runs-on: [ubuntu-22.04] + strategy: + fail-fast: false + matrix: + # macos-11 uses x86-64 machine, macos-14 uses aarch64 + os: [ macos-11, macos-14, ubuntu-22.04 ] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -22,7 +27,10 @@ jobs: with: name: enigmaticsunrise authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + + - name: print architecture + run: uname -m # the result folder is produced by the previous step - name: Run all tests - run: nix develop -c sh -c 'export ROC=roc && ./ci_scripts/all_tests.sh' \ No newline at end of file + run: nix develop -c sh -c 'export ROC=roc && ./ci_scripts/all_tests.sh' diff --git a/ci_scripts/all_tests.sh b/ci_scripts/all_tests.sh index fa7b403..269c67c 100755 --- a/ci_scripts/all_tests.sh +++ b/ci_scripts/all_tests.sh @@ -69,9 +69,12 @@ expect ci_scripts/expect_scripts/MultipleRocFiles.exp $ROC build ./examples/EncodeDecode/main.roc expect ci_scripts/expect_scripts/EncodeDecode.exp -$ROC build --lib ./examples/GoPlatform/main.roc --output examples/GoPlatform/platform/libapp.so -go build -C examples/GoPlatform/platform -buildmode=pie -o dynhost -$ROC preprocess-host ./examples/GoPlatform/main.roc +#$ROC build --lib ./examples/GoPlatform/main.roc --output examples/GoPlatform/platform/libapp.so +#go build -C examples/GoPlatform/platform -buildmode=pie -o dynhost +#$ROC preprocess-host ./examples/GoPlatform/main.roc +go build -C examples/GoPlatform/platform -buildmode=c-archive -o libhost.a +cp examples/GoPlatform/platform/libhost.a examples/GoPlatform/platform/macos-arm64.a + $ROC build --prebuilt-platform ./examples/GoPlatform/main.roc os_info=$(lsb_release -a 2>/dev/null) diff --git a/ci_scripts/expect_scripts/DotNetPlatform.exp b/ci_scripts/expect_scripts/DotNetPlatform.exp index bb7e237..9c4b44d 100644 --- a/ci_scripts/expect_scripts/DotNetPlatform.exp +++ b/ci_scripts/expect_scripts/DotNetPlatform.exp @@ -1,7 +1,7 @@ #!/usr/bin/expect # uncomment line below for debugging -# exp_internal 1 +exp_internal 1 set timeout 25 diff --git a/examples/GoPlatform/platform/main.go b/examples/GoPlatform/platform/main.go index 7b2555a..95bce4f 100644 --- a/examples/GoPlatform/platform/main.go +++ b/examples/GoPlatform/platform/main.go @@ -1,7 +1,7 @@ package main /* -#cgo LDFLAGS: -L. -lapp +#cgo CFLAGS: -Wno-main-return-type #include "./host.h" */ import "C" @@ -12,6 +12,7 @@ import ( "unsafe" ) +// export main func main() { var str C.struct_RocStr C.roc__mainForHost_1_exposed_generic(&str) diff --git a/flake.lock b/flake.lock index d3f8d2d..5ee9fbd 100644 --- a/flake.lock +++ b/flake.lock @@ -120,11 +120,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1714267049, - "narHash": "sha256-8RxtfW9vnFDy5nTGTh0O4afjG6d9GYtsJJDGClwOBHs=", + "lastModified": 1714325130, + "narHash": "sha256-bLchK1KuwEX5Xm3D5NvmE/7UemqT66KqqBFEglFZdtQ=", "owner": "roc-lang", "repo": "roc", - "rev": "759e26ea13980f209e20507d493d61f040705ea8", + "rev": "e424f4bacca17b5e1c2df8ad38d8498c0367d0b0", "type": "github" }, "original": { @@ -177,11 +177,11 @@ ] }, "locked": { - "lastModified": 1714270637, - "narHash": "sha256-sq/0YEupY9yoRpg9ft8r2sjoRo84MQipionTuk4w1YI=", + "lastModified": 1714356894, + "narHash": "sha256-W6Mss7AG6bnFT1BqRApHXvLXBrFOu7V0+EUe9iML30s=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "44f8738f4b9805f7c60118c48f85da835839311a", + "rev": "d9b44509b4064f0a3fc9c7c92a603861f52fbedc", "type": "github" }, "original": {