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

0.9.x Build Troubleshooting Early December 2023 SGT #821

Closed
Show file tree
Hide file tree
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
12 changes: 9 additions & 3 deletions .github/workflows/Windows-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
#VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'
VCPKG_DEFAULT_TRIPLET: x64-windows
VCPKG_DEFAULT_HOST_TRIPLET: x64-windows
PYTHONHOME: '${{ github.workspace }}/v/packages/python3_x64-windows/tools/python3'
#PYTHONHOME: '${{ github.workspace }}/v/packages/python3_x64-windows/tools/python3'

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -51,6 +51,12 @@ jobs:
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

- name: Set up Python
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 #v4.7.1
with:
python-version: '3.11.5'
check-latest: true

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
Expand All @@ -60,9 +66,9 @@ jobs:
shell: bash

- name: install-cmake
uses: lukka/get-cmake@359fbae4b163fa01633e6de228fa7f2a31ab1fc7 #v3.26.1
uses: lukka/get-cmake@4865386b66955d11be0abf8c112d0230023e742a #v3.27.9
with:
cmakeVersion: 3.26.1
cmakeVersion: 3.27.9
ninjaVersion: 1.11.1

# # Restore vcpkg from the GitHub Action cache service. Note that packages are restored by vcpkg's binary caching
Expand Down
63 changes: 38 additions & 25 deletions .github/workflows/macos-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
continue-on-error: true

defaults:
run:
Expand All @@ -21,19 +20,26 @@ jobs:
fail-fast: false
matrix:
os:
#- macos-11
- macos-12
compiler:
- clang
- gcc
python-version:
- 3.12
homebrew-gl:
- true
# - false
homebrew-al:
- true
- false
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_UPGRADE: 1
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
PYTHON_VERSION_STRING: "python@${{ matrix.python-version }}"

steps:
- name: Check out repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
fetch-depth: 2
submodules: false

# The following dependencies are already present within macos-* images:
# - clang (llvm)
Expand All @@ -45,43 +51,50 @@ jobs:
# - libpng
# - libvorbis
# - python
#
# Note, though, that the Python version "varies between runners and can be changed unexpectedly",
# according to https://github.com/actions/setup-python#basic-usage .
# Hence the need to specify a particular Python version.
#- name: Set up Python
# uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 #v4.7.1
# with:
# python-version: ${{ matrix.python-version }}
# check-latest: true

- name: Install dependencies using homebrew
run: brew install boost-python3 gtk+3 gtkglext sdl
run: |
brew update
. ./script/brew-install-for-cmake.sh openssl@3 0
. ./script/brew-install-for-cmake.sh $PYTHON_VERSION_STRING 0
. ./script/brew-install-for-cmake.sh boost 0
. ./script/brew-install-for-cmake.sh boost-python3 0
. ./script/brew-install-for-cmake.sh gtk+3 1
. ./script/brew-install-for-cmake.sh gtkglext 1
. ./script/brew-install-for-cmake.sh sdl2 1

# 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
. ./script/brew-install-for-cmake.sh mesa 1
. ./script/brew-install-for-cmake.sh mesa-glu 1
. ./script/brew-install-for-cmake.sh freeglut 1
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

- name: Check out repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
fetch-depth: 2
submodules: false

# Ensure PRs are built against the PR Head as opposed to the merge commit
- name: Conditionally relocate to PR HEAD
if: github.event.pull_request
run: git checkout HEAD^2
run: |
. ./script/brew-install-for-cmake.sh openal-soft 1
export OPENALDIR=$(brew --prefix openal-soft)

- name: Build it
env:
MY_OS_NAME: macos
COMPILER: ${{ matrix.compiler }}
FLAGS: -DCMAKE_FIND_FRAMEWORK=LAST
OPENALDIR: "/usr/local/opt/openal-soft"
FLAGS: '-DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_FIND_APPBUNDLE=LAST'
run: script/cibuild $FLAGS

- name: Test
Expand Down
50 changes: 25 additions & 25 deletions engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ SET(CMAKE_C_STANDARD 11)
SET(CMAKE_C_STANDARD_REQUIRED TRUE)
SET(CMAKE_C_EXTENSIONS ON)

UNSET(PYTHONLIBS_FOUND)
UNSET(Boost_FOUND)
UNSET(Boost_python3_FOUND)
UNSET(OPENGL_FOUND)
Expand Down Expand Up @@ -398,7 +397,7 @@ IF (USE_SYSTEM_BOOST)
ELSE (Boost_DERIVED_VERSION VERSION_EQUAL 1.67.0)
SET(Boost_1_67_Or_Later_Result FALSE)
ENDIF (Boost_DERIVED_VERSION VERSION_EQUAL 1.67.0)
MESSAGE("-- Boost_1_67_Or_Later_Result: ${Boost_1_67_Or_Later_Result}")
MESSAGE(STATUS "Boost_1_67_Or_Later_Result: ${Boost_1_67_Or_Later_Result}")
IF (Boost_1_67_Or_Later_Result)
SET(BOOST_PYTHON_COMPONENT "python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}")
ELSE (Boost_1_67_Or_Later_Result)
Expand Down Expand Up @@ -430,32 +429,33 @@ IF (USE_SYSTEM_BOOST)
SET(TST_LIBS ${TST_LIBS} ${Boost_LIBRARIES})
INCLUDE_DIRECTORIES(${TST_INCLUDES})
ELSE (Boost_FOUND)
SET(USE_SYSTEM_BOOST OFF)
MESSAGE(FATAL_ERROR "Cannot find system Boost. Unable to continue.")
# SET(USE_SYSTEM_BOOST OFF)
ENDIF (Boost_FOUND)
ENDIF (USE_SYSTEM_BOOST)

