From 3d1b6a6317f4d6df8e8cd9c95b6a749c05b4f229 Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Wed, 23 Oct 2024 13:45:01 +1300 Subject: [PATCH 1/5] Update cibuildwheel to version 2.21.3 adjusting as required. --- .github/workflows/deploy-on-release.yml | 32 +++++++++++++------------ 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/deploy-on-release.yml b/.github/workflows/deploy-on-release.yml index b872ba3f5d..3ad3808861 100644 --- a/.github/workflows/deploy-on-release.yml +++ b/.github/workflows/deploy-on-release.yml @@ -278,7 +278,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-12, ubuntu-20.04, windows-2019] + os: [macos-13, ubuntu-20.04, windows-2019] py: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] include: - name: 'Windows' @@ -286,9 +286,11 @@ jobs: - name: 'Linux' os: ubuntu-20.04 - name: 'macOS' - os: macos-12 + os: macos-13 exclude: - - os: macos-12 + - os: macos-13 + py: '3.7' + - os: ubuntu-20.04 py: '3.7' steps: @@ -313,29 +315,27 @@ jobs: if [[ "${{ matrix.py }}" == "3.8" ]]; then echo "Setting macos_archs as: macos_archs='x86_64'" echo "macos_archs=x86_64" >> $GITHUB_OUTPUT + echo "macos_deployment_target=10.15" >> $GITHUB_OUTPUT else echo "Setting macos_archs as: macos_archs='x86_64 arm64'" - echo 'MACOS_ARCHS=x86_64 arm64' >> $GITHUB_OUTPUT + echo 'macos_archs=x86_64 arm64' >> $GITHUB_OUTPUT + echo "macos_deployment_target=11.0" >> $GITHUB_OUTPUT fi else echo "Setting macos_archs as: macos_archs='x86_64'" echo "macos_archs=x86_64" >> $GITHUB_OUTPUT fi - - name: Configure MSVC + - name: Configure MSVC (Windows) if: runner.os == 'Windows' uses: ilammy/msvc-dev-cmd@v1 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.11.2 + - name: Install SWIG (macOS) + if: runner.os == 'macOS' + run: brew install swig - name: Build wheels - run: python -m cibuildwheel --output-dir wheelhouse src/bindings/python/ + uses: pypa/cibuildwheel@v2.21.3 env: #CIBW_BUILD_VERBOSITY: 1 CIBW_ARCHS: auto64 @@ -346,11 +346,13 @@ jobs: CIBW_BEFORE_ALL_WINDOWS: cd src/bindings/python && cmake -S wheel_dependencies -B build-wheel_dependencies -G Ninja && cd build-wheel_dependencies && ninja CIBW_ENVIRONMENT: LIBCELLML_VERSION_TAG=${{ steps.setup.outputs.tag }} CIBW_ENVIRONMENT_MACOS: > - MACOSX_DEPLOYMENT_TARGET=10.15 - LIBCELLML_VERSION_TAG=${{ steps.setup.outputs.tag }} + MACOSX_DEPLOYMENT_TARGET=${{ steps.setup.outputs.macos_deployment_target }} CIBW_REPAIR_WHEEL_COMMAND_MACOS: "" CIBW_BEFORE_BUILD_LINUX: pip install renamewheel CIBW_REPAIR_WHEEL_COMMAND_LINUX: renamewheel -w {dest_dir} {wheel} + with: + output-dir: wheelhouse + package-dir: src/bindings/python/ - name: Upload Python wheels as artifacts if: needs.setup-jobs.outputs.binaries-destination == 'Artifact' From d52899b14a0f6ec70621017e323d7689bb58e1cb Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Wed, 23 Oct 2024 14:37:20 +1300 Subject: [PATCH 2/5] Set artifact upload GitHub action to v4. --- .github/workflows/deploy-on-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-on-release.yml b/.github/workflows/deploy-on-release.yml index 3ad3808861..fa301e5a96 100644 --- a/.github/workflows/deploy-on-release.yml +++ b/.github/workflows/deploy-on-release.yml @@ -266,7 +266,7 @@ jobs: - name: Upload libraries as artifacts if: needs.setup-jobs.outputs.binaries-destination == 'Artifact' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: ./build/dist/* @@ -356,7 +356,7 @@ jobs: - name: Upload Python wheels as artifacts if: needs.setup-jobs.outputs.binaries-destination == 'Artifact' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: ./wheelhouse/*.whl @@ -437,7 +437,7 @@ jobs: - name: Upload libcellml.js as artifacts if: needs.setup-jobs.outputs.binaries-destination == 'Artifact' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: ${{ steps.package-javascript.outputs.files }} From ea48218d9ff8f15e88e5220e4e3221c03b09251c Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Wed, 23 Oct 2024 14:55:19 +1300 Subject: [PATCH 3/5] Remove calls to xmlCleanupGlobals, in newer versions of libXml2 it is a no-op. --- src/xmldoc.cpp | 2 -- tests/parser/libxml_user.cpp | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/xmldoc.cpp b/src/xmldoc.cpp index 450fa256a9..d1774dac7a 100644 --- a/src/xmldoc.cpp +++ b/src/xmldoc.cpp @@ -89,7 +89,6 @@ void XmlDoc::parse(const std::string &input) xmlFreeParserCtxt(context); xmlSetStructuredErrorFunc(nullptr, nullptr); xmlCleanupParser(); - xmlCleanupGlobals(); } std::string decompressMathMLDTD() @@ -129,7 +128,6 @@ void XmlDoc::parseMathML(const std::string &input) xmlFreeParserCtxt(context); xmlSetStructuredErrorFunc(nullptr, nullptr); xmlCleanupParser(); - xmlCleanupGlobals(); } std::string XmlDoc::prettyPrint() const diff --git a/tests/parser/libxml_user.cpp b/tests/parser/libxml_user.cpp index 8cb0eb2ef4..a8c1d24d40 100644 --- a/tests/parser/libxml_user.cpp +++ b/tests/parser/libxml_user.cpp @@ -54,7 +54,6 @@ TEST(Parser, parseValidXmlDirectlyUsingLibxml) xmlFreeDoc(doc); xmlSetStructuredErrorFunc(nullptr, nullptr); xmlCleanupParser(); - xmlCleanupGlobals(); } TEST(Parser, parseInvalidXmlDirectlyUsingLibxml) @@ -76,7 +75,6 @@ TEST(Parser, parseInvalidXmlDirectlyUsingLibxml) xmlFreeParserCtxt(context); xmlSetStructuredErrorFunc(nullptr, nullptr); xmlCleanupParser(); - xmlCleanupGlobals(); EXPECT_EQ(nullptr, doc); } From b49272994c0a822e3af91847f5ef11ccb2af08df Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Wed, 23 Oct 2024 14:59:40 +1300 Subject: [PATCH 4/5] Add support for Python 3.13 wheels. --- .github/workflows/deploy-on-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-on-release.yml b/.github/workflows/deploy-on-release.yml index fa301e5a96..c67e64effa 100644 --- a/.github/workflows/deploy-on-release.yml +++ b/.github/workflows/deploy-on-release.yml @@ -279,7 +279,7 @@ jobs: fail-fast: false matrix: os: [macos-13, ubuntu-20.04, windows-2019] - py: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + py: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] include: - name: 'Windows' os: windows-2019 From 3e99de767f6647c9e6673c1d8d75e749ad9298fb Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Wed, 23 Oct 2024 15:20:13 +1300 Subject: [PATCH 5/5] Update macos-12 to macos-13 GitHub runners. --- .github/workflows/deploy-on-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-on-release.yml b/.github/workflows/deploy-on-release.yml index c67e64effa..ab4e0573ca 100644 --- a/.github/workflows/deploy-on-release.yml +++ b/.github/workflows/deploy-on-release.yml @@ -92,8 +92,8 @@ jobs: build_type: "Release", cc: "gcc", cxx: "g++" } - { - name: "macOS 12 Clang", - os: macos-12, + name: "macOS 13 Clang", + os: macos-13, cc: "clang", cxx: "clang++" } @@ -375,7 +375,7 @@ jobs: needs: setup-jobs if: needs.setup-jobs.outputs.allowed-jobs == 'Javascript' || needs.setup-jobs.outputs.allowed-jobs == 'All' name: libcellml.js - runs-on: macos-12 + runs-on: macos-13 steps: - name: Checkout libCellML uses: actions/checkout@v4