Skip to content

feat: build macOS dmgs with correct archs - #226

Draft
VillagerTom wants to merge 5 commits into
appshubcc:mainfrom
VillagerTom:fix_macos_fat_binary
Draft

feat: build macOS dmgs with correct archs#226
VillagerTom wants to merge 5 commits into
appshubcc:mainfrom
VillagerTom:fix_macos_fat_binary

Conversation

@VillagerTom

Copy link
Copy Markdown
Contributor
  • 当指定 --arch=universal 时,脚本会构建两种架构的 core,并将它们合并为一个通用二进制文件(fat binary)。
  • 当指定了任意有效参数(或省略)时,脚本现在会以正确的架构构建,不再构建一个包含单架构 core 的全架构 Flutter 应用。

…g, fix missing awaits

- Replace --arch auto flag with implicit fallback via ArchExt.same
- Remove systemArch/_mapHostArch (superseded by ArchExt.same)
- Keep _expectedOutputs etc. for --ensure support
- Add missing awaits for buildHelper and _buildDistributor calls
- Consolidate .vscode/ tasks and launch configs into single auto-detecting entries

# Conflicts:
#	setup.dart
- When --arch=universal, the script builds cores of of both archs, and
  merges them into one fat binary
- When any valid parameter is specified (or omitted), the script now
  builds the app in the current arch, instead of a universal flutter app
  with a sinigle-arch core
@appshubcc

Copy link
Copy Markdown
Owner

@VillagerTom 意义何在?

@VillagerTom

Copy link
Copy Markdown
Contributor Author

@VillagerTom 意义何在?

  1. 单架构app体积减小
  2. 多架构一定要是真多架构

@appshubcc

Copy link
Copy Markdown
Owner

@VillagerTom 实际场景是啥,arm64和AMD64不同架构,AMD64和Compatible编译参数也不一样

@VillagerTom

VillagerTom commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

不再构建一个包含单架构 core 的全架构 Flutter 应用。

体现在release上就是安装包体积减小了——原本虽然叫 arm64 amd64 但是只有 core 是单架构,浪费空间

@VillagerTom

Copy link
Copy Markdown
Contributor Author

傻贝了🌚,今天突然想到,既然目的是“通用安装包”,那么直接强制 compatible=true 不就行了,GOAMD64=v1 构建在 v2 v3 CPU 上也能通用

@VillagerTom

Copy link
Copy Markdown
Contributor Author

忘记说了,来自 cherry-pick 的 5e530e2 实际上是有问题的(影响本地构建),#159 作了修复但这边没有。等 #159 合并之后再作处理。

@appshubcc
appshubcc force-pushed the main branch 2 times, most recently from bb605a0 to 570c649 Compare July 18, 2026 17:07
@appshubcc
appshubcc force-pushed the main branch 2 times, most recently from 95bde57 to c0bb574 Compare August 13, 2026 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants