8000 Ship apple silicon dart SDK binaries now that Dart 2.14.0-281.0.dev and higher have arm64 builds available for download · Issue #86926 · flutter/flutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Ship apple silicon dart SDK binaries now that Dart 2.14.0-281.0.dev and higher have arm64 builds available for download #86926

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

Closed
Tracked by #60118
acoutts opened this issue Jul 23, 2021 · 28 comments
Labels
c: proposal A detailed proposal for a change to Flutter engine flutter/engine repository. See also e: labels. P1 High-priority issues at the top of the work list platform-host-arm Building on an ARM-based platform platform-mac Building on or for macOS specifically team Infra upgrades, team productivity, code health, technical debt. See also team: labels. tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@acoutts
Copy link
acoutts commented Jul 23, 2021

Hi- I have been following the apple silicon support progress for quite some time now. Just the other day the Dart team announced apple silicon arm64 builds are now available on the dev/beta channels: dart-lang/sdk#42773 (comment)

The latest flutter dev channel 2.4.0-4.0.pre is shipping dart 2.14.0-301.0.dev which does have an arm64 build available:

Screen Shot 2021-07-23 at 5 43 06 AM

But Flutter is still shipping just the x86_64 binary:

➜ file ~/Projects/flutter/bin/cache/dart-sdk/bin/dart
/Users/andrewcoutts/Projects/flutter/bin/cache/dart-sdk/bin/dart: Mach-O 64-bit executable x86_64

Here's how the file command output looks for a native AS arm64 binary:

➜ file /Applications/Docker.app/Contents/MacOS/Docker 
/Applications/Docker.app/Contents/MacOS/Docker: Mach-O 64-bit executable arm64

Related (but unable to comment): #60118

@TahaTesser TahaTesser added in triage Presently being triaged by the triage team dependency: dart Dart team may need to help us platform-host-arm Building on an ARM-based platform platform-mac Building on or for macOS specifically c: proposal A detailed proposal for a change to Flutter team Infra upgrades, team productivity, code health, technical debt. See also team: labels. tool Affects the "flutter" command-line tool. See also t: labels. passed first triage and removed in triage Presently being triaged by the triage team labels Jul 23, 2021
@zanderso zanderso added engine flutter/engine repository. See also e: labels. and removed dependency: dart Dart team may need to help us labels Jul 26, 2021
@chinmaygarde chinmaygarde added the P3 Issues that are less important to the Flutter project label Jul 26, 2021
@Dararii
Copy link
Dararii commented Jul 27, 2021

Any update on this issue?

@bichoalexis
Copy link

Same issue here! I couldn't found any solution yet 🥺

@acoutts
Copy link
Author
acoutts commented Aug 5, 2021

@chinmaygarde is it trivial to build our own engine that would use the AS binary for dart? Seems like we would just need to check uname -m in the flutter dart bash script, and if it returns arm64 then point to that binary to execute.

@acoutts
Copy link
Author
acoutts commented Aug 11, 2021

If anyone has a workaround we can use in the meantime, I would be happy to try it out. There are issues running unit tests with the intel binaries using rosetta, where some tests fail:

TestDeviceException(Shell subprocess crashed with unexpected exit code -5.)
#0      FlutterTesterTestDevice.finished (package:flutter_tools/src/test/flutter_tester_device.dart:224:5)
<asynchronous suspension>
#1      FlutterTesterTestDevice.kill (package:flutter_tools/src/test/flutter_tester_device.dart:206:5)
<asynchronous suspension>
#2      FlutterPlatform._startTest.<anonymous closure> (package:flutter_tools/src/test/flutter_platform.dart:486:9)
<asynchronous suspension>
#3      FlutterPlatform._startTest (package:flutter_tools/src/test/flutter_platform.dart:539:11)
<asynchronous suspension>

Turning on coverage calculation causes other rosetta-related errors to print as well.

Because of this I need to always run my test suite on an intel mac to be sure it's passing.

@acoutts
Copy link
Author
acoutts commented Aug 25, 2021

Are there any estimates for when we can plan to expect this?

@bichoalexis
Copy link

Flutter 2.5.0 is supposed to run dart with arm64 support but I'm still having the same problem, were you able to solve it?

@acoutts
Copy link
Author
acoutts commented Sep 11, 2021

