Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macos: pack thirdparty libs to pkg #3703

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions .github/workflows/build-test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:

jobs:
macos-build-test:
timeout-minutes: 70
timeout-minutes: 90
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
Expand All @@ -36,14 +36,17 @@ jobs:
runner: macos-13 # github hosted
config: Release
brewpath: /usr/local
codesign-options: "--skip-sign"
- os: github-arm
runner: macos-latest # github hosted
config: Debug
brewpath: /opt/homebrew
codesign-options: "--skip-sign"
- os: arm
runner: macos-arm-build # self-hosted
config: Release
brewpath: /opt/homebrew
codesign-options: ""
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
Expand Down Expand Up @@ -150,14 +153,19 @@ jobs:
if: ${{ env.UPLOAD_TEST_ARTIFACTS == 'true' && env.INTERNAL_BUILD == 'true' && !cancelled() }}
run: aws s3 cp ./pytest_temp 's3://test-artifacts-git/tests/${{github.run_id}}/macos/${{matrix.os}}' --recursive

- name: Create Pkg
if: ${{ inputs.UPLOAD_ARTIFACTS }}
- name: Create MeshLib.framework
if: ${{ inputs.UPLOAD_ARTIFACTS && env.INTERNAL_BUILD == 'true' && matrix.config == 'Release'}}
run: |
./scripts/distribution_apple.sh
mv MeshLib_.pkg meshlib_${{matrix.os}}.pkg
./scripts/distribution_apple_framework.sh

- name: Codesign framework
if: ${{ inputs.UPLOAD_ARTIFACTS && env.INTERNAL_BUILD == 'true' && matrix.config == 'Release'}}
run: |
./scripts/distribution_apple_pkg.sh ${{matrix.codesign-options}}
mv meshlib.pkg meshlib_${{matrix.os}}.pkg

- name: Upload Macos Distribution
if: ${{ inputs.UPLOAD_ARTIFACTS }}
if: ${{ inputs.UPLOAD_ARTIFACTS && env.INTERNAL_BUILD == 'true'}}
uses: actions/upload-artifact@v4
with:
name: Distributives_macos-${{matrix.os}}
Expand Down
41 changes: 26 additions & 15 deletions .github/workflows/test-distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,17 @@ jobs:


macos-test:
runs-on: macos-13
timeout-minutes: 30
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
os: [ x64, arm]
include:
- os: x64
runner: macos-13 # github hosted
- os: arm
runner: macos-latest # github hosted
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -157,22 +166,31 @@ jobs:
uses: robinraju/[email protected]
with:
releaseId: ${{inputs.release_id}}
fileName: "*x64.pkg"
fileName: "*${{matrix.os}}.pkg"

- name: Install Pkg
run: |
sudo installer -pkg meshlib_*x64.pkg -target /
xargs brew install < /Library/Frameworks/MeshLib.framework/Versions/Current/requirements/macos.txt
run: sudo installer -pkg meshlib_*${{matrix.os}}.pkg -target /

# [error] NSGL: Failed to find a suitable pixel format
#- name: Run MeshViewer
#if: always()
#run: /Library/Frameworks/MeshLib.framework/Versions/Current/bin/MeshViewer -tryHidden -noEventLoop -unloadPluginsAtEnd
- name: Run MeshViewer
if: always()
run: /Library/Frameworks/MeshLib.framework/Versions/Current/bin/MeshViewer -tryHidden -noEventLoop -unloadPluginsAtEnd

- name: Show meshconv help
if: always()
run: /Library/Frameworks/MeshLib.framework/Versions/Current/bin/meshconv --help

- name: Build C examples
if: always()
working-directory: examples/c-examples
run: |
cmake -S . -B build -DCMAKE_C_COMPILER=/usr/bin/clang && \
cmake --build build

- name: Install MeshLib requirements
run: |
xargs brew install < /Library/Frameworks/MeshLib.framework/Versions/Current/requirements/macos.txt || true

- name: Build C++ examples
if: always()
working-directory: examples/cpp-examples
Expand All @@ -182,10 +200,3 @@ jobs:
cmake .. -DCMAKE_CXX_COMPILER=/usr/bin/clang++ && \
cmake --build . && \
./MeshModification

- name: Build C examples
if: always()
working-directory: examples/c-examples
run: |
cmake -S . -B build -DCMAKE_C_COMPILER=/usr/bin/clang && \
cmake --build build
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ ENDIF()
IF(APPLE)
# need to hardcode some path to fix wheel (no option to pass path)
# TODO: revise
set(CMAKE_INSTALL_RPATH "@loader_path;@loader_path/..;@loader_path/../lib;@loader_path/../lib/lib;@loader_path/meshlib;${MESHLIB_THIRDPARTY_ROOT_DIR}/lib;${CMAKE_BINARY_DIR}/bin")
set(CMAKE_INSTALL_RPATH "@loader_path/../lib;@loader_path;@loader_path/..;@loader_path/meshlib;${MESHLIB_THIRDPARTY_ROOT_DIR}/lib;${CMAKE_BINARY_DIR}/bin")
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)

IF(BUILD_TESTING)
Expand Down
4 changes: 4 additions & 0 deletions cmake/Modules/CompilerOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,7 @@ IF(MR_EMSCRIPTEN)
# FIXME: comment required
add_compile_definitions(EIGEN_STACK_ALLOCATION_LIMIT=0)
ENDIF() # MR_EMSCRIPTEN

IF(APPLE)
set(MR_MIN_BOOST_VERSION "1.86.0")
ENDIF()
Loading
Loading