Heads Up: Minimum macOS SDK Version Change

已查看 286 次
跳至第一个未读帖子

Haik Aftandilian

未读,
2021年11月19日 15:42:452021/11/19
收件人 dev-platform
If you never compile Firefox on macOS, you can ignore this message.
This is a head-up message about an upcoming change that mostly affects
developers on macOS 10.14 or older.

We will soon require the macOS 11 SDK (or newer) for local Firefox
builds. We are already requiring this SDK for arm64 builds, but soon
we will require it for Intel builds as well. Before we make this
change in the build system and require the newer SDK locally, we will
make the change in CI with bug 1696504. Then we will provide another
heads up before the macOS 11 SDK is required to build locally.

What you need to do:

If you’re using macOS 10.14 or earlier, you have two options: You can
upgrade to 10.15+ and install Xcode 12.2 or newer, or you can copy the
11.0 SDK from a newer Xcode installation to your 10.14 system.

If you’re using macOS 10.15 or later, use Xcode version 12.2 through
13.0 inclusive and (if you currently specify an older SDK in your
mozconfig), remove the line ac_add_options --with-macos-sdk=... from
your mozconfig. (Later versions of Xcode starting with 13.1 ship with
the macOS 12 SDK which we expect Firefox to build with, but you may
hit breakage after Xcode updates until compatibility bugs are fixed.
You can continue to use ac_add_options --with-macos-sdk=... with a
macOS 11 SDK for more stability.)

Background:

Today, the minimum required SDK to build Firefox on x64 is 10.12, and
this is also the SDK we use for shipping official Firefox builds.
arm64 (aka Apple Silicon) builds require the 11.0 SDK and shipping
builds use that version.

The 11.0 SDK is included with Xcode 12.2 through Xcode 13.0, but Xcode
12.2 requires macOS 10.15.4. So developers on 10.14 and earlier will
not be able to install the required Xcode version. See the Xcode
version table for the full list of versions[1][2].

- Will this change affect the minimum macOS version Firefox supports?
No, this only applies to the SDK version Firefox must be built with.

- When will we be making this change?
We plan to make this change on CI for Firefox 96 with bug 1696504 and
then make the change for mach to require it in 97 with bug 1696513.

- Why are we making this change?
Increasing the minimum required SDK will unlock the following
improvements for Firefox macOS development.

1. We will not need to worry about breaking SDKs that we don't have
current CI coverage for. For example, a fix that breaks compilation on
SDK 10.13 is not likely to be noticed because it is not tested in CI
and developers are typically on either 10.12 or the latest macOS SDK.

2. Taking advantage of modern macOS APIs will be much easier. See
"Using new APIs with old SDKs"[3] for a list of workarounds that we
currently have to employ. These workarounds can be a serious
impediment to getting things done - see bug 1671626 comment 8 for an
example where we had trouble using the MediaPlayer framework before we
were building with the 10.12 SDK.

3. We can remove many existing workarounds, i.e. any code that's
only needed for old SDKs, and workarounds pertaining to macOS version
numbers: in builds compiled with the old SDK, macOS 11 and 12 pretend
to be version “10.16”, so we have some special code paths to tease out
the “true” version.

4. The compiler will catch any missing runtime version checks of the
form if (@available(macOS 10.14, *)) when accessing modern APIs
because the header definitions from the modern SDKs are annotated with
the correct API_AVAILABLE attributes. (This would have caught bug
1602813, for example.)

5. Differences between x64 and arm64 builds will be reduced.

Find us on #macdev on chat.mozilla.org with questions.

1. Apple Xcode version table: https://developer.apple.com/support/xcode/
2. Unofficial Xcode version table: https://xcodereleases.com/
3. https://firefox-source-docs.mozilla.org/widget/cocoa/macos-apis.html#using-new-apis-with-old-sdks

Thanks,
Haik

Mike Hommey

未读,
2021年11月25日 00:21:112021/11/25
收件人 Haik Aftandilian、dev-platform
On Fri, Nov 19, 2021 at 12:42:27PM -0800, Haik Aftandilian wrote:
> - When will we be making this change?
> We plan to make this change on CI for Firefox 96 with bug 1696504 and
> then make the change for mach to require it in 97 with bug 1696513.

Bug 1696504 has landed and was merged to central.

Mike
回复全部
回复作者
转发
0 个新帖子