Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

fix pinned builds on fresh macOS install - #8143

Merged
spoonincode merged 1 commit into
developfrom
fix_macos_fresh_pinned
Oct 30, 2019
Merged

spoonincode merged 1 commit into
developfrom
fix_macos_fresh_pinned

Conversation

@spoonincode

@spoonincode spoonincode commented Oct 29, 2019 •

Copy link
Copy Markdown
Contributor

Change Description

When running eosio_build.sh -P on a fresh macOS 10.14.6 install it fails when trying to bootstrap Boost’s build system. This failure is new to 2.0+ and appears to be due to a significant change in boost’s build system in 1.71 compared to the previous 1.70 used in 1.8.x.

A little background: on macOS, by default, C header files (like stdlib.h) are not installed in to /usr/include. Instead, they are kept inside the development tool app bundle such as in /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk. “apple clang” from Xcode or command line tools (such as unpinned build would use) is smart enough to use these headers automatically based on your configuration (xcode-select etc). “vanilla clang” (such as a pinned build would use) cannot figure this out on its own: you must pass either -isysroot with the correct path or set the environment variable SDKROOT to the correct path.

For reasons that are not entirely clear to me, the old build system in boost 1.70 (used in 1.8.x releases) is not using the pinned compiler. This means that in 1.8.x, Boost is built with apple clang which doesn’t require any of the shenanigans like isysroot/SDKROOT. It also means we’re building boost with a different compiler then nodeos for 1.8.x, quite troubling but probably not worth fixing at 1.8’s late lifecycle.

The new build system in boost 1.71 does use the pinned compiler as desired and expected. However, the vanilla clang compiler is unable to find any C header files and fails to bootstrap or build boost. This PR exposes SDKROOT to vanilla clang when bootstrapping and building boost so that C header files can be found.

cmake projects (such as when building LLVM or building EOSIO) do not require this workaround because cmake is smart enough to figure out the appropriate setting and pass it as -isysroot on its own. So, there is no need to try and persist SDKROOT beyond the time needed to build Boost.

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

@spoonincode
spoonincode merged commit 3d24305 into develop Oct 30, 2019
@spoonincode
spoonincode deleted the fix_macos_fresh_pinned branch October 30, 2019 14:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants