Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

☂️ Add support for ARM macOS as a target #60113

Closed
10 tasks done
stuartmorgan opened this issue Jun 23, 2020 · 33 comments
Closed
10 tasks done

☂️ Add support for ARM macOS as a target #60113

stuartmorgan opened this issue Jun 23, 2020 · 33 comments
Assignees
Labels
a: build Building flutter applications with the tool a: desktop Running on desktop c: new feature Nothing broken; request for a new capability customer: crowd Affects or could affect many people, though not necessarily a specific customer. engine flutter/engine repository. See also e: labels. P1 High-priority issues at the top of the work list platform-mac Building on or for macOS specifically platform-target-arm Targeting an ARM-based platform tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@stuartmorgan
Copy link
Contributor

stuartmorgan commented Jun 23, 2020

Filing as an umbrella bug for the overall feature of building ARM macOS applications. We can add specific sub-issues over time, but at a high level this will involve:

  • The necessary Dart support
  • Building/uploading engine artifacts in the correct format
  • Updating the tool to understand the new target
    • potentially adding new options to control what is being targeted

Issues

Tracking Apple Silicon as a host device separately at #60118.

@stuartmorgan stuartmorgan added c: new feature Nothing broken; request for a new capability tool Affects the "flutter" command-line tool. See also t: labels. engine flutter/engine repository. See also e: labels. platform-mac Building on or for macOS specifically a: desktop Running on desktop a: build Building flutter applications with the tool labels Jun 23, 2020
@jmagman jmagman added this to Awaiting triage in Tools - macOS review via automation Jun 23, 2020
@christopherfujino christopherfujino moved this from Awaiting triage to Engineer reviewed in Tools - macOS review Jul 3, 2020
@jmagman jmagman added the P3 Issues that are less important to the Flutter project label Aug 18, 2020
@alexmarkley

This comment has been minimized.

@stuartmorgan

This comment has been minimized.

@alexmarkley

This comment has been minimized.

@stuartmorgan

This comment has been minimized.

@alexmarkley
Copy link

Then hopefully we should also be agreed that the place to discuss the new thing you are requesting is in the issue you filled for it, rather than this completely unrelated issue.

@stuartmorgan I'm sorry if my misunderstanding was frustrating. Being new to the project, a plain reading of this issue left me unsure what the point of this issue was.

That said, I'm happy to help with testing of the macOS Desktop support on Apple Silicon. Currently (flutter master from an hour ago), .app bundles produced by flutter build macos on x86_64 hosts seem to work fine on Apple Silicon under Rosetta.

Additionally, the tooling flutter run -d macos runs fine on Apple Silicon, but obviously under Rosetta.

As I'm sure you expected (or if you've tested this yourself, you already know) the problems start when I launch the project in Xcode and ask it to build for 'My Mac', in which case I get the following:

error: The linked and embedded framework 'App.framework' is missing one or more architectures required by this target: arm64. (in target 'Runner' from project 'Runner')
error: The linked and embedded framework 'FlutterMacOS.framework' is missing one or more architectures required by this target: arm64. (in target 'Runner' from project 'Runner')

My intention here is to be as helpful as possible, while trying to improve and future-proof my own app project(s). I'm new to the Dart and Flutter projects, but I'm interested in learning and contributing as quickly as possible.

Please let me know if there is any way I can assist.

@GyuriMajercsik

This comment has been minimized.

@arnemolland

This comment has been minimized.

@GyuriMajercsik

This comment has been minimized.

@arnemolland

This comment has been minimized.

@GyuriMajercsik

This comment has been minimized.

@arnemolland

This comment has been minimized.

@GyuriMajercsik

This comment has been minimized.

@jmagman

This comment has been minimized.

@TahaTesser TahaTesser added the customer: crowd Affects or could affect many people, though not necessarily a specific customer. label Dec 1, 2020
@jmagman
Copy link
Member

jmagman commented Feb 2, 2022

The tool should switch to using those gen_snapshots

Filed #97681