That’s just for the simulator running in native apple silicon, not the dart build command(s).

@bichoalexis
Copy link
bichoalexis commented Sep 11, 2021

Oh that was disappointed, I understood wrong thanks of this topic https://medium.com/dartlang/announcing-dart-2-14-b48b9bb2fb67 ☹️ I hope they will add dart arm support using flutter sdksoon.

@acoutts
Copy link
Author
acoutts commented Oct 16, 2021

Is there any update or plan to implement this soon? With Apple's macbook event next week, even more people will be upgrading to M1 macs soon.

@acoutts
Copy link
Author
acoutts commented Oct 20, 2021

Looking into it, seems like the flutter repo doesn't download the public dart archive zips and uses a different url.

Example:

https://storage.googleapis.com/flutter_infra_release/flutter/d3ea636dc5d16b56819f3266241e1f708979c233/dart-sdk-darwin-x64.zip

I tried simply replacing bin/cache/dart-sdk with the arm64 files of the same dart revision but this seems to fail when I actually try to use flutter:

Snapshot not compatible with the current VM configuration: the snapshot requires 'release no-code_comments no-dwarf_stack_traces_mode lazy_async_stacks lazy_dispatchers use_bare_instructions
no-dedup_instructions no-"asserts" "use_field_guards" "use_osr" x64-sysv no-null-safety' but the VM has 'release no-code_comments no-dwarf_stack_traces_mode lazy_async_stacks lazy_dispatchers
use_bare_instructions no-dedup_instructions no-"asserts" "use_field_guards" "use_osr" arm64-sysv no-null-safety'

Is the flutter engine building dart each time and we need to modify it there to also build for darwin arm64? I tried to look but dart-sdk-darwin-arm64.zip doesn't seem to exist at the googleapis URL.

@a-siva
Copy link
Contributor
a-siva commented Oct 20, 2021

I tried simply replacing bin/cache/dart-sdk with the arm64 files of the same dart revision but this seems to fail when I actually try to use flutter:

Snapshot not compatible with the current VM configuration: the snapshot requires 'release no-code_comments no-dwarf_stack_traces_mode lazy_async_stacks lazy_dispatchers use_bare_instructions
no-dedup_instructions no-"asserts" "use_field_guards" "use_osr" x64-sysv no-null-safety' but the VM has 'release no-code_comments no-dwarf_stack_traces_mode lazy_async_stacks lazy_dispatchers
use_bare_instructions no-dedup_instructions no-"asserts" "use_field_guards" "use_osr" arm64-sysv no-null-safety'

This is expected because when you replace the dart-sdk with the arm64 one it is not compatible with the way the Flutter engine has been built.

@acoutts
Copy link
Author
acoutts commented Oct 20, 2021

Thanks. So the issue seems to be that we have to build the flutter engine from an arm64 mac in order to build a compatible copy of dart (with the required build flags), but per my issue here I'm unable to build it following the engine wiki with my error reported. dart-lang/sdk#47511

So this is not as simple as including some pre-built dart binaries like I thought when submitting this issue. We first need to be able to build the flutter engine from an arm64 macos host.

@dnfield would it be worth me filing a separate issue about being unable to build the flutter engine on an apple silicon mac, or does that fall under this issue of making it available for download?

@dnfield
Copy link
Contributor
dnfield commented Oct 20, 2021

@zanderso would know

@zanderso
Copy link
Member

This issue can probably be deduped against one of the issues we already have filed around native tooling support on M1, probably #60118. The arm64 Dart SDK for macOS will be shipped with Flutter as a component of solving that issue.

@github-actions
Copy link
github-actions bot commented Nov 4, 2021

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 Nov 4, 2021
@jmagman
Copy link
Member
jmagman commented Feb 1, 2022

Reopening and making this a subtask of #60118.

Work on this is ongoing:
#97278
flutter/website#6736
#97536
https://flutter-review.googlesource.com/c/recipes/+/25644

@jmagman jmagman reopened this Feb 1, 2022
@flutter flutter unlocked this conversation Feb 1, 2022
@zanderso zanderso 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 1, 2022
@Sunbreak
Copy link
Contributor
Sunbreak commented Feb 4, 2022

Apple Silicon Dart SDK is available since flutter-2.11-candidate.7

