From e86052a86b35f5acfdac3c6827906acfe724a607 Mon Sep 17 00:00:00 2001 From: Artur Sharafutdinov Date: Wed, 16 Jul 2025 21:55:08 +0200 Subject: [PATCH 01/10] WIP: Use Rocky Linux 8 for building Python packages --- .github/workflows/build-test-distribute.yml | 2 +- .github/workflows/pip-build.yml | 118 ++++++++++---------- scripts/build_wheel.sh | 35 ------ scripts/nuget_patch/fake_whl_helper.py | 2 +- scripts/wheel/build_wheel.py | 2 +- source/MRIOExtras/CMakeLists.txt | 4 +- 6 files changed, 66 insertions(+), 97 deletions(-) delete mode 100755 scripts/build_wheel.sh diff --git a/.github/workflows/build-test-distribute.yml b/.github/workflows/build-test-distribute.yml index 5f078dfac874..8b7d737bbd1e 100644 --- a/.github/workflows/build-test-distribute.yml +++ b/.github/workflows/build-test-distribute.yml @@ -332,7 +332,7 @@ jobs: if: ${{ needs.config.outputs.test_pip_build == 'true' }} uses: ./.github/workflows/pip-build.yml with: - docker_image_tag: ${{ needs.config.outputs.docker_image_tag }} + vcpkg_docker_image_tag: ${{ needs.config.outputs.vcpkg_docker_image_tag }} collect-stats: timeout-minutes: 5 diff --git a/.github/workflows/pip-build.yml b/.github/workflows/pip-build.yml index e74a37864834..4d325f9c4e46 100644 --- a/.github/workflows/pip-build.yml +++ b/.github/workflows/pip-build.yml @@ -11,7 +11,7 @@ on: # This is the manual run from the UI. workflow_dispatch: inputs: - docker_image_tag: + vcpkg_docker_image_tag: # Empty string means the same thing as "latest", but we use an empty string here to ensure this works, # because `types: [published]` can't have any inputs, so there we are forced to use an empty string, so it needs to work. default: "" @@ -20,7 +20,7 @@ on: # This is the `uses:` call from other `.yml` files. workflow_call: inputs: - docker_image_tag: + vcpkg_docker_image_tag: required: true type: string @@ -52,7 +52,7 @@ jobs: timeout-minutes: 80 runs-on: ${{ matrix.runner }} container: - image: meshlib/meshlib-${{matrix.os}}:${{inputs.docker_image_tag || 'latest'}} + image: meshlib/meshlib-${{matrix.os}}:${{inputs.vcpkg_docker_image_tag || 'latest'}} options: ${{ matrix.container-options }} strategy: fail-fast: false @@ -60,17 +60,15 @@ jobs: platform: ["x86_64", "aarch64"] include: - platform: "x86_64" - os: "ubuntu20" + os: rockylinux8-vcpkg-x64 container-options: "--user root" runner: ubuntu-latest - compiler: /usr/bin/clang++-11 + compiler: /usr/bin/clang++ - platform: "aarch64" - os: "ubuntu20-arm64" + os: rockylinux8-vcpkg-arm64 container-options: " " # empty runner: [ self-hosted, linux-arm64, on-demand, meshinspector ] - # When using Clang 11 on Ubuntu Arm 20.04, we get some obscure ABI issues that fail some tests, - # see the comments in `test_regression/test_algorithms/test_decimate.py` for more details. - compiler: /usr/bin/clang++-18 + compiler: /usr/bin/clang++ steps: - name: Work-around possible permission issues @@ -102,18 +100,10 @@ jobs: git config --global --add safe.directory ${GITHUB_WORKSPACE}/thirdparty/mrbind git submodule update --init --recursive --depth 1 thirdparty/imgui thirdparty/parallel-hashmap thirdparty/mrbind-pybind11 thirdparty/mrbind - - name: Python setup - env: - ALLOW_DELETING_EXISTING_PYTHON: 1 - run: | - scripts/mrbind-pybind11/install_all_python_versions_ubuntu_reqs.sh - - - name: Install thirdparty libs + - name: Install mrbind # Also print the amount of RAM. If there's not enough RAM, building MRBind bindings can fail. Not doing it in that step, because OOM fails can erase logs from the current step. run: | - ln -s /usr/local/lib/meshlib-thirdparty-lib/lib ./lib - ln -s /usr/local/lib/meshlib-thirdparty-lib/include ./include - ./scripts/mrbind/install_mrbind_ubuntu.sh + ./scripts/mrbind/install_mrbind_rockylinux.sh free -h - name: Build @@ -121,20 +111,26 @@ jobs: env: MESHLIB_BUILD_RELEASE: "ON" MESHLIB_BUILD_DEBUG: "OFF" - # When using Clang 11 on Ubuntu Arm 20.04, we get some obscure ABI issues that fail some tests, - # see the comments in `test_regression/test_algorithms/test_decimate.py` for more details. - CMAKE_CXX_COMPILER: ${{matrix.compiler}} - # FIXME: OpenGL libraries are included to wheel packages when the XDE module is used - # Enabling `-allow-unsupported-compiler` because we use Clang 18 on Arm, while Cuda supports at most 16. + CMAKE_CXX_COMPILER: ${{ matrix.compiler }} MR_CMAKE_OPTIONS: > -DMRIOEXTRAS_OPENCASCADE_USE_XDE=OFF -DMRVIEWER_NO_GTK=ON - -DMESHLIB_BUILD_MRCUDA=ON - ${{ fromJSON('["", "-DCMAKE_CUDA_FLAGS=-allow-unsupported-compiler"]')[matrix.platform == 'aarch64'] }} + -DMR_PCH_USE_EXTRA_HEADERS=ON + -DCMAKE_CUDA_HOST_COMPILER=/opt/rh/gcc-toolset-11/root/usr/bin/g++ - name: Generate and build MRBind bindings run: | - make -f scripts/mrbind/generate.mk -B --trace FOR_WHEEL=1 CXX_FOR_ABI=${{matrix.compiler}} + make -f scripts/mrbind/generate.mk -B --trace FOR_WHEEL=1 CXX_FOR_ABI=${{ matrix.compiler }} CXX_FOR_BINDINGS=${{ matrix.compiler }} DEPS_BASE_DIR=/opt/vcpkg/installed/${VCPKG_TRIPLET} + + - name: Install uv + uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6 + + - name: Build Python shim libs + run: | + for PYTHON_VER in $(cat scripts/mrbind-pybind11/python_versions.txt | xargs) ; do + export PKG_CONFIG_PATH=$(uv run -p ${PYTHON_VER} python -c "import sysconfig; print(sysconfig.get_config_var('LIBPC'))") + make shims -f scripts/mrbind/generate.mk -B --trace FOR_WHEEL=1 CXX_FOR_ABI=${{ matrix.compiler }} CXX_FOR_BINDINGS=${{ matrix.compiler }} DEPS_BASE_DIR=/opt/vcpkg/installed/${VCPKG_TRIPLET} PYTHON_VERSIONS=${PYTHON_VER} + done - name: Run Tests run: MR_LOCAL_RESOURCES=1 xvfb-run -a ./build/Release/bin/MeshViewer -hidden -noEventLoop -unloadPluginsAtEnd @@ -143,14 +139,19 @@ jobs: run: build/Release/bin/MRTest - name: Python Tests - working-directory: ./build/Release/bin - run: python3 ./../../../scripts/run_python_test_script.py -multi-cmd + run: | + python3.12 -m venv ./test_venv + source ./test_venv/bin/activate + python3.12 -m pip install -r ./requirements/python.txt + python3.12 -m pip install pytest + cd build/Release/bin + python3.12 ./../../../scripts/run_python_test_script.py #-multi-cmd - name: Create and fix Wheel - shell: bash run: | python3.12 -m venv ./wheel_venv source ./wheel_venv/bin/activate + python3.12 -m pip install patchelf python3.12 ./scripts/wheel/build_wheel.py --version ${{needs.setup.outputs.version_tag || '0'}} - name: Upload Python Stubs @@ -407,7 +408,7 @@ jobs: fail-fast: false matrix: platform: ["x86_64", "aarch64"] - os: ["ubuntu:20.04", "ubuntu:22.04", "debian:11-slim", "fedora:37", "fedora:39"] + py-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] include: - platform: "x86_64" runner: ubuntu-latest @@ -417,41 +418,44 @@ jobs: runner: [ self-hosted, linux-arm64, on-demand, meshinspector ] container-options: " " # empty container-prefix: "arm64v8/" - - os: "ubuntu:20.04" - py-version: "3.8" - py-cmd: "python3.8" - - os: "debian:11-slim" - py-version: "3.9" - py-cmd: "python3.9" - - os: "ubuntu:22.04" - py-version: "3.10" - py-cmd: "python3.10" - - os: "fedora:37" - py-version: "3.11" - py-cmd: "python3.11" - - os: "fedora:39" - py-version: "3.12" - py-cmd: "python3.12" + - py-version: "3.8" + os: "rockylinux:8" + - py-version: "3.9" + os: "debian:11-slim" + - py-version: "3.10" + os: "ubuntu:22.04" + - py-version: "3.11" + os: "fedora:37" + - py-version: "3.12" + os: "fedora:39" + - py-version: "3.13" + os: "fedora:42" + env: + PYTHON_CMD: python${{ matrix.py-version }} steps: - name: Checkout uses: actions/checkout@v4 with: ref: ${{needs.setup.outputs.version_tag}} - - name: Ubuntu system setup - if: ${{ matrix.os == 'ubuntu:20.04' || matrix.os == 'ubuntu:22.04' || matrix.os == 'debian:11-slim' }} + - name: Rocky Linux system setup + if: ${{ matrix.os == 'rockylinux:8' }} + run: dnf -y install python38-pip + + - name: Debian/Ubuntu system setup + if: ${{ matrix.os == 'debian:11-slim' || matrix.os == 'ubuntu:22.04' }} run: apt -y update && apt -y upgrade && apt -y install curl libssl-dev python3-pip - - name: Fedora 37 system setup - if: ${{matrix.os == 'fedora:37' || matrix.os == 'fedora:39'}} - run: dnf -y install python3 pip + - name: Fedora system setup + if: ${{ matrix.os == 'fedora:37' || matrix.os == 'fedora:39' || matrix.os == 'fedora:42' }} + run: dnf -y install python3-pip - name: Pip setup run: | - ${{ matrix.py-cmd }} -m pip install --upgrade pip - ${{ matrix.py-cmd }} -m pip uninstall -y meshlib - ${{ matrix.py-cmd }} -m pip install --upgrade -r ./requirements/python.txt - ${{ matrix.py-cmd }} -m pip install pytest + ${{ env.PYTHON_CMD }} -m pip install --upgrade pip + ${{ env.PYTHON_CMD }} -m pip uninstall -y meshlib + ${{ env.PYTHON_CMD }} -m pip install --upgrade -r ./requirements/python.txt + ${{ env.PYTHON_CMD }} -m pip install pytest - name: Download Meshlib wheel from Artifact uses: actions/download-artifact@v4 @@ -460,11 +464,11 @@ jobs: merge-multiple: true - name: Meshlib wheel install - run: ${{ matrix.py-cmd }} -m pip install ${{ matrix.pip-options }} ./meshlib-*.whl + run: ${{ env.PYTHON_CMD }} -m pip install ${{ matrix.pip-options }} ./meshlib-*.whl - name: Run Python tests working-directory: test_python - run: ${{ matrix.py-cmd }} -m pytest -s -v + run: ${{ env.PYTHON_CMD }} -m pytest -s -v windows-pip-test: needs: [windows-pip-build] diff --git a/scripts/build_wheel.sh b/scripts/build_wheel.sh deleted file mode 100755 index 5799ecef9007..000000000000 --- a/scripts/build_wheel.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -set -euo pipefail - -MANYLINUX_VERSION="2_31" -# TODO: detect platform automatically -PLATFORM="${PLATFORM:-x86_64}" - -PYTHON_TAG="cp${PYTHON_VERSION/./}" -PYTHON_EXECUTABLE="python${PYTHON_VERSION}" - -MESHLIB_VERSION="${MESHLIB_VERSION}" - -MESHLIB_PYTHON_MODULES=(mrmeshpy mrmeshnumpy mrcudapy mrviewerpy) - -set +e -which $PYTHON_EXECUTABLE >/dev/null -if [ $? -ne 0 ] ; then - echo "No Python ${PYTHON_VERSION} executable found" - exit 1 -fi -set -e - -$PYTHON_EXECUTABLE -m pip install --upgrade --requirement ./requirements/distribution_python.txt -$PYTHON_EXECUTABLE -m pip install auditwheel wheel setuptools pybind11-stubgen -$PYTHON_EXECUTABLE ./scripts/wheel/setup_workspace.py -pushd ./scripts/wheel/meshlib/ - for MODULE in ${MESHLIB_PYTHON_MODULES[*]} ; do - PYTHONPATH=. pybind11-stubgen --output-dir . meshlib.$MODULE - done - $PYTHON_EXECUTABLE setup.py bdist_wheel --python-tag=$PYTHON_TAG --version ${MESHLIB_VERSION} - $PYTHON_EXECUTABLE -m auditwheel repair --plat "manylinux_${MANYLINUX_VERSION}_${PLATFORM}" ./dist/*.whl -popd - -echo "Wheel files are ready:" -ls -1 ./scripts/wheel/meshlib/wheelhouse/meshlib-*.whl diff --git a/scripts/nuget_patch/fake_whl_helper.py b/scripts/nuget_patch/fake_whl_helper.py index 99df1988d191..5d379a7ef80b 100644 --- a/scripts/nuget_patch/fake_whl_helper.py +++ b/scripts/nuget_patch/fake_whl_helper.py @@ -56,7 +56,7 @@ def patch_whl(out_dir,libs_dir): elif SYSTEM == "Linux": sys.path.append(libs_dir) # to find SO files # see also: https://github.com/mayeut/pep600_compliance - manylinux_version = "2_31" + manylinux_version = "2_28" subprocess.check_call( [ sys.executable, "-m", "auditwheel", diff --git a/scripts/wheel/build_wheel.py b/scripts/wheel/build_wheel.py index 67ebd8e2420b..3d85b1c823f7 100644 --- a/scripts/wheel/build_wheel.py +++ b/scripts/wheel/build_wheel.py @@ -111,7 +111,7 @@ def build_wheel(): if SYSTEM == "Linux": # see also: https://github.com/mayeut/pep600_compliance - manylinux_version = "2_31" + manylinux_version = "2_28" os.chdir(WHEEL_ROOT_DIR) subprocess.check_call( diff --git a/source/MRIOExtras/CMakeLists.txt b/source/MRIOExtras/CMakeLists.txt index dea50ddbd8b7..fa965f838017 100644 --- a/source/MRIOExtras/CMakeLists.txt +++ b/source/MRIOExtras/CMakeLists.txt @@ -117,9 +117,9 @@ IF(NOT MRIOEXTRAS_NO_STEP) ApplicationFramework DataExchange ) - set(OpenCASCADE_REQUIRED_LIBRARIES TKernel TKBRep TKMath TKMesh TKDESTEP TKSTEP TKXSBase) + set(OpenCASCADE_REQUIRED_LIBRARIES TKernel TKBRep TKMath TKMesh TKDESTEP TKSTEP TKTopAlgo TKXSBase) IF(MRIOEXTRAS_OPENCASCADE_USE_XDE) - list(APPEND OpenCASCADE_REQUIRED_LIBRARIES TKXDESTEP TKLCAF TKXCAF TKTopAlgo) + list(APPEND OpenCASCADE_REQUIRED_LIBRARIES TKXDESTEP TKLCAF TKXCAF) ENDIF() FOREACH(LIBRARY_NAME ${OpenCASCADE_LIBRARIES}) IF(${LIBRARY_NAME} IN_LIST OpenCASCADE_REQUIRED_LIBRARIES) From 132da90116cc1694ca5b3ca9ad879b13952260a3 Mon Sep 17 00:00:00 2001 From: Artur Sharafutdinov Date: Thu, 17 Jul 2025 12:07:05 +0200 Subject: [PATCH 02/10] Remove obsolete config --- .github/workflows/build-test-linux-vcpkg.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/build-test-linux-vcpkg.yml b/.github/workflows/build-test-linux-vcpkg.yml index 05b189fb1a99..c48745e3c6e8 100644 --- a/.github/workflows/build-test-linux-vcpkg.yml +++ b/.github/workflows/build-test-linux-vcpkg.yml @@ -161,20 +161,6 @@ jobs: CXX: ${{ matrix.cxx-compiler }} run: make -f scripts/mrbind/generate.mk MODE=none -B --trace MESHLIB_SHLIB_DIR=build/${{matrix.config}}/bin CXX_FOR_BINDINGS=/usr/bin/clang++ DEPS_BASE_DIR=/opt/vcpkg/installed/${{ matrix.arch }}-linux-meshlib - # TODO: move to pip-build.yml after migrating from ubuntu20 - #- name: Build Python shim libs - # if: ${{ inputs.mrbind && !matrix.skip_mrbind }} - # env: - # CXX: ${{ matrix.cxx-compiler }} - # CXX_FOR_BINDINGS: /usr/bin/clang++ - # VCPKG_BASE_DIR: /opt/vcpkg/installed/${{ matrix.arch }}-linux-meshlib - # run: | - # python3 -m pip install uv - # for PYTHON_VER in $(cat scripts/mrbind-pybind11/python_versions.txt | xargs) ; do - # export PKG_CONFIG_PATH=$(uv run -p ${PYTHON_VER} python -c "import sysconfig; print(sysconfig.get_config_var('LIBPC'))") - # make shims -f scripts/mrbind/generate.mk -B --trace FOR_WHEEL=1 MESHLIB_SHLIB_DIR=build/${{matrix.config}}/bin PYTHON_VERSIONS=${PYTHON_VER} - # done - - name: Collect Timings run: ./scripts/devops/collect_timing_logs.sh linux-vcpkg-${{ matrix.arch }} ${{matrix.config}} "${{matrix.compiler}}" From 4980501b40e6571ab7cde60292dc3fc0951eece7 Mon Sep 17 00:00:00 2001 From: Artur Sharafutdinov Date: Thu, 17 Jul 2025 13:35:21 +0200 Subject: [PATCH 03/10] Use custom minimal OpenCASCADE build --- .github/workflows/pip-build.yml | 1 - requirements/vcpkg-linux.txt | 2 +- .../csf-redifinition.patch | 24 ++++ .../opencascade-minimal/dependencies.patch | 104 ++++++++++++++++++ .../drop-bin-letter-d.patch | 45 ++++++++ .../fix-install-prefix-path.patch | 12 ++ .../install-include-dir.patch | 16 +++ .../ports/opencascade-minimal/portfile.cmake | 94 ++++++++++++++++ .../remove-vcpkg-enabling.patch | 14 +++ .../ports/opencascade-minimal/vcpkg.json | 39 +++++++ 10 files changed, 349 insertions(+), 2 deletions(-) create mode 100644 thirdparty/vcpkg/ports/opencascade-minimal/csf-redifinition.patch create mode 100644 thirdparty/vcpkg/ports/opencascade-minimal/dependencies.patch create mode 100644 thirdparty/vcpkg/ports/opencascade-minimal/drop-bin-letter-d.patch create mode 100644 thirdparty/vcpkg/ports/opencascade-minimal/fix-install-prefix-path.patch create mode 100644 thirdparty/vcpkg/ports/opencascade-minimal/install-include-dir.patch create mode 100644 thirdparty/vcpkg/ports/opencascade-minimal/portfile.cmake create mode 100644 thirdparty/vcpkg/ports/opencascade-minimal/remove-vcpkg-enabling.patch create mode 100644 thirdparty/vcpkg/ports/opencascade-minimal/vcpkg.json diff --git a/.github/workflows/pip-build.yml b/.github/workflows/pip-build.yml index 4d325f9c4e46..b08fa7adca02 100644 --- a/.github/workflows/pip-build.yml +++ b/.github/workflows/pip-build.yml @@ -113,7 +113,6 @@ jobs: MESHLIB_BUILD_DEBUG: "OFF" CMAKE_CXX_COMPILER: ${{ matrix.compiler }} MR_CMAKE_OPTIONS: > - -DMRIOEXTRAS_OPENCASCADE_USE_XDE=OFF -DMRVIEWER_NO_GTK=ON -DMR_PCH_USE_EXTRA_HEADERS=ON -DCMAKE_CUDA_HOST_COMPILER=/opt/rh/gcc-toolset-11/root/usr/bin/g++ diff --git a/requirements/vcpkg-linux.txt b/requirements/vcpkg-linux.txt index 1037c42b570d..d4a4d209249f 100644 --- a/requirements/vcpkg-linux.txt +++ b/requirements/vcpkg-linux.txt @@ -26,7 +26,7 @@ libe57format libharu libjpeg-turbo libzip -opencascade[core] +opencascade-minimal openctm openvdb parallel-hashmap diff --git a/thirdparty/vcpkg/ports/opencascade-minimal/csf-redifinition.patch b/thirdparty/vcpkg/ports/opencascade-minimal/csf-redifinition.patch new file mode 100644 index 000000000000..e62f5143bd71 --- /dev/null +++ b/thirdparty/vcpkg/ports/opencascade-minimal/csf-redifinition.patch @@ -0,0 +1,24 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 17bc7f1638..c4283c3c4d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -473,6 +473,9 @@ OCCT_IS_PRODUCT_REQUIRED (CSF_EIGEN CAN_USE_EIGEN) + + set (OCCT_3RDPARTY_CMAKE_LIST) + ++# define CSF variable ++OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf") ++ + # Tcl (mandatory for Draw Harness) + if (USE_TCL) + message (STATUS "Info: TCL is used by OCCT") +@@ -769,9 +772,6 @@ file(COPY ${CMAKE_SOURCE_DIR}/.clang-format DESTINATION ${CMAKE_SOURCE_DIR}) + OCCT_MAKE_OS_WITH_BITNESS() + OCCT_MAKE_COMPILER_SHORT_NAME() + +-# define CSF variable +-OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf") +- + # do not define INSTALL_DIR_BIN for win. + # Leave library structure for win: /win64/vc10/bin(d) + if (NOT DEFINED INSTALL_DIR_BIN) diff --git a/thirdparty/vcpkg/ports/opencascade-minimal/dependencies.patch b/thirdparty/vcpkg/ports/opencascade-minimal/dependencies.patch new file mode 100644 index 000000000000..f319108b494d --- /dev/null +++ b/thirdparty/vcpkg/ports/opencascade-minimal/dependencies.patch @@ -0,0 +1,104 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 34300d41ad..263b4bcbd3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -518,8 +518,8 @@ endif() + if (CAN_USE_FREETYPE AND USE_FREETYPE) + message (STATUS "Info: FreeType is used by OCCT") + add_definitions (-DHAVE_FREETYPE) +- OCCT_ADD_VCPKG_FEATURE ("freetype") +- list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/freetype") ++ find_package(Freetype MODULE REQUIRED) ++ set(CSF_FREETYPE Freetype::Freetype) + else() + if (NOT CAN_USE_FREETYPE) + OCCT_CHECK_AND_UNSET ("USE_FREETYPE") +@@ -534,9 +534,10 @@ endif() + # VTK + if (USE_VTK) + add_definitions (-DHAVE_VTK) +- OCCT_ADD_VCPKG_FEATURE ("vtk") + set (OCCT_VTK_USED_TARGETS "" CACHE INTERNAL "" FORCE) +- list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/vtk") ++ find_package(VTK REQUIRED) ++ set(CSF_VTK VTK::CommonCore) ++ set(IS_VTK_9XX 1) + else() + OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_VTK") + OCCT_UNSET_VCPKG_FEATURE ("vtk") +@@ -551,8 +552,8 @@ endif() + # FREEIMAGE + if (CAN_USE_FREEIMAGE AND USE_FREEIMAGE) + add_definitions (-DHAVE_FREEIMAGE) +- OCCT_ADD_VCPKG_FEATURE ("freeimage") +- list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/freeimage") ++ find_package(freeimage CONFIG REQUIRED) ++ set(CSF_FreeImagePlus freeimage::FreeImagePlus) + elseif (NOT CAN_USE_FREEIMAGE) + OCCT_CHECK_AND_UNSET ("USE_FREEIMAGE") + OCCT_UNSET_VCPKG_FEATURE ("freeimage") +@@ -647,8 +648,8 @@ endif() + # TBB + if (CAN_USE_TBB AND USE_TBB) + add_definitions (-DHAVE_TBB) +- OCCT_ADD_VCPKG_FEATURE ("tbb") +- list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/tbb") ++ find_package(TBB CONFIG REQUIRED) ++ set(CSF_TBB TBB::tbb TBB::tbbmalloc) + elseif (NOT CAN_USE_TBB) + OCCT_CHECK_AND_UNSET ("USE_TBB") + OCCT_UNSET_VCPKG_FEATURE ("tbb") +@@ -664,8 +665,8 @@ endif() + OCCT_IS_PRODUCT_REQUIRED (CSF_RapidJSON CAN_USE_RAPIDJSON) + if (CAN_USE_RAPIDJSON AND USE_RAPIDJSON) + add_definitions (-DHAVE_RAPIDJSON) +- OCCT_ADD_VCPKG_FEATURE ("rapidjson") +- list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/rapidjson") ++ find_package(RapidJSON CONFIG REQUIRED) ++ set(CSF_RapidJSON rapidjson) + elseif (NOT CAN_USE_RAPIDJSON) + OCCT_CHECK_AND_UNSET ("USE_RAPIDJSON") + OCCT_UNSET_VCPKG_FEATURE ("rapidjson") +diff --git a/adm/templates/OpenCASCADEConfig.cmake.in b/adm/templates/OpenCASCADEConfig.cmake.in +index add6a678c7..312930343e 100644 +--- a/adm/templates/OpenCASCADEConfig.cmake.in ++++ b/adm/templates/OpenCASCADEConfig.cmake.in +@@ -71,6 +71,23 @@ set (OpenCASCADE_WITH_GLES2 @USE_GLES2@) + @SET_OpenCASCADE_WITH_D3D@ + @SET_OpenCASCADE_WITH_GLX@ + ++include(CMakeFindDependencyMacro) ++if("@USE_FREEIMAGE@") ++ find_dependency(freeimage CONFIG) ++endif() ++if("@USE_FREETYPE@") ++ find_dependency(Freetype MODULE) ++endif() ++if("@USE_RAPIDJSON@") ++ find_package(RapidJSON CONFIG REQUIRED) ++endif() ++if("@USE_TBB@") ++ find_dependency(TBB CONFIG) ++endif() ++if("@USE_VTK@") ++ find_dependency(VTK REQUIRED) ++endif() ++ + # Import OpenCASCADE compile definitions, C and C++ flags for each installed configuration. + file(GLOB CONFIG_FILES "${CMAKE_CURRENT_LIST_DIR}/OpenCASCADECompileDefinitionsAndFlags-*.cmake") + foreach(f ${CONFIG_FILES}) +diff --git a/src/Image/Image_AlienPixMap.cxx b/src/Image/Image_AlienPixMap.cxx +index 81289d953b..5ee49e9ff2 100644 +--- a/src/Image/Image_AlienPixMap.cxx ++++ b/src/Image/Image_AlienPixMap.cxx +@@ -19,10 +19,6 @@ + + #ifdef HAVE_FREEIMAGE + #include +- +- #ifdef _MSC_VER +- #pragma comment(lib, "FreeImage.lib") +- #endif + #elif defined(HAVE_WINCODEC) + #include + // prevent warnings on MSVC10 diff --git a/thirdparty/vcpkg/ports/opencascade-minimal/drop-bin-letter-d.patch b/thirdparty/vcpkg/ports/opencascade-minimal/drop-bin-letter-d.patch new file mode 100644 index 000000000000..d3c3df64910d --- /dev/null +++ b/thirdparty/vcpkg/ports/opencascade-minimal/drop-bin-letter-d.patch @@ -0,0 +1,45 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d051f5ccce..91517a5936 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -317,7 +317,6 @@ set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE) + + set (BIN_LETTER "") + if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") +- set (BIN_LETTER "d") + elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") + set (BIN_LETTER "i") + endif() +@@ -1002,6 +1001,7 @@ if (WIN32) + set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin") + set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bini") + set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") ++ set (CMAKE_PDB_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin") + endif() + + string(TIMESTAMP CURRENT_TIME "%H:%M:%S") +diff --git a/adm/cmake/occt_macros.cmake b/adm/cmake/occt_macros.cmake +index 92a8db33dc..3d4c95b584 100644 +--- a/adm/cmake/occt_macros.cmake ++++ b/adm/cmake/occt_macros.cmake +@@ -779,7 +779,7 @@ macro (OCCT_INSERT_CODE_FOR_TARGET) + elseif (\"\${CMAKE_INSTALL_CONFIG_NAME}\" MATCHES \"^([Rr][Ee][Ll][Ww][Ii][Tt][Hh][Dd][Ee][Bb][Ii][Nn][Ff][Oo])$\") + set (OCCT_INSTALL_BIN_LETTER \"i\") + elseif (\"\${CMAKE_INSTALL_CONFIG_NAME}\" MATCHES \"^([Dd][Ee][Bb][Uu][Gg])$\") +- set (OCCT_INSTALL_BIN_LETTER \"d\") ++ set (OCCT_INSTALL_BIN_LETTER \"\") + endif()") + endmacro() + +diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt +index beb934f7..95cec74a 100644 +--- a/tools/CMakeLists.txt ++++ b/tools/CMakeLists.txt +@@ -172,7 +172,6 @@ set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE) + + set (BIN_LETTER "") + if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") +- set (BIN_LETTER "d") + elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") + set (BIN_LETTER "i") + endif() diff --git a/thirdparty/vcpkg/ports/opencascade-minimal/fix-install-prefix-path.patch b/thirdparty/vcpkg/ports/opencascade-minimal/fix-install-prefix-path.patch new file mode 100644 index 000000000000..ccc55980442a --- /dev/null +++ b/thirdparty/vcpkg/ports/opencascade-minimal/fix-install-prefix-path.patch @@ -0,0 +1,12 @@ +diff --git a/adm/templates/OpenCASCADEConfig.cmake.in b/adm/templates/OpenCASCADEConfig.cmake.in +index e391ddfe8e..c926c499ac 100644 +--- a/adm/templates/OpenCASCADEConfig.cmake.in ++++ b/adm/templates/OpenCASCADEConfig.cmake.in +@@ -24,6 +24,7 @@ set (OpenCASCADE_DEVELOPMENT_VERSION "@OCC_VERSION_DEVELOPMENT@") + # - in Android style: $INSTALL_DIR/libs/$CMAKE_ANDROID_ARCH_ABI/cmake/opencascade- + get_filename_component (OpenCASCADE_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) + get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH) ++get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH) + if (OpenCASCADE_INSTALL_PREFIX MATCHES "/cmake$") + get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH) + endif() diff --git a/thirdparty/vcpkg/ports/opencascade-minimal/install-include-dir.patch b/thirdparty/vcpkg/ports/opencascade-minimal/install-include-dir.patch new file mode 100644 index 000000000000..f250fbb92e8b --- /dev/null +++ b/thirdparty/vcpkg/ports/opencascade-minimal/install-include-dir.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 715adb7c2e..a06f8a8c88 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1375,6 +1375,11 @@ foreach (OCCT_MODULE ${OCCT_MODULES}) + endforeach() + set (OCCT_MODULES_ENABLED ${OCCT_MODULES_ENABLED_SORTED}) + ++foreach (OCCT_LIBRARY IN LISTS OCCT_LIBRARIES) ++ target_include_directories(${OCCT_LIBRARY} INTERFACE $) # OpenCASCADE_INCLUDE_DIR ++ target_include_directories(${OCCT_LIBRARY} INTERFACE $) # vcpkg lock-in ++endforeach() ++ + # Add all targets to the build-tree export set + export (TARGETS ${OCCT_LIBRARIES} FILE "${CMAKE_BINARY_DIR}/OpenCASCADETargets.cmake") + diff --git a/thirdparty/vcpkg/ports/opencascade-minimal/portfile.cmake b/thirdparty/vcpkg/ports/opencascade-minimal/portfile.cmake new file mode 100644 index 000000000000..886c39826f68 --- /dev/null +++ b/thirdparty/vcpkg/ports/opencascade-minimal/portfile.cmake @@ -0,0 +1,94 @@ +string(REPLACE "." "_" VERSION_STR "V${VERSION}") +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Open-Cascade-SAS/OCCT + REF "${VERSION_STR}" + SHA512 4ec271ec8db5f0d6f77ea5c0633b40334c796421806a344c568fb8d9ed942fec63f8dfcc65ab9f65e0446d5cd7a49beede5ac693421971b350e828ab1a19d773 + HEAD_REF master + PATCHES + fix-install-prefix-path.patch + drop-bin-letter-d.patch + dependencies.patch + install-include-dir.patch + remove-vcpkg-enabling.patch + csf-redifinition.patch +) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + set(BUILD_TYPE "Shared") +else() + set(BUILD_TYPE "Static") +endif() + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + eigen USE_EIGEN + tbb USE_TBB +) + +if ("lto" IN_LIST FEATURES) + list(APPEND FEATURE_OPTIONS "-DBUILD_OPT_PROFILE=Production") +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${FEATURE_OPTIONS} + -DBUILD_LIBRARY_TYPE=${BUILD_TYPE} + -DBUILD_CPP_STANDARD=C++20 + -DBUILD_RELEASE_DISABLE_EXCEPTIONS=ON + -DBUILD_MODULE_ApplicationFramework=OFF + -DBUILD_MODULE_DataExchange=OFF + -DBUILD_MODULE_DETools=OFF + -DBUILD_MODULE_Draw=OFF + -DBUILD_MODULE_ModelingAlgorithms=OFF + -DBUILD_MODULE_ModelingData=OFF + -DBUILD_MODULE_Visualization=OFF + -DBUILD_DOC_Overview=OFF + -DBUILD_Inspector=OFF + -DBUILD_ADDITIONAL_TOOLKITS="TKDESTEP;TKBinXCAF" + -DINSTALL_DIR_LAYOUT=Unix + -DINSTALL_DIR_DOC=share/trash + -DINSTALL_DIR_SCRIPT=share/trash # not relocatable + -DINSTALL_SAMPLES=OFF + -DINSTALL_TEST_CASES=OFF + -DUSE_DRACO=OFF + -DUSE_FREETYPE=OFF + -DUSE_FREEIMAGE=OFF + -DUSE_OPENGL=OFF + -DUSE_OPENVR=OFF + -DUSE_GLES2=OFF + -DUSE_RAPIDJSON=OFF + -DUSE_TK=OFF + -DUSE_VTK=OFF + -DUSE_XLIB=OFF +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/opencascade) + +#make occt includes relative to source_file +file(GLOB extra_headers + LIST_DIRECTORIES false + RELATIVE "${CURRENT_PACKAGES_DIR}/include/opencascade" + "${CURRENT_PACKAGES_DIR}/include/opencascade/*.h" +) +list(JOIN extra_headers "|" extra_headers) +file(GLOB files "${CURRENT_PACKAGES_DIR}/include/opencascade/*.[hgl]xx") +foreach(file_name IN LISTS files) + file(READ "${file_name}" filedata) + string(REGEX REPLACE "(# *include) <([a-zA-Z0-9_]*[.][hgl]xx|${extra_headers})>" [[\1 "\2"]] filedata "${filedata}") + file(WRITE "${file_name}" "${filedata}") +endforeach() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/opencascade/samples/qt") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/trash") + +vcpkg_install_copyright( + FILE_LIST + "${SOURCE_PATH}/LICENSE_LGPL_21.txt" + "${SOURCE_PATH}/OCCT_LGPL_EXCEPTION.txt" +) diff --git a/thirdparty/vcpkg/ports/opencascade-minimal/remove-vcpkg-enabling.patch b/thirdparty/vcpkg/ports/opencascade-minimal/remove-vcpkg-enabling.patch new file mode 100644 index 000000000000..a11da758134e --- /dev/null +++ b/thirdparty/vcpkg/ports/opencascade-minimal/remove-vcpkg-enabling.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a06f8a8c88..de45605c62 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,9 +2,6 @@ cmake_minimum_required (VERSION 3.10 FATAL_ERROR) + + if (NOT DEFINED BUILD_USE_VCPKG) + set (BUILD_USE_VCPKG OFF CACHE BOOL "Use vcpkg for 3rdparty libraries.") +- if (CMAKE_TOOLCHAIN_FILE MATCHES "vcpkg.cmake") +- set (BUILD_USE_VCPKG ON) +- endif() + endif() + + if (BUILD_USE_VCPKG) diff --git a/thirdparty/vcpkg/ports/opencascade-minimal/vcpkg.json b/thirdparty/vcpkg/ports/opencascade-minimal/vcpkg.json new file mode 100644 index 000000000000..f2f881b51a08 --- /dev/null +++ b/thirdparty/vcpkg/ports/opencascade-minimal/vcpkg.json @@ -0,0 +1,39 @@ +{ + "name": "opencascade-minimal", + "version": "7.9.1", + "description": "Open CASCADE Technology (OCCT) is an open-source software development platform for 3D CAD, CAM, CAE. Minimal build for STEP import support.", + "homepage": "https://github.com/Open-Cascade-SAS/OCCT", + "license": "LGPL-2.1-only", + "supports": "!xbox", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "default-features": [ + "eigen", + "tbb" + ], + "features": { + "eigen": { + "description": "Enable optional usage of Eigen", + "dependencies": [ + "eigen3" + ] + }, + "lto": { + "description": "Build with link-time optimization" + }, + "tbb": { + "description": "Enable optional usage of tbb", + "dependencies": [ + "tbb" + ] + } + } +} From 7fb956467df0dea51ffa1381bf7cc641072c94bb Mon Sep 17 00:00:00 2001 From: Artur Sharafutdinov Date: Thu, 17 Jul 2025 15:33:46 +0200 Subject: [PATCH 04/10] Update CI --- .github/workflows/pip-build.yml | 34 +++++++++++++++++++++-------- scripts/wheel/get_pkgconfig_path.py | 5 +++++ 2 files changed, 30 insertions(+), 9 deletions(-) create mode 100755 scripts/wheel/get_pkgconfig_path.py diff --git a/.github/workflows/pip-build.yml b/.github/workflows/pip-build.yml index b08fa7adca02..7cfb67a65eee 100644 --- a/.github/workflows/pip-build.yml +++ b/.github/workflows/pip-build.yml @@ -119,16 +119,27 @@ jobs: - name: Generate and build MRBind bindings run: | - make -f scripts/mrbind/generate.mk -B --trace FOR_WHEEL=1 CXX_FOR_ABI=${{ matrix.compiler }} CXX_FOR_BINDINGS=${{ matrix.compiler }} DEPS_BASE_DIR=/opt/vcpkg/installed/${VCPKG_TRIPLET} + make -f scripts/mrbind/generate.mk -B --trace \ + FOR_WHEEL=1 \ + CXX_FOR_ABI=${{ matrix.compiler }} \ + CXX_FOR_BINDINGS=${{ matrix.compiler }} \ + DEPS_BASE_DIR=${VCPKG_ROOT}/installed/${VCPKG_TRIPLET} - name: Install uv uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6 - name: Build Python shim libs run: | - for PYTHON_VER in $(cat scripts/mrbind-pybind11/python_versions.txt | xargs) ; do - export PKG_CONFIG_PATH=$(uv run -p ${PYTHON_VER} python -c "import sysconfig; print(sysconfig.get_config_var('LIBPC'))") - make shims -f scripts/mrbind/generate.mk -B --trace FOR_WHEEL=1 CXX_FOR_ABI=${{ matrix.compiler }} CXX_FOR_BINDINGS=${{ matrix.compiler }} DEPS_BASE_DIR=/opt/vcpkg/installed/${VCPKG_TRIPLET} PYTHON_VERSIONS=${PYTHON_VER} + PYTHON_VERSIONS=$(cat scripts/mrbind-pybind11/python_versions.txt | xargs) + + for PYTHON_VER in ${PYTHON_VERSIONS} ; do + export PKG_CONFIG_PATH=$(uv run --python ${PYTHON_VER} ./scripts/wheel/get_pkgconfig_path.py) + make shims -f scripts/mrbind/generate.mk -B --trace \ + FOR_WHEEL=1 \ + CXX_FOR_ABI=${{ matrix.compiler }} \ + CXX_FOR_BINDINGS=${{ matrix.compiler }} \ + DEPS_BASE_DIR=${VCPKG_ROOT}/installed/${VCPKG_TRIPLET} \ + PYTHON_VERSIONS=${PYTHON_VER} done - name: Run Tests @@ -139,12 +150,17 @@ jobs: - name: Python Tests run: | - python3.12 -m venv ./test_venv - source ./test_venv/bin/activate - python3.12 -m pip install -r ./requirements/python.txt - python3.12 -m pip install pytest + PYTHON_VERSIONS=$(cat scripts/mrbind-pybind11/python_versions.txt | xargs) + REQUIREMENTS_FILE=${PWD}/requirements/python.txt + cd build/Release/bin - python3.12 ./../../../scripts/run_python_test_script.py #-multi-cmd + for PYTHON_VER in ${PYTHON_VERSIONS} ; do + uv run \ + --python ${PYTHON_VER} \ + --with-requirements ${REQUIREMENTS_FILE} \ + --with pytest \ + python3 ./../../../scripts/run_python_test_script.py -d '../test_python' + done - name: Create and fix Wheel run: | diff --git a/scripts/wheel/get_pkgconfig_path.py b/scripts/wheel/get_pkgconfig_path.py new file mode 100755 index 000000000000..d68e6fcab7ad --- /dev/null +++ b/scripts/wheel/get_pkgconfig_path.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python3 +import sysconfig + +if __name__ == '__main__': + print(sysconfig.get_config_var('LIBPC')) From 38222b31c24c879ae133fd7a4bc0cb00e78225f9 Mon Sep 17 00:00:00 2001 From: Artur Sharafutdinov Date: Thu, 17 Jul 2025 15:41:55 +0200 Subject: [PATCH 05/10] Update CI --- .github/workflows/pip-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pip-build.yml b/.github/workflows/pip-build.yml index 7cfb67a65eee..0080d1aafa99 100644 --- a/.github/workflows/pip-build.yml +++ b/.github/workflows/pip-build.yml @@ -459,7 +459,7 @@ jobs: - name: Debian/Ubuntu system setup if: ${{ matrix.os == 'debian:11-slim' || matrix.os == 'ubuntu:22.04' }} - run: apt -y update && apt -y upgrade && apt -y install curl libssl-dev python3-pip + run: apt -y update && apt -y install curl libssl-dev python3-pip - name: Fedora system setup if: ${{ matrix.os == 'fedora:37' || matrix.os == 'fedora:39' || matrix.os == 'fedora:42' }} From aef62e962932af0c7f15646bed70f1107e3b15a3 Mon Sep 17 00:00:00 2001 From: Artur Sharafutdinov Date: Thu, 17 Jul 2025 16:33:36 +0200 Subject: [PATCH 06/10] Update CI --- .github/workflows/pip-build.yml | 8 +++++++- .../wheel/{get_pkgconfig_path.py => get_sysconfig_var.py} | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) rename scripts/wheel/{get_pkgconfig_path.py => get_sysconfig_var.py} (51%) diff --git a/.github/workflows/pip-build.yml b/.github/workflows/pip-build.yml index 0080d1aafa99..406e4b096764 100644 --- a/.github/workflows/pip-build.yml +++ b/.github/workflows/pip-build.yml @@ -131,9 +131,11 @@ jobs: - name: Build Python shim libs run: | PYTHON_VERSIONS=$(cat scripts/mrbind-pybind11/python_versions.txt | xargs) + GET_SYSCONFIG_VAR=${PWD}/scripts/wheel/get_sysconfig_var.py for PYTHON_VER in ${PYTHON_VERSIONS} ; do - export PKG_CONFIG_PATH=$(uv run --python ${PYTHON_VER} ./scripts/wheel/get_pkgconfig_path.py) + export PKG_CONFIG_PATH=$(uv run --python ${PYTHON_VER} ${GET_SYSCONFIG_VAR} LIBPC) + make shims -f scripts/mrbind/generate.mk -B --trace \ FOR_WHEEL=1 \ CXX_FOR_ABI=${{ matrix.compiler }} \ @@ -152,9 +154,13 @@ jobs: run: | PYTHON_VERSIONS=$(cat scripts/mrbind-pybind11/python_versions.txt | xargs) REQUIREMENTS_FILE=${PWD}/requirements/python.txt + GET_SYSCONFIG_VAR=${PWD}/scripts/wheel/get_sysconfig_var.py cd build/Release/bin for PYTHON_VER in ${PYTHON_VERSIONS} ; do + PYTHON_LIB_DIR=$(uv run --python ${PYTHON_VER} ${GET_SYSCONFIG_VAR} LIBDIR) + + LD_LIBRARY_PATH=${PYTHON_LIB_DIR} \ uv run \ --python ${PYTHON_VER} \ --with-requirements ${REQUIREMENTS_FILE} \ diff --git a/scripts/wheel/get_pkgconfig_path.py b/scripts/wheel/get_sysconfig_var.py similarity index 51% rename from scripts/wheel/get_pkgconfig_path.py rename to scripts/wheel/get_sysconfig_var.py index d68e6fcab7ad..9fe065db6257 100755 --- a/scripts/wheel/get_pkgconfig_path.py +++ b/scripts/wheel/get_sysconfig_var.py @@ -2,4 +2,5 @@ import sysconfig if __name__ == '__main__': - print(sysconfig.get_config_var('LIBPC')) + import sys + print(sysconfig.get_config_var(sys.argv[1])) From 2ba095aef0a1ca02e35642f1a0ebc9aefbc951f2 Mon Sep 17 00:00:00 2001 From: Artur Sharafutdinov Date: Thu, 17 Jul 2025 17:48:45 +0200 Subject: [PATCH 07/10] Revert excess changes --- scripts/nuget_patch/fake_whl_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/nuget_patch/fake_whl_helper.py b/scripts/nuget_patch/fake_whl_helper.py index 5d379a7ef80b..99df1988d191 100644 --- a/scripts/nuget_patch/fake_whl_helper.py +++ b/scripts/nuget_patch/fake_whl_helper.py @@ -56,7 +56,7 @@ def patch_whl(out_dir,libs_dir): elif SYSTEM == "Linux": sys.path.append(libs_dir) # to find SO files # see also: https://github.com/mayeut/pep600_compliance - manylinux_version = "2_28" + manylinux_version = "2_31" subprocess.check_call( [ sys.executable, "-m", "auditwheel", From 32a55d14335ec694c570f5fae8f61f395c212bf7 Mon Sep 17 00:00:00 2001 From: Artur Sharafutdinov Date: Thu, 17 Jul 2025 17:50:04 +0200 Subject: [PATCH 08/10] Add comment --- .github/workflows/pip-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pip-build.yml b/.github/workflows/pip-build.yml index 406e4b096764..959cbf0f00ce 100644 --- a/.github/workflows/pip-build.yml +++ b/.github/workflows/pip-build.yml @@ -125,6 +125,7 @@ jobs: CXX_FOR_BINDINGS=${{ matrix.compiler }} \ DEPS_BASE_DIR=${VCPKG_ROOT}/installed/${VCPKG_TRIPLET} + # install helper utility for Python version management - name: Install uv uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6 From ec07f0f8033d57fea9987065053de20476522d84 Mon Sep 17 00:00:00 2001 From: Artur Sharafutdinov Date: Thu, 17 Jul 2025 17:52:23 +0200 Subject: [PATCH 09/10] Add comment --- scripts/wheel/get_sysconfig_var.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/wheel/get_sysconfig_var.py b/scripts/wheel/get_sysconfig_var.py index 9fe065db6257..0ff4ab59f9b0 100755 --- a/scripts/wheel/get_sysconfig_var.py +++ b/scripts/wheel/get_sysconfig_var.py @@ -1,4 +1,7 @@ #!/usr/bin/env python3 +""" +Helper script for retrieving non-system Python distribution info (libpython3 path, pkg-config path, etc.) +""" import sysconfig if __name__ == '__main__': From f6fce11c9bbf2ec124ee8e794673c0cc18438515 Mon Sep 17 00:00:00 2001 From: Artur Sharafutdinov Date: Thu, 17 Jul 2025 17:57:36 +0200 Subject: [PATCH 10/10] Add readme --- thirdparty/vcpkg/ports/opencascade-minimal/readme.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 thirdparty/vcpkg/ports/opencascade-minimal/readme.txt diff --git a/thirdparty/vcpkg/ports/opencascade-minimal/readme.txt b/thirdparty/vcpkg/ports/opencascade-minimal/readme.txt new file mode 100644 index 000000000000..c195c75afe36 --- /dev/null +++ b/thirdparty/vcpkg/ports/opencascade-minimal/readme.txt @@ -0,0 +1,2 @@ +This port is a copy of the original vcpkg port of OpenCASCADE: https://github.com/microsoft/vcpkg/tree/master/ports/opencascade +It was modified to compile fewer components and reduce its binary size and dependency list.