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

Maintenance: Updated Supported MacOS versions #891

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0a7deb8
Maintenance: Updated Supported MacOS versions
BenjamenMeyer Oct 5, 2024
7899914
Merge branch 'master' into maintenance_update-os-base_macos
BenjamenMeyer Oct 12, 2024
b14d19a
Merge branch 'master' into maintenance_update-os-base_macos
BenjamenMeyer Dec 11, 2024
336a86e
Refactor MacOS CI Builds
BenjamenMeyer Dec 11, 2024
030e60c
Checkout code before relying on what's in the repo
BenjamenMeyer Dec 11, 2024
fcb2822
Bash via `env bash`
BenjamenMeyer Dec 11, 2024
40dbdea
proper OS matching
BenjamenMeyer Dec 11, 2024
e707379
Bug Fix (Mac): Homebrew installation
BenjamenMeyer Dec 15, 2024
5ee6683
Bugfix (Mac): Set Python specific env vars
BenjamenMeyer Dec 15, 2024
6469e19
Diagnostic: What is installed with Homebrew?
BenjamenMeyer Dec 15, 2024
e3ab6bb
Diagnostic: use python-config
BenjamenMeyer Dec 15, 2024
514ee1a
Diagnostic: Lock to Python 3.12 in Homebrew
BenjamenMeyer Dec 15, 2024
73fb114
Bug Fix: correct python package
BenjamenMeyer Dec 15, 2024
f94c11d
Bug Fix: Python3 version
BenjamenMeyer Dec 15, 2024
f996cda
Diagnostic: Output new and updated env vars
BenjamenMeyer Dec 15, 2024
8eba274
Bug Fix: fixing the python version
BenjamenMeyer Dec 15, 2024
6227697
Correct path to versioned Python version
BenjamenMeyer Dec 15, 2024
3b035e7
Bug Fix: python config application
BenjamenMeyer Dec 15, 2024
05c71b8
Peer Review
BenjamenMeyer Dec 22, 2024
05933a1
Bug Fix: little more generous on Python version
BenjamenMeyer Dec 22, 2024
83ec5d5
Peer Review
BenjamenMeyer Dec 24, 2024
29245d9
Bug Fix
BenjamenMeyer Dec 24, 2024
47c2808
Bug Fix: Update to C++ 14
BenjamenMeyer Dec 24, 2024
ee1c18c
Cleanup
BenjamenMeyer Dec 24, 2024
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
56 changes: 20 additions & 36 deletions .github/workflows/macos-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,49 +21,28 @@ jobs:
fail-fast: false
matrix:
os:
#- macos-11
- macos-12
# x86-64
- macos-13
# M1 processor
#- macos-14
compiler:
- clang
- gcc
homebrew-gl:
- true
# - false
homebrew-al:
- true
- false

steps:
# specific setup for Python on Mac to ensure Python Version align
- name: Python Setup on Mac
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: 3.12.8
BenjamenMeyer marked this conversation as resolved.
Show resolved Hide resolved

# The following dependencies are already present within macos-* images:
# - clang (llvm)
# - cmake
# - expat
# - gcc
# - git
# - jpeg
# - libpng
# - libvorbis
# - python
- name: Install dependencies using homebrew
run: brew install boost-python3 gtk+3 gtkglext sdl

# The following Apple-provided libraries are deprecated:
# * OpenGL as of macOS 10.14
# * GLUT as of macOS 10.9
- name: Optionally install homebrewed OpenGL and GLUT
if: ${{ matrix.homebrew-gl }}
run: |
brew install mesa mesa-glu freeglut
ln -s /usr/local/include/GL /usr/local/include/OpenGL
ln -s /usr/local/include/GL /usr/local/include/GLUT
# ln -s /usr/local/lib/libGL.dylib /usr/local/lib/libOpenGL.dylib
# find /usr/local/lib/ -iname '*gl*.dylib'

# The Apple-provided OpenAL is deprecated as of macOS 10.15
- name: Optionally install homebrewed OpenAL
if: ${{ matrix.homebrew-al }}
run: brew install openal-soft
# MacOS has a Developers Tools package from Apple that gets installed which
# provides some minimal functionality:
# XCode (which uses CLang/LLVM)
# git
- name: Install the latest version of Bash so we can rely on it
run: brew install bash

- name: Check out repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
Expand All @@ -76,6 +55,11 @@ jobs:
if: github.event.pull_request
run: git checkout HEAD^2

- name: Bootstrap MacOS
run: script/bootstrap-mac.sh

