From 6f6d6cc0fd780da219a003aac82dcdde2c96ebf3 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Mon, 12 Dec 2022 12:36:48 -0500 Subject: [PATCH 01/10] chore: add Windows ARM support --- .github/workflows/build.yml | 2 ++ .gitignore | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bb7098a..5d90dff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,6 +42,8 @@ jobs: arch: "s390x" - os: windows-2019 arch: "AMD64" + - os: windows-2019 + arch: "ARM64" - os: windows-2019 arch: "x86" - os: macos-11 diff --git a/.gitignore b/.gitignore index 3178d97..4e3ddd2 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,4 @@ docs/_build # IDE junk .idea/* *.swp +*~ From cb5d7b61507fc7fc6918aa287bcebfe67a7043d1 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 15 Dec 2022 16:03:00 -0500 Subject: [PATCH 02/10] WIP: try scikit-build PR --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b81dab6..db3d27d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [build-system] requires = [ "setuptools>=42", - "scikit-build>=0.12", + "scikit-build @ git+https://github.com/scikit-build/scikit-build@henryiii/fix/winarm", ] build-backend = "setuptools.build_meta" From 36c04a765e3779cb45e53aba1ce4de6e1f9c98b5 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 15 Dec 2022 16:22:50 -0500 Subject: [PATCH 03/10] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d90dff..aa1f7fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,7 +42,7 @@ jobs: arch: "s390x" - os: windows-2019 arch: "AMD64" - - os: windows-2019 + - os: windows-2022 arch: "ARM64" - os: windows-2019 arch: "x86" From 61546e39f6a037da23b01cdaf92022151df9df31 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 15 Dec 2022 16:35:39 -0500 Subject: [PATCH 04/10] fix: avoid strip when cross-compiling --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 615447d..cd6f7b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,7 +121,8 @@ set(ninja_executable ${Ninja_BINARY_DIR}/ninja${CMAKE_EXECUTABLE_SUFFIX}) set(NINJA_BUILD_LAST_STEP "build") find_program(STRIP_EXECUTABLE strip) -if(STRIP_EXECUTABLE) +# This should not be stripped if cross-compiling on Windows +if(STRIP_EXECUTABLE AND NOT DEFINED $ENV{DIST_EXTRA_CONFIG}) ExternalProject_Add_Step(build_ninja strip_executables DEPENDEES ${NINJA_BUILD_LAST_STEP} COMMENT "Stripping CMake executables" From 7599d2406709df43281e6e42715b59bef786c31e Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 15 Dec 2022 16:44:27 -0500 Subject: [PATCH 05/10] Update CMakeLists.txt --- CMakeLists.txt | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd6f7b7..dbc8a74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,16 +120,18 @@ ExternalProject_add(build_ninja set(ninja_executable ${Ninja_BINARY_DIR}/ninja${CMAKE_EXECUTABLE_SUFFIX}) set(NINJA_BUILD_LAST_STEP "build") -find_program(STRIP_EXECUTABLE strip) # This should not be stripped if cross-compiling on Windows -if(STRIP_EXECUTABLE AND NOT DEFINED $ENV{DIST_EXTRA_CONFIG}) - ExternalProject_Add_Step(build_ninja strip_executables - DEPENDEES ${NINJA_BUILD_LAST_STEP} - COMMENT "Stripping CMake executables" - COMMAND ${STRIP_EXECUTABLE} ${ninja_executable} - USES_TERMINAL 1 - ) - set(NINJA_BUILD_LAST_STEP "strip_executables") +if(NOT DEFINED ENV{DIST_EXTRA_CONFIG}) + find_program(STRIP_EXECUTABLE strip) + if(STRIP_EXECUTABLE) + ExternalProject_Add_Step(build_ninja strip_executables + DEPENDEES ${NINJA_BUILD_LAST_STEP} + COMMENT "Stripping CMake executables" + COMMAND ${STRIP_EXECUTABLE} ${ninja_executable} + USES_TERMINAL 1 + ) + set(NINJA_BUILD_LAST_STEP "strip_executables") + endif() endif() if(RUN_NINJA_TEST) From 39584f9d2c39f476f6874f7a09cb694bc8de6ee7 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 15 Dec 2022 16:52:52 -0500 Subject: [PATCH 06/10] fix: turn off testing when cross compiling --- CMakeLists.txt | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dbc8a74..d0ad97f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,8 +120,8 @@ ExternalProject_add(build_ninja set(ninja_executable ${Ninja_BINARY_DIR}/ninja${CMAKE_EXECUTABLE_SUFFIX}) set(NINJA_BUILD_LAST_STEP "build") -# This should not be stripped if cross-compiling on Windows -if(NOT DEFINED ENV{DIST_EXTRA_CONFIG}) +# This should not be stripped or tested if cross-compiling on Windows +if(CMAKE_CROSS_COMPILE OR NOT DEFINED ENV{DIST_EXTRA_CONFIG}) find_program(STRIP_EXECUTABLE strip) if(STRIP_EXECUTABLE) ExternalProject_Add_Step(build_ninja strip_executables @@ -132,17 +132,17 @@ if(NOT DEFINED ENV{DIST_EXTRA_CONFIG}) ) set(NINJA_BUILD_LAST_STEP "strip_executables") endif() -endif() -if(RUN_NINJA_TEST) - ExternalProject_Add_Step(build_ninja run_ninja_test_suite - DEPENDEES ${NINJA_BUILD_LAST_STEP} - COMMENT "Running Ninja test suite" - COMMAND ${Ninja_BINARY_DIR}/ninja_test${CMAKE_EXECUTABLE_SUFFIX} - WORKING_DIRECTORY ${Ninja_BINARY_DIR} - USES_TERMINAL 1 - ) - set(NINJA_BUILD_LAST_STEP "run_ninja_test_suite") + if(RUN_NINJA_TEST) + ExternalProject_Add_Step(build_ninja run_ninja_test_suite + DEPENDEES ${NINJA_BUILD_LAST_STEP} + COMMENT "Running Ninja test suite" + COMMAND ${Ninja_BINARY_DIR}/ninja_test${CMAKE_EXECUTABLE_SUFFIX} + WORKING_DIRECTORY ${Ninja_BINARY_DIR} + USES_TERMINAL 1 + ) + set(NINJA_BUILD_LAST_STEP "run_ninja_test_suite") + endif() endif() install(FILES ${Ninja_SOURCE_DIR}/misc/ninja_syntax.py DESTINATION src/ninja) From 1632a6b3ed280f2f7e19239535c9faca168ce670 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 15 Dec 2022 17:08:41 -0500 Subject: [PATCH 07/10] chore: reduce warnings --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index db3d27d..f0eb67b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,7 @@ before-build = "pip install -r requirements-repair.txt" repair-wheel-command = "python scripts/repair_wheel.py -w {dest_dir} {wheel}" test-extras = "test" test-command = "pytest {project}/tests" +test-skip: ["*-win_arm64", "*-macosx_universal2:arm64"] [[tool.cibuildwheel.overrides]] select = "*-manylinux_{x86_64,i686}" From d1e01d6f6ab1cb8ab2d3743d11481335dee3e3d2 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 15 Dec 2022 17:09:50 -0500 Subject: [PATCH 08/10] Apply suggestions from code review --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f0eb67b..4e3cc6a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ before-build = "pip install -r requirements-repair.txt" repair-wheel-command = "python scripts/repair_wheel.py -w {dest_dir} {wheel}" test-extras = "test" test-command = "pytest {project}/tests" -test-skip: ["*-win_arm64", "*-macosx_universal2:arm64"] +test-skip = ["*-win_arm64", "*-macosx_universal2:arm64"] [[tool.cibuildwheel.overrides]] select = "*-manylinux_{x86_64,i686}" From c7c6479839e3cdcfcd6e18c37ddd035d59def5b5 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Fri, 16 Dec 2022 17:22:01 -0500 Subject: [PATCH 09/10] Update pyproject.toml --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4e3cc6a..e5e05cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [build-system] requires = [ - "setuptools>=42", - "scikit-build @ git+https://github.com/scikit-build/scikit-build@henryiii/fix/winarm", + "setuptools >=42", + "scikit-build >=0.16.4", ] build-backend = "setuptools.build_meta" From b458df53063643903692e2207d6e63b1cf989458 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Fri, 16 Dec 2022 21:36:12 -0500 Subject: [PATCH 10/10] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e5e05cc..ba357dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [build-system] requires = [ "setuptools >=42", - "scikit-build >=0.16.4", + "scikit-build", ] build-backend = "setuptools.build_meta"