Skip to content

Conversation

@izzalDev
Copy link
Contributor

Add Linux support to Flutter cask

Summary:
This pull request extends the existing flutter cask to support Linux platforms.
It uses the official Flutter SDK binaries distributed by Google, ensuring parity with the macOS version.

Changes:

  • Added corresponding sha256 and url for the official Linux archive.
  • Ensured installation, uninstallation, and binaries (flutter, dart) work consistently on both macOS and Linux.
  • No behavioral or structural changes for macOS users.

Checklist:

  • The submission targets a stable release.
  • brew audit --cask --online flutter passes (expected lipo warning due to wrapper scripts).
  • brew style --fix flutter reports no offenses.
  • brew audit --cask --new flutter passes successfully on Linux.
  • HOMEBREW_NO_INSTALL_FROM_API=1 brew install --cask flutter works correctly on both macOS and Linux.
  • brew uninstall --cask flutter works correctly on both macOS and Linux.

Notes:

  • Flutter’s flutter and dart executables are shell wrappers that invoke platform binaries; lipo warnings during audit are expected and do not indicate an issue.
  • Both platforms now install Flutter into $(brew --prefix)/share/flutter for consistent path usage across systems.

@p-linnane p-linnane force-pushed the feature/flutter-linux-support branch from 28c32d0 to af0ee5d Compare November 12, 2025 06:07
@p-linnane p-linnane changed the title flutter 3.35.7 (linux support) flutter: add Linux support Nov 12, 2025
@p-linnane
Copy link
Member

Adding an x86_64 dependency on Linux doesn't seem to stop CI from trying other test on arm64 Linux. We might need changes in Homebrew/brew to handle this. Thoughts @Homebrew/cask?


auto_updates true

suite "flutter", target: "#{HOMEBREW_PREFIX}/share/flutter"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The suite stanza does not work on Linux, so I replaced it with artifact.
This change provides similar behavior but works cross-platform, including Linux.

Copy link
Member

Choose a reason for hiding this comment

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

Can you elaborate on it 'does not work'?

@bevanjkay bevanjkay force-pushed the feature/flutter-linux-support branch from af0ee5d to b16ba01 Compare November 13, 2025 05:44
@bevanjkay
Copy link
Member

bevanjkay commented Nov 13, 2025

Just trying something here that may work, ultimately we do need some changes in Homebrew/Brew to handle a couple of cases;

  1. Allowing a cask to not supply a checksum for architectures that are not supported.
  2. Making sure the brew generate-cask-ci-matrix --cask <token> can correctly identify which architectures to test in these more complicated scenarios, as it will want to test on arm linux even though it isn't supported here.
  3. Extending support for suite to Linux casks

Note: I have temporarily changed the suite stanza back to artifact for testing purposes here, but we should look at suite support before we move ahead with this.

@bevanjkay bevanjkay marked this pull request as draft November 13, 2025 05:47
@bevanjkay bevanjkay force-pushed the feature/flutter-linux-support branch from b16ba01 to 73519c0 Compare November 13, 2025 06:15
@SMillerDev
Copy link
Member

Yeah, part of 2 is already part of Homebrew/brew#20334. So you can copy from there.

@izzalDev izzalDev marked this pull request as ready for review November 13, 2025 12:30
@izzalDev izzalDev marked this pull request as draft November 13, 2025 17:18
@izzalDev izzalDev force-pushed the feature/flutter-linux-support branch 4 times, most recently from 89edc10 to dba32f4 Compare November 13, 2025 19:17
@izzalDev
Copy link
Contributor Author

I’m not sure why Flutter doesn’t provide a precache bundle for the Linux ARM64 platform on its official site. However, Flutter does support Linux ARM64 on the stable channel through the stable branch by cloning the official Flutter repository and running flutter precache.

This approach works for all supported platforms and architectures, so I modified this Homebrew cask to automate that process using the source from the stable branch. I’ve tested this cask on Linux x64, Linux ARM64, and macOS ARM64 — all work correctly.

Should this be implemented as a formula instead of a cask? Also, why doesn’t the CI workflow detect support for Linux x64 and Linux ARM64?

@izzalDev izzalDev marked this pull request as ready for review November 13, 2025 20:40
Signed-off-by: Patrick Linnane <[email protected]>
@izzalDev izzalDev force-pushed the feature/flutter-linux-support branch from b9b3ec6 to 4672400 Compare November 15, 2025 11:19
@p-linnane
Copy link
Member

Why doesn’t the CI workflow detect support for Linux x64 and Linux ARM64?

Linux casks are a relatively new concept, so things like this are still identified as we add them.

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.

5 participants