@cbracken cbracken self-assigned this Feb 10, 2022
@cbracken cbracken added this to To do in macOS Desktop Stable via automation Feb 15, 2022
@cbracken cbracken moved this from To do to In progress in macOS Desktop Stable Feb 15, 2022
@cbracken cbracken added P1 High-priority issues at the top of the work list and removed P3 Issues that are less important to the Flutter project labels Feb 28, 2022
@cbracken cbracken moved this from In progress to Green in macOS Desktop Stable Mar 5, 2022
@cbracken cbracken moved this from Green to In progress (green) in macOS Desktop Stable Mar 7, 2022
cbracken added a commit to cbracken/flutter that referenced this issue Mar 17, 2022
This changes the default build architectures for Flutter macOS apps to
x86_64 and arm64. Previously, we manually excluded arm64 builds via the
EXCLUDE_ARCHS Xcode setting in Flutter's generated xcconfig file. This
eliminates setting EXCLUDE_ARCHS during the build and updates the
default architectures in the tool and in the macos_assemble.sh wrapper.

Issue: flutter#97681
Umbrella issue: flutter#60113
cbracken added a commit that referenced this issue Mar 17, 2022
This changes the default build architectures for Flutter macOS apps to
x86_64 and arm64. Previously, we manually excluded arm64 builds via the
EXCLUDE_ARCHS Xcode setting in Flutter's generated xcconfig file. This
eliminates setting EXCLUDE_ARCHS during the build and updates the
default architectures in the tool and in the macos_assemble.sh wrapper.

Issue: #97681
Umbrella issue: #60113
@cbracken
Copy link
Member

cbracken commented Mar 17, 2022

As of #100271, we should be building macOS universal binary apps by default on master branch.

Note that, like all macOS apps, the default is that debug builds build as single-architecture binaries using the architecture of the machine you're working on. Profile/Release builds build as universal binaries. While it is not the default for macOS apps (Flutter or otherwise), if you want to generate universal binaries for debug builds, you can take the following steps:

  1. Select the Runner project in Xcode.
  2. Select the Runner target in the settings sidebar.
  3. Select the Build Settings tab and select All for the options to show.
  4. Expand the Build Active Architecture Only option and for Debug, change Yes to No.

image

Please shout if you run into any issues with this. We'd love to get feedback on any issues you encounter -- please file a new issue and link it here.

cbracken added a commit that referenced this issue Mar 22, 2022
Adds a test that invokes flutter run in release mode on macOS desktop,
waits for successful launch and the flutter command list, then sends the
'q' command to quit the running app.

This adds an integration test for #100504.

Issue: #100348 (fix)
Issue: #97978 (partial fix)
Issue: #97977 (partial fix)
Umbrella issue: #60113
@cbracken cbracken moved this from In progress (green) to Done in macOS Desktop Stable Mar 22, 2022
cbracken added a commit to cbracken/flutter that referenced this issue Mar 22, 2022
In the run_release_test_macos integration test that verifies that a
release build of an app can be launched (and quit), xcodebuild from the
Xcode install on the macOS bots emits a few info messages about
Simulator SDK versions that are irrelevant to the functioning of this
test.

Ignore these instead of failing the test if they occur.

Related: flutter#100526

Issue: flutter#100348 (fix)
Issue: flutter#97978 (partial fix)
Issue: flutter#97977 (partial fix)
Umbrella issue: flutter#60113
cbracken added a commit that referenced this issue Mar 23, 2022
In the run_release_test_macos integration test that verifies that a
release build of an app can be launched (and quit), xcodebuild from the
Xcode install on the macOS bots emits a few info messages about
Simulator SDK versions that are irrelevant to the functioning of this
test.

Ignore these instead of failing the test if they occur.

Related: #100526

Issue: #100348 (fix)
Issue: #97978 (partial fix)
Issue: #97977 (partial fix)
Umbrella issue: #60113
@jmagman
Copy link
Member

jmagman commented May 3, 2022

Closing as complete. The remaining testing work is being tracked in #87508.

@jmagman jmagman closed this as completed May 3, 2022
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: build Building flutter applications with the tool a: desktop Running on desktop c: new feature Nothing broken; request for a new capability customer: crowd Affects or could affect many people, though not necessarily a specific customer. engine flutter/engine repository. See also e: labels. P1 High-priority issues at the top of the work list platform-mac Building on or for macOS specifically platform-target-arm Targeting an ARM-based platform tool Affects the "flutter" command-line tool. See also t: labels.
Projects
Status: Done
Tools - macOS review
  
Engineer reviewed
Development

No branches or pull requests