Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@chinmaygarde
Copy link
Contributor

We don't have access to Android tools of the native architecture.
While it is possible to shim x64 Android tools to work on M1, I
have opted to disable the Android targets instead. Currently focusing
on Mac and iOS targets and don't want to spend too much time on an
Android shim when we can probably just publish the right tools
to the CIPD bucket and bypass emulation.

The GN version has also been updated as it contains the native
architecture binaries. The udpate did cause old warnings in GN rules
to become errors. I have patched those here and in the buildroot.

This does require a buildroot update in flutter/buildroot#480.

We don't have access to Android tools of the native architecture.
While it is possible to shim x64 Android tools to work on M1, I
have opted to disable the Android targets instead. Currently focusing
on Mac and iOS targets and don't want to spend too much time on an
Android shim when we can probably just publish the right tools
to the CIPD bucket and bypass emulation.

The GN version has also been updated as it contains the native
architecture binaries. The udpate did cause old warnings in GN rules
to become errors. I have patched those here and in the buildroot.

This does require a buildroot update in flutter/buildroot#480.
Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm


# Checkout Android dependencies only on platforms where we build for Android targets.
'download_android_deps': 'host_os == "mac" or host_os == "linux"',
'download_android_deps': 'host_cpu == "x64" and (host_os == "mac" or host_os == "linux")',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a Todo/bug to enable this on arm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmagman I thought there was an umbrella issue for supporting engine builds on M1 hosts. But I am not able to find it. Though I am now not sure if that was only building aarch64 binaries for M1 embedders from x64 hosts.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flutter/flutter#60118 The completed engine work was related to getting the ARM simulator binaries built. @gw280 has the most context. The remaining work is mostly infra and getting the Flutter tooling running natively.

There's another umbrella issue for deploying a Flutter desktop app natively on an M1 without Rosetta: flutter/flutter#60113

@chinmaygarde
Copy link
Contributor Author

I should mention that the host toolchain is still x64 as there are no native versions published yet. So far, just focusing on making sure the development workflow is sound.

@zanderso
Copy link
Member

Generating GN files in: out/host_debug_unopt
ERROR at //third_party/swiftshader_flutter/BUILD.gn:318:7: Unsupported value in libs.
      "Cocoa.framework",
      ^----------------
Use frameworks to list framework dependencies.
See //flutter/testing/BUILD.gn:115:20: which caused the file to be included.
      configs += [ "//third_party/swiftshader_flutter:swiftshader_config" ]
                   ^-----------------------------------------------------

@chinmaygarde
Copy link
Contributor Author

I missed a few updates but they were unfortunately in the buildroot. That has been patched.

@chinmaygarde chinmaygarde added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Jul 13, 2021
@fluttergithubbot fluttergithubbot merged commit f44af6a into flutter:master Jul 13, 2021
@jmagman
Copy link
Member

jmagman commented Jul 13, 2021

On flutter/buildroot#480 on an M1 and this PR I see:

$ ./flutter/tools/gn --ios --unoptimized --no-goma
$ ninja -C out/ios_debug_unopt                       
ninja: Entering directory `out/ios_debug_unopt'
[3067/3947] ACTION //flutter/lib/snapshot:create_arm_gen_snapshot(//build/toolchain/mac:ios_clang_arm)
FAILED: clang_x64/gen_snapshot_arm64 
python ../../flutter/sky/tools/create_macos_gen_snapshots.py --dst /Users/flutter/Projects/engine/src/out/ios_debug_unopt/clang_x64 --arm64-out-dir /Users/flutter/Projects/engine/src/out/ios_debug_unopt
Cannot find gen_snapshot at /Users/flutter/Projects/engine/src/out/ios_debug_unopt/clang_x64/gen_snapshot
[3076/3947] ACTION //flutter/lib/snapshot:strong_platform(//build/toolchain/mac:ios_clang_arm)
ninja: build stopped: subcommand failed.

$ git status
HEAD detached at 647c7f8

Am I doing something wrong here?

@chinmaygarde chinmaygarde deleted the gnup branch July 13, 2021 22:34
@chinmaygarde
Copy link
Contributor Author

I am wiring up the host unit-tests ATM. And this patch only unblocks the sync step and building simple host targets. Toolchain changes and iOS stuff is coming later.

@jmagman
Copy link
Member

jmagman commented Jul 13, 2021

$ git status
HEAD detached at 647c7f8

Oh also I should have been on flutter/buildroot#481 flutter/buildroot@5c61df1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes platform-macos waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants