Skip to content

Commit

Permalink
Workaround permission issue on MacOSX M1 GitHub actions environment
Browse files Browse the repository at this point in the history
Add a parameter to install libhyperonc under a home user directory.
  • Loading branch information
vsbogd committed Apr 26, 2024
1 parent 78804f9 commit c9723d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Build wheels on ${{ matrix.os }}
uses: pypa/[email protected]
env:
CIBW_BEFORE_ALL: sh -c "./python/install-hyperonc.sh -u https://github.com/${{github.repository}}.git -r ${{env.COMMIT_HEAD}}"
CIBW_BEFORE_ALL: sh -c "./python/install-hyperonc.sh -l -u https://github.com/${{github.repository}}.git -r ${{env.COMMIT_HEAD}}"
CIBW_SKIP: "*musllinux*"
with:
package-dir: ./python
Expand Down
12 changes: 10 additions & 2 deletions python/install-hyperonc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ while getopts 'u:r:' opt; do
r)
HYPERONC_REV="$OPTARG"
;;
l)
HYPERONC_PREFIX="${HOME}/.local/lib"
?|h)
echo "Usage: $(basename $0) [-u hyperonc_repo_url] [-r hyperonc_revision]"
echo "Usage: $(basename $0) [-u hyperonc_repo_url] [-r hyperonc_revision] [-l]"
echo "-u hyperonc_repo_url Git repo URL to get hyperonc source code"
echo "-r hyperonc_revision Revision of hyperonc to get from Git"
echo "-l Install hyperonc into ${HOME}/.local/lib"
echo " (MacOSX M1 GitHub actions workaround)"
exit 1
;;
esac
Expand Down Expand Up @@ -46,7 +50,11 @@ git reset --hard FETCH_HEAD
mkdir -p ${HOME}/hyperonc/c/build
cd ${HOME}/hyperonc/c/build
# Rust doesn't support building shared libraries under musllinux environment
cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release ..
CMAKE_ARGS=-DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release
if test ! -z "$HYPERONC_PREFIX"; then
CMAKE_ARGS=$CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=$HYPERONC_PREFIX
fi
cmake $CMAKE_ARGS ..
make
make check
make install

0 comments on commit c9723d1

Please sign in to comment.