Skip to content

Commit

Permalink
Bug 1788854 - Require MacOSX 11.3 SDK. r=firefox-build-system-reviewe…
Browse files Browse the repository at this point in the history
…rs,andi

Because the relevant SDK is not installed on the mac workers, we pull it
via fetches and adjust the plain build mozconfig as well as mozconfigs
for rusttest, grouping most things in build/macosx/mozconfig.common.

And because the SDK itself now has all the relevant headers, we don't
need the old check for system C++ headers (which also happens to have
outdated instructions)

Differential Revision: https://phabricator.services.mozilla.com/D156280
  • Loading branch information
glandium committed Sep 4, 2022
1 parent 49b4329 commit ef98b71
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 35 deletions.
1 change: 0 additions & 1 deletion browser/config/mozconfigs/macosx64-aarch64/common-opt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export MOZILLA_OFFICIAL=1
export MOZ_PACKAGE_JSSHELL=1

ac_add_options --target=aarch64-apple-darwin
export MACOS_SDK_DIR=$MOZ_FETCHES_DIR/MacOSX11.3.sdk

# As of Clang 13, the default is -mcpu=apple-m1 when using a aarch64-apple-macos target,
# but we're using apple64-apple-darwin, which defaults to -mcpu=apple-a7, which disables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ MOZ_AUTOMATION_BUILD_SYMBOLS=0
. "$topsrcdir/browser/config/mozconfigs/macosx64/debug"

ac_add_options --target=aarch64-apple-darwin
export MACOS_SDK_DIR=$MOZ_FETCHES_DIR/MacOSX11.3.sdk

# We add this last to guard against inadvertent changes in the debug config.
# It may conflict with settings from mozconfig.override, but that seems
Expand Down
1 change: 1 addition & 0 deletions browser/config/mozconfigs/macosx64/plain-opt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export MACOS_SDK_DIR=$MOZ_FETCHES_DIR/MacOSX11.3.sdk
3 changes: 0 additions & 3 deletions build/macosx/cross-mozconfig.common
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ mk_add_options "export PATH=$MOZ_FETCHES_DIR/cctools/bin:$MOZ_FETCHES_DIR/binuti
# dsymutil needs a libstdc++ more recent than what's on the system.
mk_add_options "export LD_LIBRARY_PATH=$MOZ_FETCHES_DIR/clang/lib"

CROSS_SYSROOT=$MOZ_FETCHES_DIR/MacOSX11.3.sdk

export CFLAGS="$CFLAGS -fcrash-diagnostics-dir=${UPLOAD_PATH}"
export CXXFLAGS="$CXXFLAGS -fcrash-diagnostics-dir=${UPLOAD_PATH}"
export DSYMUTIL=$MOZ_FETCHES_DIR/clang/bin/dsymutil
Expand All @@ -24,7 +22,6 @@ export HOST_CXXFLAGS="-g"
export HOST_LDFLAGS="-g"

ac_add_options --target=x86_64-apple-darwin
export MACOS_SDK_DIR=$CROSS_SYSROOT

if [ "x$MOZ_PKG_SPECIAL" != "xasan" -a -z "$MOZ_AUTOMATION_ARTIFACT_BUILDS" ]; then
# Enable static analysis checks by default on OSX cross builds.
Expand Down
2 changes: 2 additions & 0 deletions build/macosx/mozconfig.common
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
if test `uname -s` = Linux; then
. $topsrcdir/build/macosx/cross-mozconfig.common
fi

export MACOS_SDK_DIR=$MOZ_FETCHES_DIR/MacOSX11.3.sdk
30 changes: 1 addition & 29 deletions build/moz.configure/toolchain.configure
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ with only_when(host_is_osx | target_is_osx):
# When we change the SDK we build with, please update the manual SDK
# installation docs:
# https://firefox-source-docs.mozilla.org/setup/macos_build.html#macos-sdk-is-unsupported
sdk_min_version = Version("11.0")
sdk_min_version = Version("11.3")

if sdk:
sdk = sdk[0]
Expand Down Expand Up @@ -1729,34 +1729,6 @@ include("compile-checks.configure")
include("arm.configure", when=depends(target.cpu)(lambda cpu: cpu == "arm"))


@depends(host, host_os_kernel_major_version, target)
def needs_macos_sdk_headers_check(host, version, target):
# Only an issue on Mac OS X 10.14 (and probably above).
if host.kernel != "Darwin" or target.kernel != "Darwin" or version < "18":
return

return True


@depends(
cxx_compiler.try_run(
header="#include_next <inttypes.h>",
check_msg="for macOS SDK headers",
when=needs_macos_sdk_headers_check,
),
when=needs_macos_sdk_headers_check,
)
def check_have_mac_10_14_sdk(value):
if value:
return

die(
"System inttypes.h not found. Please try running "
"`open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg` "
"and following the instructions to install the necessary headers"
)


@depends(
have_64_bit,
try_compile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>Version</key>
<string>11.0</string>
<string>11.3</string>
</dict>
</plist>
4 changes: 4 additions & 0 deletions taskcluster/ci/build/macosx-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ macosx64-plain/opt:
- macosx64-nasm
- macosx64-node
- macosx64-rust
- macosx64-sdk
- sysroot-wasm32-wasi
optimization:
skip-unless-expanded: null
Expand Down Expand Up @@ -74,6 +75,7 @@ macosx64-plain/debug:
- macosx64-nasm
- macosx64-node
- macosx64-rust
- macosx64-sdk
- sysroot-wasm32-wasi
optimization:
skip-unless-expanded: null
Expand Down Expand Up @@ -106,6 +108,7 @@ macosx64-rusttests/opt:
- macosx64-cbindgen
- macosx64-nasm
- macosx64-node
- macosx64-sdk
- sysroot-wasm32-wasi
optimization:
test-inclusive: [rusttests]
Expand Down Expand Up @@ -138,6 +141,7 @@ macosx64-rusttests/debug:
- macosx64-cbindgen
- macosx64-nasm
- macosx64-node
- macosx64-sdk
- sysroot-wasm32-wasi
optimization:
test-inclusive: [rusttests]

0 comments on commit ef98b71

Please sign in to comment.