IF (NOT USE_SYSTEM_BOOST)
MESSAGE("++ Using Internal Boost")
# This is just to cleanup advanced variable viewing, since they're not used anyway
UNSET(Boost_INCLUDE_DIRS)
UNSET(Boost_LIBRARIES)
UNSET(Boost_INCLUDE_DIR)
UNSET(Boost_LIBRARY_DIRS)
SET(Boost_DIR ../ext/)
SET(BOOST_PYTHON_NO_PY_SIGNATURES 1)
SET(TST_INCLUDES ${TST_INCLUDES} ${Vega_Strike_SOURCE_DIR}/${Boost_DIR})
MESSAGE("++ Using Internal Boost::python3")
SET(TST_LIBS ${TST_LIBS} boost_python3)
INCLUDE_DIRECTORIES(${TST_INCLUDES})
ADD_SUBDIRECTORY(${Boost_DIR} build)
MESSAGE("++ boost dir: ${Boost_DIR}")
#IF (NOT DISABLE_CLIENT)
# ADD_DEPENDENCIES(vegastrike-engine boost_python)
#ENDIF (NOT DISABLE_CLIENT)
#IF (NOT DISABLE_SERVER)
# ADD_DEPENDENCIES(vegaserver boost_python)
#ENDIF (NOT DISABLE_SERVER)
ENDIF (NOT USE_SYSTEM_BOOST)
#IF (NOT USE_SYSTEM_BOOST)
# MESSAGE("++ Using Internal Boost")
# # This is just to cleanup advanced variable viewing, since they're not used anyway
# UNSET(Boost_INCLUDE_DIRS)
# UNSET(Boost_LIBRARIES)
# UNSET(Boost_INCLUDE_DIR)
# UNSET(Boost_LIBRARY_DIRS)
# SET(Boost_DIR ../ext/)
# SET(BOOST_PYTHON_NO_PY_SIGNATURES 1)
# SET(TST_INCLUDES ${TST_INCLUDES} ${Vega_Strike_SOURCE_DIR}/${Boost_DIR})
# MESSAGE("++ Using Internal Boost::python3")
# SET(TST_LIBS ${TST_LIBS} boost_python3)
# INCLUDE_DIRECTORIES(${TST_INCLUDES})
# ADD_SUBDIRECTORY(${Boost_DIR} build)
# MESSAGE("++ boost dir: ${Boost_DIR}")
# #IF (NOT DISABLE_CLIENT)
# # ADD_DEPENDENCIES(vegastrike-engine boost_python)
# #ENDIF (NOT DISABLE_CLIENT)
# #IF (NOT DISABLE_SERVER)
# # ADD_DEPENDENCIES(vegaserver boost_python)
# #ENDIF (NOT DISABLE_SERVER)
#ENDIF (NOT USE_SYSTEM_BOOST)

IF (NOT DISABLE_CLIENT) ##########

Expand Down
3 changes: 3 additions & 0 deletions engine/objconv/mesher/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
# along with Vega Strike. If not, see <https://www.gnu.org/licenses/>.
#


CMAKE_MINIMUM_REQUIRED(VERSION 3.16 FATAL_ERROR)

FIND_PACKAGE(EXPAT REQUIRED)
IF (EXPAT_FOUND)
SET(MESHER_SOURCES
Expand Down
47 changes: 47 additions & 0 deletions script/brew-install-for-cmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash
#====================================
# @file : brew-install-for-cmake.sh
# @brief : installs a package with Homebrew, keg-only, then registers that package's
# include, lib, bin, etc. directories for use by CMake
# @usage : script/brew-install-for-cmake.sh <package>
# @param : first, the brew formula name, optionally including a version suffix
# second, a truthy value indicating whether or not to leave it linked
#====================================
# Copyright (C) 2023 Stephen G. Tuggy and other Vega Strike contributors
#
# This file is part of Vega Strike.
#
# Vega Strike is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Vega Strike is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Vega Strike. If not, see <https://www.gnu.org/licenses/>.

set -e

PACKAGE_SPEC="$1"
LEAVE_LINKED="$2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to have some comments describing how to use this script and the meaning of the parameters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BenjamenMeyer Agreed. It would be good. :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... To finish the thought: Can we delay adding the comments until a future PR? Or do they need to be added right now, in your opinion?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can delay

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, sounds good. I'll file a new issue for that documentation work


export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_INSTALL_UPGRADE=1
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1

if ! brew list "$PACKAGE_SPEC" &>/dev/null; then
brew install "$PACKAGE_SPEC"
if [ ! "$LEAVE_LINKED" ] ; then
brew unlink "$PACKAGE_SPEC"
fi
fi
PACKAGE_INSTALLED_PREFIX=$(brew --prefix "$PACKAGE_SPEC")
PACKAGE_INSTALLED_BIN="$PACKAGE_INSTALLED_PREFIX/bin"
#PACKAGE_INSTALLED_INCLUDE="$PACKAGE_INSTALLED_PREFIX/include"
#PACKAGE_INSTALLED_LIB="$PACKAGE_INSTALLED_PREFIX/lib"
export PATH="$PACKAGE_INSTALLED_BIN:$PATH"
export CMAKE_PREFIX_PATH="$PACKAGE_INSTALLED_PREFIX:$CMAKE_PREFIX_PATH"
Loading