# Note: it might be good to use a step to detect where OpenAL-Soft is
# installed and set it to a GHA variable that can be consumed below
- name: Build it
env:
MY_OS_NAME: macos
Expand Down
6 changes: 5 additions & 1 deletion engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ CONFIGURE_FILE(src/version.h.in ${Vega_Strike_BINARY_DIR}/setup/src/include/vers

MESSAGE("== Vega Strike Version: ${VEGASTRIKE_VERSION_LONG_STR}")

SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD 14)
SET(CMAKE_CXX_STANDARD_REQUIRED TRUE)
SET(CMAKE_CXX_EXTENSIONS ON)
SET(CMAKE_C_STANDARD 11)
Expand Down Expand Up @@ -159,6 +159,10 @@ SET(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
SET(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
INCLUDE(InstallRequiredSystemLibraries)

IF (XCODE)
SET(CMAKE_FIND_FRAMEWORK "LAST")
ENDIF (XCODE)

IF (UNIX)
INCLUDE_DIRECTORIES(
${Vega_Strike_SOURCE_DIR}/src
Expand Down
79 changes: 79 additions & 0 deletions script/bootstrap-mac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/usr/bin/env bash
set -e

DETECT_MAC_OS_VERSION=$(sw_vers -productVersion | cut -f 1,2 -d '.')
echo "Detected Mac OS X Version: ${DETECT_MAC_OS_VERSION}"

MAC_OS_NAME="UNKOWN"
case "${DETECT_MAC_OS_VERSION}" in
"10.13")
MAC_OS_NAME="High_Sierra"
echo "Unsupported Mac Version"
exit 2
;;
"10.14")
MAC_OS_NAME="Mojave"
echo "Unsupported Mac Version"
exit 2
;;
"10.15")
MAC_OS_NAME="Catalina"
echo "Unsupported Mac Version"
exit 2
;;
"11.*")
MAC_OS_NAME="Big_Sur"
echo "Unsupported Mac Version"
exit 2
;;
"12.*")
MAC_OS_NAME="Monterey"
echo "Unsupported Mac Version"
exit 2
;;
"13.0"|"13.1"|"13.2"|"13.3"|"13.4"|"13.5"|"13.6"|"13.7")
MAC_OS_NAME="Ventura"
;;
"14.0"|"14.1"|"14.2"|"14.3"|"14.4"|"14.5"|"14.6"|"14.7")
MAC_OS_NAME="Sonoma"
;;
"15.0"|"15.1"|"15.2"|"15.3"|"15.4"|"15.5"|"15.6"|"15.7")
MAC_OS_NAME="Sequoia"
;;
*)
echo "Unknown Mac Release: ${DETECT_MAC_OS_VERSION}"
exit 1
;;
esac

echo "Detected Mac OS X ${DETECT_MAC_OS_VERSION} - ${MAC_OS_NAME}"
# While we may be able to assume some other dependencies there does seem to be
# some changes between versions of MacOS on which are provided by default; so
# aside from the two above we should just go ahead an install everything ourselves.

# Install the stuff we know needs to get installed all the time
brew install \
gcc \
cmake \
python3 \
BenjamenMeyer marked this conversation as resolved.
Show resolved Hide resolved
boost-python3 \
jpeg \
libpng \
gtk+3 \
gtkglext \
sdl2

# The following Apple-provided libraries are deprecated:
# * OpenGL as of macOS 10.14
# * GLUT as of macOS 10.9
brew install mesa mesa-glu freeglut
ln -s $(brew --prefix)/include/GL $(brew --prefix)/include/OpenGL
ln -s $(brew --prefix)/include/GL $(brew --prefix)/include/GLUT
# ln -s $(brew --prefix)/lib/libGL.dylib $(brew --prefix)/lib/libOpenGL.dylib
# find $(brew --prefix)/lib/ -iname '*gl*.dylib'

# MacOS 13+ needs Vorbis support
brew install vorbis-tools

# The Apple-provided OpenAL is deprecated as of macOS 10.15
brew install openal-soft freealut
35 changes: 35 additions & 0 deletions script/cibuild
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,41 @@ then
docker rm $DOCKER_CONTAINER_NAME
elif [ "$MY_OS_NAME" == "macos" ]
then
# setup the environment for Homebrew
BUILD_WITH_PYTHON_VERSION="3.12"

HOMEBREW_PREFIX="$(brew --prefix)"
HOMEBREW_BIN="${HOMEBREW_PREFIX}/bin"
HOMEBREW_PYTHON_BIN="$(brew --prefix python)/libexec/bin"

# NOTE: we do not support builds on MacOS ARM right now as there are some linker errors.
# Any help in making those work would be appreciated.

echo "Build With Python Version: ${BUILD_WITH_PYTHON_VERSION}"
echo " Homebrew Prefix: ${HOMEBREW_PREFIX}"
echo " Homebrew Bin: ${HOMEBREW_BIN}"
echo " Homebrew Python Bin: ${HOMEBREW_PYTHON_BIN}"

# Homebrew tooling needs to come first in the path search
export PATH=${HOMEBREW_BIN}:${HOMEBREW_PYTHON_BIN}:${PATH}

HOMEBREW_PYTHON_VERSION=$(${HOMEBREW_BIN}/python${BUILD_WITH_PYTHON_VERSION} -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
echo " Detected Python Version: ${HOMEBREW_PYTHON_VERSION}"

# Ensure it uses the correct Python version
# Do not set PYTHONHOME or PYTHONPATH; otherwise some odd errors will come up as
# it's not necessary
export HOMEBREW_PYTHON3_CFLAGS="$(${HOMEBREW_BIN}/python${BUILD_WITH_PYTHON_VERSION}-config --cflags)"
export HOMEBREW_PYTHON3_LDFLAGS="$(${HOMEBREW_BIN}/python${BUILD_WITH_PYTHON_VERSION}-config --ldflags)"
echo " Homebrew Python CFlags: ${HOMEBREW_PYTHON3_CLFLAGS}"
echo " Homebrew Python LDFlags: ${HOMEBREW_PYTHON3_LDFLAGS}"

# Homebrew needs certain flags set so its installation parts are found
export CFLAGS="-I${HOMEBREW_PREFIX}/include ${HOMEBREW_PYTHON3_CFLAGS} ${CFLAGS}"
export LDFLAGS="-L${HOMEBREW_PREFIX}/lib ${HOMEBREW_PYTHON3_LDFLAGS} ${LDFLAGS}"
echo " CFlags: ${CFLAGS}"
echo " LDFlags: ${LDFLAGS}"

script/build -DCMAKE_BUILD_TYPE=RelWithDebInfo $@
# On macOS, the following is done by the calling CI workflow
# ctest -V
Expand Down
Loading