diff --git a/.github/workflows/build-wheels.sh b/.github/workflows/build-wheels.sh index 5288934..32666aa 100755 --- a/.github/workflows/build-wheels.sh +++ b/.github/workflows/build-wheels.sh @@ -1,20 +1,33 @@ #!/bin/bash set -e -x -cd bindings/python +# # install graalvm +# yum install -y zip +# curl -s "https://get.sdkman.io" | sh -s -- -y +# source "$HOME/.sdkman/bin/sdkman-init.sh" -curl https://sh.rustup.rs -sSf | sh -s -- -y -source $HOME/.cargo/env -rustup default 1.78.0 +# sdk install java 22.0.1-graalce +# sdk use java 22.0.1-graalce +# echo "JAVA_HOME: $JAVA_HOME" + +# # install rust +# curl https://sh.rustup.rs -sSf | sh -s -- -y +# source $HOME/.cargo/env +# rustup default 1.78.0 + +cd /workspace/bindings/python free -h -cargo build --jobs 1 --config net.git-fetch-with-cli=true +#cargo build --jobs 1 --config net.git-fetch-with-cli=true -for PYBIN in /opt/python/cp3[891]*/bin; do +for PYBIN in /opt/python/cp310*/bin; do "${PYBIN}/pip" install maturin - "${PYBIN}/maturin" build -F python -i "${PYBIN}/python" --release + "${PYBIN}/pip" install wheel + "${PYBIN}/maturin" build -i "${PYBIN}/python" --release --out /workspace/bindings/python/dist --compatibility manylinux_2_34 done -for wheel in target/wheels/*.whl; do - auditwheel repair "${wheel}" -done \ No newline at end of file +#/workspace/.github/workflows/patch-wheel-lib-linux.sh /workspace/bindings/python/dist manylinux_2_28 + +# for wheel in /workspace/bindings/python/dist/*.whl; do +# auditwheel repair "${wheel}" +# done \ No newline at end of file diff --git a/.github/workflows/install-graalvm-linux.sh b/.github/workflows/install-graalvm-linux.sh deleted file mode 100755 index 8e071f0..0000000 --- a/.github/workflows/install-graalvm-linux.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -set -e -x - - - -uname -a -apt install -y zip - -curl -s "https://get.sdkman.io" | sh -s -- -y -source "$HOME/.sdkman/bin/sdkman-init.sh" - -sdk install java 22.0.1-graalce -sdk default java 22.0.1-graalce - -echo "GRAALVM_HOME: $GRAALVM_HOME" -echo "JAVA_HOME: $JAVA_HOME" -java --version -native-image --version \ No newline at end of file diff --git a/.github/workflows/install-graalvm-sdkman.sh b/.github/workflows/install-graalvm-sdkman.sh new file mode 100755 index 0000000..b9f6159 --- /dev/null +++ b/.github/workflows/install-graalvm-sdkman.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -e -x + +# Check for correct number of arguments +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + echo " example: $0 22.0.1-graalce" + exit 1 +fi + +# Get the architecture from the input argument +jdk_version=$1 + +uname -a +yum install -y zip + +curl -s "https://get.sdkman.io" | sh -s -- -y +source "root/.sdkman/bin/sdkman-init.sh" + +sdk install java $jdk_version +sdk default java $jdk_version +#sdk default java 22.0.1-graalce + +echo "GRAALVM_HOME: $GRAALVM_HOME" +echo "JAVA_HOME: $JAVA_HOME" +java --version +native-image --version \ No newline at end of file diff --git a/.github/workflows/install-graalvm.sh b/.github/workflows/install-graalvm.sh index 357bc04..8b8f8e1 100755 --- a/.github/workflows/install-graalvm.sh +++ b/.github/workflows/install-graalvm.sh @@ -22,7 +22,7 @@ install_graalvm() { if [ "$dist" == "graalvm" ]; then download_url="https://download.oracle.com/graalvm/${jdk_version}/latest/graalvm-jdk-${jdk_version}_linux-${jdk_arch}_bin.tar.gz" - elif [ "$dist" == "graalvm-ce" ]; then + elif [ "$dist" == "graalvmce" ]; then download_url="https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${jdk_version}.0.1/graalvm-community-jdk-${jdk_version}.0.1_linux-${jdk_arch}_bin.tar.gz" else echo "Unsupported distribution: $dist" @@ -53,7 +53,7 @@ install_graalvm() { # Check for correct number of arguments if [ "$#" -ne 2 ]; then - echo "Usage: $0 " + echo "Usage: $0 " exit 1 fi diff --git a/.github/workflows/release_python.yml b/.github/workflows/release_python.yml index 8bcf5ae..ddd820c 100644 --- a/.github/workflows/release_python.yml +++ b/.github/workflows/release_python.yml @@ -32,34 +32,34 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.10' - - uses: graalvm/setup-graalvm@v1.2.2 - with: - java-version: '22' - distribution: 'graalvm-community' - set-java-home: 'true' - # - name: Graalvm install step - # run: | - # bash .github/workflows/install-graalvm.sh ${{ matrix.platform.target }} graalvm-ce - - name: Graalvm check step - run: | - uname -a - echo "GRAALVM_HOME: $GRAALVM_HOME" - echo "JAVA_HOME: $JAVA_HOME" - java --version - native-image --version + # - uses: graalvm/setup-graalvm@v1.2.2 + # with: + # java-version: '22' + # distribution: 'graalvm-community' + # set-java-home: 'true' + + # - name: Graalvm check step + # run: | + # uname -a + # echo "GRAALVM_HOME: $GRAALVM_HOME" + # echo "JAVA_HOME: $JAVA_HOME" + # java --version + # native-image --version - name: Build wheels uses: PyO3/maturin-action@v1 with: command: build - args: --manifest-path bindings/python/Cargo.toml --release --out bindings/python/dist -i python3.10 --compatibility manylinux_2_34 - #args: --manifest-path bindings/python/Cargo.toml --release --out bindings/python/dist -i python3.10 - #working-directory: "bindings/python" # dont use + #working-directory: "bindings/python" # dont use working dir with docker fails to reapply permission on target dir + #args: --manifest-path bindings/python/Cargo.toml --release --out bindings/python/dist -i python3.10 --compatibility manylinux_2_34 + args: --manifest-path bindings/python/Cargo.toml --release --out bindings/python/dist -i python3.10 sccache: 'false' target: ${{ matrix.platform.target }} - #manylinux: '2_34' - container: 'off' + manylinux: '2_34' + #before-script-linux: .github/workflows/install-graalvm.sh ${{ matrix.platform.target }} graalvmce + before-script-linux: .github/workflows/install-graalvm-sdkman.sh 22.0.1-graalce + docker-options: "-e JAVA_HOME=/root/.sdkman/candidates/java/22.0.1-graalce -e GRAALVM_HOME=/root/.sdkman/candidates/java/22.0.1-graalce" #docker-options: "--mount type=bind,source=/opt/hostedtoolcache,target=/opt/hostedtoolcache -e JAVA_HOME -e GRAALVM_HOME" - name: Patch wheel lib