Closed Bug 1670751 Opened 4 years ago Closed 4 years ago

[meta] Allow building Firefox with macOS 11 SDK (for in-Firefox dependencies)

Categories

(Core :: Widget: Cocoa, enhancement, P2)

Desktop
macOS
enhancement

Tracking

()

RESOLVED FIXED
84 Branch

People

(Reporter: haik, Unassigned)

References

Details

(Keywords: meta)

This meta bug is intended to track any in-Firefox dependencies we have for switching our Mac builds to the 11.0 SDK. The bug is not meant to track changes needed in automation.

Severity: -- → N/A
Keywords: meta
Priority: -- → P1
Version: unspecified → Trunk
Depends on: 1672842
Blocks: 1687365
Priority: P1 → P3
Priority: P3 → P2

Our arm64 builds are already built with the macOS 11 SDK in CI.
As for also using the macOS 11 SDK in CI for the x86_64 builds, I'm not aware of any blockers. It should just work.

However, once we only build with modern SDKs in CI, building with older SDKs is soon going to break. So we will also need to make the macOS 11 SDK a minimum build requirement. And we'll also want to do this because it unlocks code simplifications.

The macOS 11 SDK comes with Xcode 12.2, which requires macOS 10.15. So then we need to think about the following:

  • Is it possible to build Firefox with the macOS 11 SDK even on 10.13/10.14? Since we only need the SDK, I think we can extract it from Xcode without installation, or we can download the SDK through some other means. And we also ship our own compilers as part of mach bootstrap. So I think we wouldn't actually need the modern Xcode.
  • Otherwise, if we really do need Xcode 12.2+ to be installed, then we should give developers on 10.13/10.14 some heads up, so that they have some time to upgrade to 10.15. According to mach telemetry, there are currently around 18% of mac builds happening on versions older than 10.15.

(In reply to Markus Stange [:mstange] from comment #3)

The macOS 11 SDK comes with Xcode 12.2, which requires macOS 10.15. So then we need to think about the following:

  • Is it possible to build Firefox with the macOS 11 SDK even on 10.13/10.14? Since we only need the SDK, I think we can extract it from Xcode without installation, or we can download the SDK through some other means. And we also ship our own compilers as part of mach bootstrap. So I think we wouldn't actually need the modern Xcode.

This worked. On macOS 10.14.6 with Xcode 11.3.1 (11C05) installed, I was able to build central using the macOS 11 SDK copied over from an Xcode 12.4 (12D4e) installation. I named the SDK directory MacOSX10.16.sdk and used the following setting in my mozconfig. The build used the mozbuild clang installation by default.

ac_add_options --with-macos-sdk=/full/path/to/MacOSX10.16.sdk

Great, thanks! So the next steps here are:

  1. Send an email to dev-platform and announce our intent to switch to the macOS 11 SDK, with justification and action steps. (Justification: see bug 1696513. Action steps: Developers on 10.15+ need to update Xcode to at least version <insert version here>, and switch their --with-macos-sdk flag to the macOS 11 SDK (or remove the --with-macos-sdk declaration altogether). Developers on 10.14 and below need to update macOS or obtain the macOS 11 SDK.)
  2. Ask glandium to write a patch to use the macOS 11 SDK in CI.
  3. File a bug to require the macOS 11 SDK for building.
  4. File a bug to remove any code that's only needed for old SDKs.

Haik, do you want to do that?

Flags: needinfo?(haftandilian)
Blocks: 1696504
No longer blocks: 1687365

Since this bug was only filed to track bugs that appeared when building with the macOS 11 SDK, I'm going to close it as fixed. We are not aware of any bugs that appear only when building with the macOS 11 SDK. The last bug of that type was bug 1672842, for which a fix landed in Firefox 84.

I have filed bug 1696504 about using the macOS 11 SDK in CI and bug 1696513 about raising the minimum required SDK version for local builds.

Status: NEW → RESOLVED
Closed: 4 years ago
Depends on: 1623684
Resolution: --- → FIXED
Summary: [meta] Build Firefox with macOS 11 SDK (for in-Firefox dependencies) → [meta] Allow building Firefox with macOS 11 SDK (for in-Firefox dependencies)
Target Milestone: --- → 84 Branch

(In reply to Markus Stange [:mstange] from comment #5)

Great, thanks! So the next steps here are:

  1. Send an email to dev-platform and announce our intent to switch to the macOS 11 SDK, with justification and action steps. (Justification: see bug 1696513. Action steps: Developers on 10.15+ need to update Xcode to at least version <insert version here>, and switch their --with-macos-sdk flag to the macOS 11 SDK (or remove the --with-macos-sdk declaration altogether). Developers on 10.14 and below need to update macOS or obtain the macOS 11 SDK.)
  2. Ask glandium to write a patch to use the macOS 11 SDK in CI.
  3. File a bug to require the macOS 11 SDK for building.
  4. File a bug to remove any code that's only needed for old SDKs.

Haik, do you want to do that?

See bug 1696504 for the progress on this. We landed the change in CI and discovered some regressions that need to be resolved before re-landing.

Flags: needinfo?(haftandilian)
You need to log in before you can comment on or make changes to this bug.