diff --git a/.github/workflows/build-wheel-wrapper.yml b/.github/workflows/build-wheel-wrapper.yml index bea8ed8c3..fb8ccbe8c 100644 --- a/.github/workflows/build-wheel-wrapper.yml +++ b/.github/workflows/build-wheel-wrapper.yml @@ -21,5 +21,5 @@ on: jobs: python-wrapper-wheel: name: Python Wrapper Wheel - uses: ecmwf-actions/reusable-workflows/.github/workflows/python-wrapper-wheel.yml@main + uses: ecmwf/reusable-workflows/.github/workflows/python-wrapper-wheel.yml@main secrets: inherit diff --git a/python_wrapper/buildconfig b/python_wrapper/buildconfig index 76ccc66d1..9d8e36839 100644 --- a/python_wrapper/buildconfig +++ b/python_wrapper/buildconfig @@ -11,6 +11,6 @@ # TODO we duplicate information -- pyproject.toml's `name` and `packages` are derivable from $NAME and must stay consistent NAME="eckit" -CMAKE_PARAMS="-DENABLE_MPI=0 -DENABLE_ECKIT_GEO=1 -DENABLE_BUILD_TOOLS=OFF -DENABLE_AEC=0" +CMAKE_PARAMS="-DENABLE_MPI=0 -DENABLE_ECKIT_GEO=1 -DENABLE_BUILD_TOOLS=OFF -DENABLE_AEC=0 -DLZ4_INCLUDE_DIR=/tmp/lz4/usr/local/include/ -DLZ4_LIBRARY=/tmp/lz4/usr/local/lib/ -DENABLE_LZ4=1" PYPROJECT_DIR="python_wrapper" DEPENDENCIES='[]' diff --git a/python_wrapper/post-build.sh b/python_wrapper/post-build.sh new file mode 100755 index 000000000..f6d89c5a2 --- /dev/null +++ b/python_wrapper/post-build.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# NOTE in case of problems like we had with eccodes, replace with noop here +if [ "$(uname)" != "Darwin" ] ; then + auditwheel repair -w /tmp/eckit/auditwheel /tmp/eckit/build/wheel/*whl + rm /tmp/eckit/build/wheel/* + mv /tmp/eckit/auditwheel/* /tmp/eckit/build/wheel +fi + +# NOTE on macos we delocate with impunity, because the findlibs recursive depload +# is disabled anyway +if [ "$(uname)" = "Darwin" ] ; then + delocate-wheel /tmp/eccodes/build/wheel/*whl +fi diff --git a/python_wrapper/pre-compile.sh b/python_wrapper/pre-compile.sh new file mode 100755 index 000000000..a23df52dc --- /dev/null +++ b/python_wrapper/pre-compile.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# the procedure for adding a new ext dependency to be bundled in here: +# - add git checkout, compile, etc +# - ensure the version ends up in python_wrapper/src/versions.txt +# - ensure the licence ends up in python_wrapper/src/copying/, and fname is referenced in copying/list.json +# - ensure the .so ends up in target/lib64/ with the expected libname +# - validate that the resulting wheel contains all the above +# additionally, make sure this script is aligned with /buildscripts/compile.sh and /buildscripts/wheel-linux.sh, +# in particular when it comes to install targets and package data, etc + +# note also that for macos, we assume that the agent has the libraries already installed, as we can't run this in docker +# we thus only prepare the license files + +set -euo pipefail + +mkdir -p python_wrapper/src/copying +mkdir -p /tmp/eckit/target/eckit/lib64/ + +if [ "$(uname)" != "Darwin" ] ; then + echo "installing deps for platform $(uname)" + + ## lz4 + git clone https://github.com/lz4/lz4 /src/lz4 && cd /src/lz4 + make -j10 && make install DESTDIR=/tmp/lz4 + cd - +else + # TODO check macos agent has lz4 + echo "no deps installation for platform $(uname)" +fi + + +wget https://raw.githubusercontent.com/lz4/lz4/dev/LICENSE -O python_wrapper/src/copying/liblz4.txt +echo '{"liblz4": {"path": "copying/liblz4.txt", "home": "https://github.com/lz4/lz4"}}' > python_wrapper/src/copying/list.json