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

Minor fixes for local macOS build #2745

Merged
merged 9 commits into from
Oct 3, 2020

Conversation

rnlahaye
Copy link
Contributor

@rnlahaye rnlahaye commented Oct 3, 2020

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.
  • I tried building using clang 9, 10, and 6 and encountered build errors. Eventually I realized I needed clang 8. The macOS build documentation has been updated to make this more clear.
  • Xamarin Studio for macOS is no longer a thing (it has been replaced with Visual Studio for Mac). I installed 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.
  • I added a macOS-only script to automatically create aliases to all installed KSP assemblies.

These changes should not affect the Azure pipelines.

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.
@@ -1,3 +1,8 @@
# Define AGENT_OS if not present.
Copy link
Member

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.

SOURCE_DIR="${KSP_APP}/Contents/Resources/Data/Managed"
TARGET_DIR="${KSP_ASSEMBLIES_DIR}/${KSP_VERSION}"
ln -s "${SOURCE_DIR}" "${TARGET_DIR}"
done
Copy link
Member

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.

Sorry, something went wrong.

@eggrobin eggrobin added the LGTM label Oct 3, 2020
@eggrobin eggrobin merged commit 9123004 into mockingbirdnest:master Oct 3, 2020
@rnlahaye rnlahaye deleted the macos-fixes branch October 4, 2020 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants