Files
neovim/.github/scripts/install_deps.sh
Christian Clason 1ce0ea50a2 ci(macos): skip brew upgrade
Problem: Support for Intel macOS is increasingly being dropped since
Apple itself retired the architecture (with macOS 27 already being
ARM-only). In particular, homebrew is already dropping support, with
some 3rd-party taps like `hashicorp/tap/vagrant` (that are enabled on GH
runners by default) no longer being available. This makes `brew upgrade`
fail on Intel.

Solution: Skip `brew upgrade` in `install_deps.sh`, as we don't rely on
the bleeding edge version of the installed dependencies. This skips
checking the tap (which we don't use) and hence lets the workflows pass.
(It also shaves of some seconds from the CI time.)

Note: This is strictly speaking a GHA issue and should be handled by
adapting the runner images; but since GHA has already announced that
they will drop all Intel macOS images in 2027, this is unlikely to
happen.

It also means that this is a stopgap solution to allow 0.13 to keep Tier
1 support for Intel macOS, but next year we'll have to drop support as
well.
2026-09-04 14:32:01 +02:00

62 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
set -e
while (($# > 0)); do
case $1 in
--test) # install test dependencies
TEST=1
shift
;;
esac
done
OS=$(uname -s)
ARCH=$(uname -m)
if [[ $OS == Linux ]]; then
sudo apt-get update
sudo apt-get install -y build-essential cmake curl gettext ninja-build
if [[ $CC == clang ]]; then
DEFAULT_CLANG_VERSION=$(echo | clang -dM -E - | grep __clang_major | awk '{print $3}')
CLANG_VERSION=21
if ((DEFAULT_CLANG_VERSION >= CLANG_VERSION)); then
echo "Default clang version is $DEFAULT_CLANG_VERSION, which is equal or larger than wanted version $CLANG_VERSION. Aborting!"
exit 1
fi
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh $CLANG_VERSION
# Alternatively could use `./llvm.sh … all` above, but that is heavy/slow.
sudo apt-get install -y clang-tidy-$CLANG_VERSION
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-$CLANG_VERSION 100
sudo update-alternatives --set clang /usr/bin/clang-$CLANG_VERSION
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-$CLANG_VERSION 100
sudo update-alternatives --set clang-tidy /usr/bin/clang-tidy-$CLANG_VERSION
fi
if [[ -n $TEST ]]; then
sudo apt-get install -y locales-all cpanminus attr libattr1-dev fish gdb inotify-tools xdg-utils
# Use default CC to avoid compilation problems when installing Python modules
CC=cc python3 -m pip -q install --user --upgrade --break-system-packages pynvim
# Skip installing npm on aarch64 as it tends to cause intermittent segmentation faults.
# See https://github.com/neovim/neovim/issues/32339.
if [[ $ARCH != aarch64 ]]; then
npm install -g neovim
npm link neovim
fi
fi
elif [[ $OS == Darwin ]]; then
if [[ -n $TEST ]]; then
brew install cpanminus fish fswatch
npm install -g neovim
npm link neovim
# Use default CC to avoid compilation problems when installing Python modules
CC=cc python3 -m pip -q install --user --upgrade --break-system-packages pynvim
fi
fi