Skip to content

Enable cross compilation for windows-arm64#142431

Closed
p-b-o wants to merge 1 commit intoflutter:masterfrom
p-b-o:windows_arm64_cross_compilation
Closed

Enable cross compilation for windows-arm64#142431
p-b-o wants to merge 1 commit intoflutter:masterfrom
p-b-o:windows_arm64_cross_compilation

Conversation

@p-b-o
Copy link
Copy Markdown
Contributor

@p-b-o p-b-o commented Jan 29, 2024

This is available only for master channel.


Added option --target-platform {windows-x64, windows-arm64} for flutter build windows command.

Without this option, it produces an x64 app on windows-x64, and arm64 app on windows-arm64.

This was successfully tested (on windows-x64 and windows-arm64) with: $ flutter create app
$ cd app
$ flutter build windows
$ flutter build windows --target-platform windows-x64 $ flutter build windows --target-platform windows-arm64

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

This is available only for master channel.

---

Added option --target-platform {windows-x64, windows-arm64} for flutter
build windows command.

Without this option, it produces an x64 app on windows-x64, and arm64
app on windows-arm64.

This was successfully tested (on windows-x64 and windows-arm64) with:
$ flutter create app
$ cd app
$ flutter build windows
$ flutter build windows --target-platform windows-x64
$ flutter build windows --target-platform windows-arm64
@flutter-dashboard
Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jan 29, 2024
@p-b-o
Copy link
Copy Markdown
Contributor Author

p-b-o commented Jan 29, 2024

This PR is the succession of #141930.
However, it can't be upstreamed in this state.

We have been discussing in a previous PR (#137618) that ephemeral folder should be specialized per architecture. For now, cross compilation would work by reusing same ephemeral folder, but it might break one day.

Another issue as well, is how to download flutter artifacts only for one platform. We didn't identify a correct way to do it in our discussions, and it's an open problem.

I might come back to work on this later, but for now, this is lower priority. So if someone is willing to work on this, you're more than welcome! Don't hesitate to ping me for review or questions.

@p-b-o p-b-o closed this Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant