Skip to content

Commit

Permalink
No longer need to patch pybind11_vendor
Browse files Browse the repository at this point in the history
  • Loading branch information
light-tech committed Nov 12, 2022
1 parent 2802e63 commit a121d5d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
timeout-minutes: 1200
strategy:
matrix:
platformArch: [macOS] # iOS, iOS_Simulator, iOS_Simulator_M1, macCatalyst, macCatalyst_M1
platformArch: [macOS, iOS, iOS_Simulator, iOS_Simulator_M1, macCatalyst, macCatalyst_M1]
steps:
# https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#viewing-all-properties-of-an-event
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
Expand All @@ -34,14 +34,26 @@ jobs:
cmake-version: '3.23.x'

- name: Fetch cached Python environment
run: curl -OL https://github.com/light-tech/ROS2-On-iOS/releases/download/humble-1.3/python_venv.tar.xz && tar xzf python_venv.tar.xz
run: curl -OL https://github.com/light-tech/ROS2-On-iOS/releases/download/humble-1.3/python_venv.tar.xz

- name: Fetch prebuilt dependencies
run: curl -OL https://github.com/light-tech/ROS2-On-iOS/releases/download/humble-1.3/deps_${{ matrix.platformArch }}.tar.xz
if: ${{ matrix.platformArch == 'macOS' }}

- name: Extract artifacts
run: ./extract_artifacts.sh

- name: Build ROS2
id: build_ros2
run: source ros2PythonEnv/bin/activate && source build_ros2.sh ${{ matrix.platformArch }} && buildRos2Base

- name: Archive ROS2 and dependencies
run: tar cJf ros2_${{ matrix.platformArch }}.tar.xz ros2_${{ matrix.platformArch }}/base/
if: ${{ matrix.platformArch == 'macOS' }}

- name: Archive ROS2 and dependencies
run: tar cJf ros2_${{ matrix.platformArch }}.tar.xz ros2_${{ matrix.platformArch }}/
if: ${{ matrix.platformArch != 'macOS' }}

- name: Publish ROS2 for release
uses: actions/upload-artifact@v3
Expand Down
11 changes: 2 additions & 9 deletions build_ros2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ printPython() {
}

buildRos2Base() {
ros2SystemDependenciesPath=$scriptDir/ros2_$targetPlatform/deps
echo "Build ros2 base ( assuming dependencies are available at $ros2SystemDependenciesPath )"

# printPython
Expand All @@ -68,9 +69,9 @@ buildRos2Base() {
fi

colconArgs+=(--cmake-args -DBUILD_TESTING=NO \
-DFORCE_BUILD_VENDOR_PKG=OFF \
-DTHIRDPARTY=FORCE \
-DCOMPILE_TOOLS=NO \
-DFORCE_BUILD_VENDOR_PKG=ON \
-DBUILD_MEMORY_TOOLS=OFF \
-DRCL_LOGGING_IMPLEMENTATION=rcl_logging_noop)

Expand All @@ -82,14 +83,6 @@ buildRos2Base() {
# as there is no way to link with the ARM version of libpython*.dylib there
# and rclpy and IDL code generation for Python needs that.
vcs import src < $scriptDir/ros2_cli.repos

# Update pybind11 to v2.10.1
local pbcml=src/ros2/pybind11_vendor/CMakeLists.txt
sed -i.bak 's/GIT_TAG .*/GIT_TAG 80dc998efced8ceb2be59756668a7e90e8bef917/g' $pbcml
sed -i.bak 's/PATCH_COMMAND//g' $pbcml
sed -i.bak 's/.* git apply -p1 .*//g' $pbcml
sed -i.bak 's/.*pybind11-2.9.1-fix-windows-debug.patch.*//g' $pbcml
# cat $pbcml
fi

colconArgs+=(-DCMAKE_PREFIX_PATH=$ros2SystemDependenciesPath)
Expand Down

0 comments on commit a121d5d

Please sign in to comment.