mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 08:40:30 +08:00
feat(setup): install macOS Gazebo from a locked conda-forge environment
Homebrew rebuilds and drops the gz bottles whenever homebrew-core bumps protobuf or abseil, which breaks the macOS Gazebo install until the pins catch up. conda-forge keeps every package it has published, so Tools/setup/macos/pixi.toml and its lock install the same gz, protobuf, abseil, OpenCV and GStreamer binaries until the lock is updated on purpose. OpenCV is the headless build, and GStreamer brings the good, bad and ugly plugin sets the gz camera plugin's pipeline uses. macos.sh installs the environment with pixi and loads it from the venv activation through a small script, since pixi shell-hook would export the installing shell's PATH. The build and the gz launch do not depend on that activation: CMake searches the environment like it pins the .venv Python, and px4-rc.gzsim sources gz_env.sh before it looks for gz, which loads the environment when it is not already active and puts its lib dir ahead of Homebrew's in the dyld fallback path. conda-forge's gz-transport13 does not pull in cppzmq, so the manifest lists it. The osrf/simulation pin, the protobuf pin and the weekly bot that refreshed them are removed. The homebrew-core commit moves into homebrew-pins.txt unchanged. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
1 parent
de9c69316e
commit
a8b0e91ebe
15 files changed
+11219
-584
No files matched your search
@@ -31,7 +31,7 @@ jobs:
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/Library/Caches/Homebrew/downloads
|
||||
key: macos-homebrew-${{ runner.arch }}-${{ hashFiles('Tools/setup/macos.sh', 'Tools/setup/macos_ci_pins.sh', 'Tools/setup/homebrew-pins.txt', 'Tools/setup/protobuf-pin.txt', 'Tools/setup/gz-tap-pin.txt') }}
|
||||
key: macos-homebrew-${{ runner.arch }}-${{ hashFiles('Tools/setup/macos.sh', 'Tools/setup/macos_ci_pins.sh', 'Tools/setup/homebrew-pins.txt') }}
|
||||
restore-keys: |
|
||||
macos-homebrew-${{ runner.arch }}-
|
||||
|
||||
@@ -61,7 +61,9 @@ jobs:
|
||||
max-size: 200M
|
||||
|
||||
- name: Build px4_sitl
|
||||
run: make px4_sitl
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
make px4_sitl
|
||||
|
||||
- name: Cache - Stats after px4_sitl
|
||||
run: ccache -s
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
name: macOS - Refresh gz tap pin
|
||||
|
||||
# Tools/setup/macos.sh pins osrf/simulation to Tools/setup/gz-tap-pin.txt so
|
||||
# --sim-tools pours Gazebo bottles instead of compiling them, and protobuf to
|
||||
# Tools/setup/protobuf-pin.txt so those bottles' generated headers still
|
||||
# compile (see those files). OSRF advances the tap several times a week and
|
||||
# homebrew-core moves protobuf on its own schedule, so once a week this moves
|
||||
# the tap pin to the newest commit whose Gazebo formulae are all bottled,
|
||||
# repoints the protobuf pin at whatever those bottles were built against, and
|
||||
# opens a PR for it. Tools/ci/refresh_gz_tap_pin.rb does the work under
|
||||
# Homebrew's Ruby and can be run by hand on any Mac.
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 9 * * 1' # Mondays at 09:00 UTC
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
refresh:
|
||||
# Same runner as the MacOS build.
|
||||
runs-on: macos-15
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Find the newest fully bottled osrf/simulation commit
|
||||
id: pin
|
||||
env:
|
||||
# Walking homebrew-core's protobuf history goes through the GitHub
|
||||
# API, which is rate limited per IP for runners without this.
|
||||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: brew ruby Tools/ci/refresh_gz_tap_pin.rb
|
||||
|
||||
- name: Open PR with the new pins
|
||||
if: steps.pin.outputs.needs_bump == 'true'
|
||||
uses: peter-evans/create-pull-request@v8
|
||||
with:
|
||||
# The PX4BuildBot PAT rather than GITHUB_TOKEN so the PR runs the
|
||||
# MacOS build workflow, which is what verifies the new pin.
|
||||
token: ${{ secrets.PX4BUILTBOT_PERSONAL_ACCESS_TOKEN }}
|
||||
author: ${{ secrets.PX4BUILDBOT_USER }} <${{ secrets.PX4BUILDBOT_EMAIL }}>
|
||||
committer: ${{ secrets.PX4BUILDBOT_USER }} <${{ secrets.PX4BUILDBOT_EMAIL }}>
|
||||
branch: px4buildbot/gz-tap-pin
|
||||
delete-branch: true
|
||||
add-paths: |
|
||||
Tools/setup/gz-tap-pin.txt
|
||||
Tools/setup/protobuf-pin.txt
|
||||
commit-message: "build(macos): ${{ steps.pin.outputs.summary }}"
|
||||
title: "build(macos): ${{ steps.pin.outputs.summary }}"
|
||||
body: |
|
||||
Weekly check of the two macOS Gazebo pins. `Tools/setup/gz-tap-pin.txt` holds osrf/simulation at the newest commit where every formula `macos.sh --sim-tools` poured at the previous pin still has a bottle Homebrew pours on macos-15 and every bottle tarball is still served. `Tools/setup/protobuf-pin.txt` holds protobuf at the version those bottles were built against, which is the only one their generated headers compile against.
|
||||
|
||||
| pin | from | to |
|
||||
| --- | --- | --- |
|
||||
| osrf/simulation | `${{ steps.pin.outputs.old_pin }}` | `${{ steps.pin.outputs.new_pin }}` |
|
||||
| protobuf | `${{ steps.pin.outputs.old_protobuf_version }}` (`${{ steps.pin.outputs.old_protobuf_pin }}`) | `${{ steps.pin.outputs.protobuf_version }}` (`${{ steps.pin.outputs.new_protobuf_pin }}`) |
|
||||
|
||||
An empty "to" means that pin did not move.
|
||||
|
||||
Tap changes: https://github.com/osrf/homebrew-simulation/compare/${{ steps.pin.outputs.old_pin }}...${{ steps.pin.outputs.new_pin || steps.pin.outputs.old_pin }}
|
||||
|
||||
The MacOS build legs on this PR are the real test. Merge once both pour the gz bottles without compiling anything from osrf/simulation.
|
||||
Reference in new issue
Block a user