Closed Bug 2046054 Opened 3 months ago Closed 2 months ago

Fix macOS crashreporter build failure by importing INSMutableParagraphStyle after NSMutableParagraphStyle_ was removed from cocoabind.

Categories

(Toolkit :: Crash Reporting, defect)

Other
macOS
defect

Tracking

()

RESOLVED FIXED
154 Branch
Tracking Status
firefox154 --- fixed

People

(Reporter: marcelsker, Assigned: afranchuk)

Details

Attachments

(2 files)

Steps to reproduce:

  1. Check out current mozilla-central on macOS.
  2. Run ./mach build (or ./mach build binaries).

Actual results:

The build fails compiling the crashreporter crate:

error[E0432]: unresolved import cocoa::NSMutableParagraphStyle_
--> toolkit/crashreporter/client/app/src/ui/macos/mod.rs:35:5

error[E0599]: no method named setAlignment_ found for struct StrongRef<NSMutableParagraphStyle>
--> toolkit/crashreporter/client/app/src/ui/macos/mod.rs:1115:24

Expected results:

The crashreporter crate should compile and the macOS build should complete successfully.

OS: Unspecified → macOS
Hardware: Unspecified → Other

The Bugbug bot thinks this bug should belong to the 'Toolkit::Crash Reporting' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Crash Reporting
Product: Firefox → Toolkit

Hi,

Thanks for taking the time to report this.

I can't reproduce the issue on my macOS machine. Do you have the XCode tools installed, as outlined in https://firefox-source-docs.mozilla.org/setup/macos_build.html ? Which version of macOS are you running?

Flags: needinfo?(marcelsker)

(In reply to Simon Chopin [:schopin] from comment #2)

Hi,

Thanks for taking the time to report this.

I can't reproduce the issue on my macOS machine. Do you have the XCode tools installed, as outlined in https://firefox-source-docs.mozilla.org/setup/macos_build.html ? Which version of macOS are you running?

Hey,
I use the latest macOS Developer Beta 27.0 + Xcode 27.0 Beta. That could be the issue.

Thanks for the fast response.

Flags: needinfo?(marcelsker)

I had a quick look at this, and indeed they changed the relevant header in the beta, see attachment.

My Obj-C and bindgen-fu is very weak, so I'm not sure how we could solve this so that it would work on both 26.5 and 27.

Attached file diff

Alex, I'm being told that you might be able to help there?

Flags: needinfo?(afranchuk)

Huh, I was under the impression that our build wouldn't use the system-installed toolchain (to avoid potential breakage such as this). I'll take a look at supporting it.

Flags: needinfo?(afranchuk)
Assignee: nobody → afranchuk
Severity: -- → S4
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

The header was shuffled a bit, so the traits are different. It's a bit
awkward to try to detect which version we have, so this just uses a
msg_send! directly.

Could you try a build with the patch applied?

Flags: needinfo?(marcelsker)

It works now!

Flags: needinfo?(marcelsker)

Out of curiosity: did you have anything in your mozconfig to use the system toolchain? From what I've heard, when building from firefox-main, mach should bootstrap a toolchain local to the build.

Flags: needinfo?(marcelsker)

Not that I know of. I just cloned from https://github.com/mozilla-firefox/firefox.git main branch and ran ./mach build.

Flags: needinfo?(marcelsker)

Ah, so you didn't run ./mach bootstrap first? Maybe that's why it used the system toolchain. On Linux, I've found that the build fails without a bootstrap, and/or sometimes invokes it on its own, so I'm not sure what the intended usage is.

Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 154 Branch
QA Whiteboard: [qa-triage-done-c155/b154]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: