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

tools/ci/platforms/darwin.sh: Port NuttX CI Job to macOS-14 #14691

Merged
merged 1 commit into from
Nov 7, 2024
Merged
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
30 changes: 24 additions & 6 deletions tools/ci/platforms/darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

set -e
set -o xtrace
osarch=$(uname -m)

add_path() {
PATH=$1:${PATH}
Expand Down Expand Up @@ -80,16 +81,29 @@ avr_gcc_toolchain() {
command avr-gcc --version
}

autoconf_brew() {
if ! type autoconf > /dev/null 2>&1; then
brew install autoconf
fi

command autoconf --version
}

binutils() {
mkdir -p "${NUTTXTOOLS}"/bintools/bin
add_path "${NUTTXTOOLS}"/bintools/bin

if ! type objcopy > /dev/null 2>&1; then
brew install binutils
mkdir -p "${NUTTXTOOLS}"/bintools/bin
# It is possible we cached prebuilt but did brew install so recreate
# symlink if it exists
rm -f "${NUTTXTOOLS}"/bintools/bin/objcopy
ln -s /usr/local/opt/binutils/bin/objcopy "${NUTTXTOOLS}"/bintools/bin/objcopy
if [ "X$osarch" == "Xarm64" ]; then
rm -f "${NUTTXTOOLS}"/bintools/bin/objcopy
ln -s /opt/homebrew/opt/binutils/bin/objcopy "${NUTTXTOOLS}"/bintools/bin/objcopy
else
rm -f "${NUTTXTOOLS}"/bintools/bin/objcopy
ln -s /usr/local/opt/binutils/bin/objcopy "${NUTTXTOOLS}"/bintools/bin/objcopy
fi
fi

command objcopy --version
Expand All @@ -105,7 +119,7 @@ bloaty() {
# https://github.com/google/bloaty/pull/326
git checkout 52948c107c8f81045e7f9223ec02706b19cfa882
mkdir -p "${NUTTXTOOLS}"/bloaty
cmake -B build/bloaty -D BLOATY_PREFER_SYSTEM_CAPSTONE=NO -D CMAKE_INSTALL_PREFIX="${NUTTXTOOLS}"/bloaty
cmake -B build/bloaty -GNinja -D BLOATY_PREFER_SYSTEM_CAPSTONE=NO -D CMAKE_INSTALL_PREFIX="${NUTTXTOOLS}"/bloaty
cmake --build build/bloaty
cmake --build build/bloaty --target install
cd "${NUTTXTOOLS}"
Expand Down Expand Up @@ -205,7 +219,11 @@ python_tools() {
echo "export PIP_USER=yes" >> "${NUTTXTOOLS}"/env.sh
echo "export PYTHONUSERBASE=${NUTTXTOOLS}/pylocal" >> "${NUTTXTOOLS}"/env.sh
add_path "${PYTHONUSERBASE}"/bin


if [ "X$osarch" == "Xarm64" ]; then
python3 -m venv --system-site-packages /opt/homebrew
fi

# workaround for Cython issue
# https://github.com/yaml/pyyaml/pull/702#issuecomment-1638930830
pip3 install "Cython<3.0"
Expand Down Expand Up @@ -361,7 +379,7 @@ install_build_tools() {
mkdir -p "${NUTTXTOOLS}"
echo "#!/usr/bin/env sh" > "${NUTTXTOOLS}"/env.sh

install="arm_gcc_toolchain arm64_gcc_toolchain avr_gcc_toolchain binutils bloaty elf_toolchain gen_romfs gperf kconfig_frontends mips_gcc_toolchain ninja_brew python_tools riscv_gcc_toolchain rust dlang zig xtensa_esp32_gcc_toolchain u_boot_tools util_linux wasi_sdk c_cache"
install="ninja_brew autoconf_brew arm_gcc_toolchain arm64_gcc_toolchain avr_gcc_toolchain binutils bloaty elf_toolchain gen_romfs gperf kconfig_frontends mips_gcc_toolchain python_tools riscv_gcc_toolchain rust dlang zig xtensa_esp32_gcc_toolchain u_boot_tools util_linux wasi_sdk c_cache"

mkdir -p "${NUTTXTOOLS}"/homebrew
export HOMEBREW_CACHE=${NUTTXTOOLS}/homebrew
Expand Down
Loading