% ./bin/flutter --version
Flutter 2.10.0-1.0.pre.345 • channel flutter-2.11-candidate.7 • https://github.com/flutter/flutter
Framework • revision a0abb7e89e (3 days ago) • 2022-01-31 16:05:20 -0500
Engine • revision 800afbf27a
Tools • Dart 2.17.0 (build 2.17.0-69.0.dev) • DevTools 2.10.0-dev.1
% file bin/cache/dart-sdk/bin/dart
bin/cache/dart-sdk/bin/dart: Mach-O 64-bit executable arm64

@anzbert
Copy link
anzbert commented Feb 4, 2022

Apple Silicon Dart SDK is available since flutter-2.11-candidate.7

% ./bin/flutter --version
Flutter 2.10.0-1.0.pre.345 • channel flutter-2.11-candidate.7 • https://github.com/flutter/flutter
Framework • revision a0abb7e89e (3 days ago) • 2022-01-31 16:05:20 -0500
Engine • revision 800afbf27a
Tools • Dart 2.17.0 (build 2.17.0-69.0.dev) • DevTools 2.10.0-dev.1
% file bin/cache/dart-sdk/bin/dart
bin/cache/dart-sdk/bin/dart: Mach-O 64-bit executable arm64

hey thx. that totally worked!
i guess i'll just follow the latest 2.11 release candidates now to get native apple silicon support :)
at least until 2.11 is released or M1 support is in the beta.

@zanderso
Copy link
Member
zanderso commented Feb 4, 2022

@Sunbreak @anzbert I think flutter upgrade will get you the right bits, but there's some more infra work needed (#97658) to get the arm64 Dart SDK into the Flutter SDK archives on the website. Thanks for your patience.

@anzbert
Copy link
anzbert commented Feb 5, 2022 via email

@zanderso
Copy link
Member
zanderso commented Feb 7, 2022

@anzbert Please file new issues for any crashers you're seeing in 2.11. Thanks!

@Sunbreak
Copy link
Contributor

Shipped on beta channel now: https://github.com/flutter/flutter/releases/tag/2.11.0-0.1.pre

@anzbert
Copy link
anzbert commented Feb 18, 2022

hmm i still get plenty of intel processes in the 2.11 beta in the activity monitor.

running flutter-2.11-candidate.11 at the moment and that is only using apple processes and works fine for me.

@Sunbreak
Copy link
Contributor
wangkun42@wangkun42s-MacBook-Pro flutter-beta % git log -1
commit b101bfe32f634566e7cb2791a9efe19cf8828b15 (HEAD -> beta, tag: 2.11.0-0.1.pre, origin/flutter-2.11-candidate.7, origin/dev, origin/beta)
Author: godofredoc <godofredoc@google.com>
Date:   Wed Feb 16 07:36:54 2022 -0800

    'Update Engine revision to e3559935720ea88dfcdf9079c394ffdb5146ceab for beta release 2.11.0-0.1.pre' (#98561)
wangkun42@wangkun42s-MacBook-Pro flutter-beta % file bin/cache/dart-sdk/bin/dart
bin/cache/dart-sdk/bin/dart: Mach-O 64-bit executable arm64
wangkun42@wangkun42s-MacBook-Pro flutter-beta % bin/cache/dart-sdk/bin/dart --version
Dart SDK version: 2.17.0-69.2.beta (beta) (Mon Feb 14 13:41:58 2022 +0100) on "macos_arm64"

@anzbert You'd better close any IDE or process using Dart Language Server and start with the new Dart SDK

@anzbert
Copy link
anzbert commented Feb 18, 2022

i think that did it. i just rebooted and switched channel again + flutter upgrade . thx @Sunbreak !!

@jmagman
Copy link
Member
jmagman commented Mar 30, 2022

@zanderso this is done, right? Or did you want to wait until it's reached stable?
Screen Shot 2022-03-30 at 10 24 16 AM

@zanderso
Copy link
Member

This is done.

@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 Apr 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: proposal A detailed proposal for a change to Flutter engine flutter/engine repository. See also e: labels. P1 High-priority issues at the top of the work list platform-host-arm Building on an ARM-based platform platform-mac Building on or for macOS specifically team Infra upgrades, team productivity, code health, technical debt. See also team: labels. tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

No branches or pull requests

0