-
Notifications
You must be signed in to change notification settings - Fork 69
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
Minor fixes for local macOS build #2745
Conversation
AGENT_OS is defined automatically in the Azure pipeline, but not for users compiling by hand.
The script automatically builds a KSP Assemblies dir using all copies of KSP installed on the user's machine.
This only affects MacOS/Linux adapter builds. The release pipeline uses Windows to generate adapter builds and is unaffected.
principia_make.sh
Outdated
@@ -1,3 +1,8 @@ | |||
# Define AGENT_OS if not present. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
principia_make.sh
(which exists in the dependency repositories as well) is not meant to be run directly. It is used by the Azure pipelines that run the continuous integration, and here it mostly contains workarounds to please Azure (the term « agent » and the variable AGENT_OS
both come from Azure).
FWIW the calling code is as follows.
if [ -f ./principia_variable_overrides.sh ]; then
source ./principia_variable_overrides.sh
fi
if [ "${AGENT_OS?}" == "Darwin" ]; then
C_FLAGS="${PRINCIPIA_C_FLAGS?} -mmacosx-version-min=${PRINCIPIA_MACOS_VERSION_MIN?} -arch x86_64"
CXX_FLAGS="${PRINCIPIA_CXX_FLAGS?} ${PRINCIPIA_MACOS_CXX_FLAGS?}"
elif [ "${AGENT_OS?}" == "Linux" ]; then
C_FLAGS="${PRINCIPIA_C_FLAGS?} -m64"
CXX_FLAGS="${PRINCIPIA_CXX_FLAGS?}"
else
C_FLAGS="${PRINCIPIA_C_FLAGS?}"
CXX_FLAGS="${PRINCIPIA_CXX_FLAGS?}"
fi
LD_FLAGS="${C_FLAGS?} ${PRINCIPIA_LD_FLAGS?}"
CXX_FLAGS="${CXX_FLAGS?} ${LD_FLAGS?}"
# Stop on first failure.
set -e
source ./principia_make.sh
You probably want to run make
directly when building Principia yourself.
Please revert the changes to this file.
add_ksp_assemblies_macos.sh
Outdated
SOURCE_DIR="${KSP_APP}/Contents/Resources/Data/Managed" | ||
TARGET_DIR="${KSP_ASSEMBLIES_DIR}/${KSP_VERSION}" | ||
ln -s "${SOURCE_DIR}" "${TARGET_DIR}" | ||
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New line at end of file.
This PR contains fixes for some issues I ran into while building Principia locally.
Specifically:
principia_make.sh
has been marked as executable.principia_make.sh
now defines AGENT_OS if it is not present.clang
9, 10, and 6 and encountered build errors. Eventually I realized I neededclang
8. The macOS build documentation has been updated to make this more clear.msbuild
directly and was able to build the adapter using it.msbuild
seems to be available for Linux as well, so I updated the makefile to use it. Build documentation has been updated accordingly.These changes should not affect the Azure pipelines.