mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 16:51:16 +08:00
ci(macos): stop pinning Homebrew to older commits
The macOS job checked out Homebrew 7.0.6 and a 2026-09-18 package index on a runner image whose packages a newer Homebrew had installed. The image refreshed on 2026-10-29 with openssl@4 as the linked default, and the pinned Homebrew deadlocked on its own openssl@4 lock while linking the pinned openssl@3 for ccache, so ccache never installed and every run since failed. Homebrew fixed the nested lock in 7.0.10, but any pin older than the image repeats the problem at the next refresh. The pins were added to keep Gazebo on bottles built against one protobuf. Gazebo now comes from the conda-forge lock in macos/pixi.toml, so install from the Homebrew and index the image ships, with auto-update off so the index stays the one its packages came from. macos.sh goes back to plain brew tap and cask installs, which is what it already does on developer machines. Assisted-by: Claude:claude-mythos-5-1 Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
1 parent
a3c65d0761
commit
d6cd502f2d
4 files changed
+7
-104
No files matched your search
@@ -13,9 +13,7 @@ on:
|
||||
- '**'
|
||||
paths:
|
||||
- 'Tools/setup/macos.sh'
|
||||
- 'Tools/setup/macos_ci_pins.sh'
|
||||
- 'Tools/setup/macos/**'
|
||||
- 'Tools/setup/homebrew-pins.txt'
|
||||
- 'Tools/setup/requirements.txt'
|
||||
- '.github/workflows/compile_macos.yml'
|
||||
schedule:
|
||||
@@ -50,12 +48,12 @@ jobs:
|
||||
|
||||
- name: setup
|
||||
env:
|
||||
# Read the checked-out package repos. The default is a live index,
|
||||
# which ignores those checkouts.
|
||||
# Skip `brew update`. The image's Homebrew and package index are
|
||||
# the ones its preinstalled packages came from, and a newer index
|
||||
# only adds upgrades. Pinning older commits instead put an older
|
||||
# Homebrew in charge of packages a newer one had installed.
|
||||
HOMEBREW_NO_AUTO_UPDATE: "1"
|
||||
HOMEBREW_NO_INSTALL_FROM_API: "1"
|
||||
run: |
|
||||
./Tools/setup/macos_ci_pins.sh
|
||||
./Tools/setup/macos.sh --sim-tools
|
||||
echo "${{ github.workspace }}/.venv/bin" >> $GITHUB_PATH
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
# Commits macOS CI checks out before installing. A newer package is a change
|
||||
# to this file. Gazebo does not come from Homebrew; see macos/pixi.toml.
|
||||
#
|
||||
# Homebrew 7.0.6. The others are the tips of those repos on 2026-09-18.
|
||||
#
|
||||
# <name> <commit>
|
||||
brew 570982948a8a194f0f42f43f4a5bce2d1c9f64cb
|
||||
homebrew/core 88d598cf1d2dba7063fbc29d441d072963481123
|
||||
osx-cross/arm e3bb686fb159097c2fb3ee6d1acb3f7e4dd8a184
|
||||
px4/px4 f78b7a3d5aa98dc23171a63f2c2958ce69f98889
|
||||
+3
-18
@@ -37,20 +37,6 @@ do
|
||||
fi
|
||||
done
|
||||
|
||||
# Leave a checkout that is already there. `brew tap` on one would try to
|
||||
# unshallow it, and CI has already checked these repos out at a commit.
|
||||
brew_tap() {
|
||||
local name="$1"
|
||||
local user="${name%%/*}"
|
||||
local repo="${name#*/}"
|
||||
local path
|
||||
path="$(brew --repo)/Library/Taps/${user}/homebrew-${repo}"
|
||||
if [[ -d "${path}/.git" ]]; then
|
||||
return 0
|
||||
fi
|
||||
brew tap "$name"
|
||||
}
|
||||
|
||||
echo "[macos.sh] Installing the development dependencies for the PX4 Autopilot"
|
||||
|
||||
if ! command -v brew &> /dev/null
|
||||
@@ -92,8 +78,8 @@ if brew trust --help &> /dev/null; then
|
||||
brew trust PX4/px4
|
||||
fi
|
||||
|
||||
brew_tap osx-cross/arm
|
||||
brew_tap PX4/px4
|
||||
brew tap osx-cross/arm
|
||||
brew tap PX4/px4
|
||||
|
||||
# Package list. This replaces the px4-dev meta-formula, which is kept
|
||||
# as a deprecated no-op upstream. See PX4/homebrew-px4 for history.
|
||||
@@ -203,8 +189,7 @@ if [[ $INSTALL_SIM == "--sim-tools" ]]; then
|
||||
# XQuartz is required for Gazebo GUI display on macOS.
|
||||
if ! brew list --cask xquartz &> /dev/null; then
|
||||
echo "[macos.sh] Installing XQuartz (required for Gazebo display)"
|
||||
# XQuartz is not in the pinned package repos.
|
||||
env -u HOMEBREW_NO_INSTALL_FROM_API brew install --cask xquartz
|
||||
brew install --cask xquartz
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Check out the Homebrew repos the macOS CI install reads, at the commits
|
||||
# recorded next to this script. `brew install` otherwise follows the live
|
||||
# package list and ignores a checkout.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
|
||||
export HOMEBREW_NO_AUTO_UPDATE=1
|
||||
export HOMEBREW_NO_INSTALL_FROM_API=1
|
||||
|
||||
if ! command -v brew >/dev/null 2>&1; then
|
||||
echo "macos_ci_pins.sh: brew is not installed" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pin_sha() {
|
||||
local name="$1"
|
||||
grep -E "^${name}[[:space:]]+" "${DIR}/homebrew-pins.txt" | awk '{print $2}'
|
||||
}
|
||||
|
||||
fetch_and_checkout() {
|
||||
local path="$1"
|
||||
local sha="$2"
|
||||
|
||||
if [[ -z "$sha" ]]; then
|
||||
echo "macos_ci_pins.sh: no commit for ${path}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "macos_ci_pins.sh: ${path} ${sha}"
|
||||
git -C "$path" fetch -q --depth 1 origin "$sha"
|
||||
git -C "$path" checkout -q -f --detach "$sha"
|
||||
}
|
||||
|
||||
# The Homebrew install itself is already a git repo on the runner. Do not
|
||||
# recreate that directory: it is the prefix every package lives under.
|
||||
checkout_brew() {
|
||||
local sha="$1"
|
||||
|
||||
if [[ ! -d "${BREW_REPO}/.git" ]]; then
|
||||
echo "macos_ci_pins.sh: ${BREW_REPO} is not a git repo" >&2
|
||||
exit 1
|
||||
fi
|
||||
fetch_and_checkout "$BREW_REPO" "$sha"
|
||||
}
|
||||
|
||||
clone_at() {
|
||||
local path="$1"
|
||||
local url="$2"
|
||||
local sha="$3"
|
||||
|
||||
if [[ ! -d "${path}/.git" ]]; then
|
||||
rm -rf "$path"
|
||||
mkdir -p "$(dirname "$path")"
|
||||
git init -q "$path"
|
||||
git -C "$path" remote add origin "$url"
|
||||
fi
|
||||
fetch_and_checkout "$path" "$sha"
|
||||
}
|
||||
|
||||
BREW_REPO=$(brew --repo)
|
||||
TAPS="${BREW_REPO}/Library/Taps"
|
||||
|
||||
checkout_brew "$(pin_sha brew)"
|
||||
clone_at "${TAPS}/homebrew/homebrew-core" "https://github.com/Homebrew/homebrew-core" "$(pin_sha homebrew/core)"
|
||||
clone_at "${TAPS}/osx-cross/homebrew-arm" "https://github.com/osx-cross/homebrew-arm" "$(pin_sha osx-cross/arm)"
|
||||
clone_at "${TAPS}/px4/homebrew-px4" "https://github.com/PX4/homebrew-px4" "$(pin_sha px4/px4)"
|
||||
Reference in new issue
Block a user