diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dd714e801..c57f2d539 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -195,6 +195,7 @@ jobs: matrix: os: - ubuntu-24.04 # https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md + - ubuntu-24.04-arm # https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Arm64-Readme.md - macos-14 # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md - windows-2022 # https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md python-version: @@ -223,6 +224,19 @@ jobs: os: windows-2022 cibuildwheel: "cp312" + # avoid unnecessary use of arm resources + - is-full-run: false + os: ubuntu-24.04-arm + cibuildwheel: "cp310" + + - is-full-run: false + os: ubuntu-24.04-arm + cibuildwheel: "cp311" + + - is-full-run: false + os: ubuntu-24.04-arm + cibuildwheel: "cp312" + # avoid unnecessary use of mac resources - is-full-run: false os: macos-14 @@ -412,6 +426,7 @@ jobs: matrix: os: - ubuntu-24.04 + - ubuntu-24.04-arm - macos-14 - windows-2022 python-version: @@ -440,6 +455,19 @@ jobs: os: windows-2022 python-version: "3.12" + # avoid unnecessary use of arm resources + - is-full-run: false + os: ubuntu-24.04-arm + python-version: "3.10" + + - is-full-run: false + os: ubuntu-24.04-arm + python-version: "3.11" + + - is-full-run: false + os: ubuntu-24.04-arm + python-version: "3.12" + # avoid unnecessary use of mac resources - is-full-run: false os: macos-14 diff --git a/cpp/csp/python/NumpyInputAdapter.h b/cpp/csp/python/NumpyInputAdapter.h index b7e87cefa..d1332f8c9 100644 --- a/cpp/csp/python/NumpyInputAdapter.h +++ b/cpp/csp/python/NumpyInputAdapter.h @@ -250,13 +250,13 @@ void NumpyInputAdapter::setValue( int64_t & value, void * data ) { case NPY_BYTELTR: { - const char * const val = (const char *) data; + const int8_t * const val = (const int8_t *) data; value = static_cast(*val); break; } case NPY_UBYTELTR: { - const unsigned char * const val = (const unsigned char *) data; + const uint8_t * const val = (const uint8_t *) data; value = static_cast(*val); break; } diff --git a/csp/tests/test_build.py b/csp/tests/test_build.py index 1ece657aa..bf810e7b8 100644 --- a/csp/tests/test_build.py +++ b/csp/tests/test_build.py @@ -1,7 +1,34 @@ +import runpy +import subprocess +import sys import unittest +from pathlib import Path +from types import ModuleType +from unittest.mock import Mock, patch class TestBuild(unittest.TestCase): + def test_arm64_linux_uses_arm64_vcpkg_triplet(self): + skbuild = ModuleType("skbuild") + skbuild.setup = Mock() + setup_path = Path(__file__).parents[2] / "setup.py" + + with ( + patch.dict(sys.modules, {"skbuild": skbuild}), + patch.object(sys, "platform", "linux"), + patch("platform.machine", return_value="aarch64"), + patch("platform.system", return_value="Linux"), + patch.object( + subprocess, + "check_output", + return_value=b"9c5c2a0ab75aff5bcd08142525f6ff7f6f7ddeee\n", + ), + ): + runpy.run_path(setup_path, run_name="csp_setup_test") + + cmake_args = skbuild.setup.call_args.kwargs["cmake_args"] + self.assertIn("-DVCPKG_TARGET_TRIPLET=arm64-linux", cmake_args) + def test_init_helpers(self): """was a build issue where InitHelpers ran on a single instance across all libraries linking _cspimpl""" # Take a sample of libraries diff --git a/setup.py b/setup.py index 47564c353..f88428635 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ ) if sys.platform == "linux": - VCPKG_TRIPLET = "x64-linux" + VCPKG_TRIPLET = "arm64-linux" if platform.machine().lower() in ("aarch64", "arm64") else "x64-linux" elif sys.platform == "win32": VCPKG_TRIPLET = "x64-windows-static-md" else: