Flutter: Let flutter be installable via homebrew

Created on 11 Jan 2018  ·  77Comments  ·  Source: flutter/flutter

Didn't find any existing issues on this. Opening for tracking.

Let flutter be brew install flutterable.

P6 first hour crowd passed first triage platform-mac new feature tool

Most helpful comment

So instead of me having to install from a user's custom tap, be it @SpectralKH 's or @MiderWong 's or @eclewlow 's, and then have to trust & hope that:

  1. That user's tap will become the "official" one that is well-supported and updated when necessary.
  2. That user isn't going to inject malicious software onto my machine.

My suggestion is do the same as what Dart have done where Dart has a brew tap named dart-lang/dart and is referenced in the official Dart docs.
This aligns Flutter with Dart (considering they're effectively sister-projects) and keeps things consistent and simple.
(Shower-thought: Considering Flutter is a sister-project to Dart and Flutter requires Dart, why not just bundle it as another formulae in the dart-lang tap?)

I guess my questions are, as a non-brew developer and who is new to this discussion:

  1. Is this in progress? and if so what's the update? Because this has been an open issue since Jan 2018?
  2. If it hasn't been started yet, what do we need to do as a community to get it done?

All 77 comments

@gspencergoog you might be interested

https://docs.brew.sh/Formula-Cookbook

The process is pretty straight-forward. Though we'd have to make sure it integrates with our https://github.com/flutter/flutter/wiki/Release-process, ideally in an automated way.

Hi Flutter team! I started adding a flutter formula to Homebrew at https://github.com/Homebrew/homebrew-core/pull/27395, but I could definitely use more guidance on following the direction in this comment:

Though we'd have to make sure it integrates with our https://github.com/flutter/flutter/wiki/Release-process, ideally in an automated way.

Right now the Homebrew formula just downloads the current beta release, unzips it, and copies it to Flutter's Keg (eg. /usr/local/Cellar/flutter/0.3.1/).

Any feedback would be welcome!

@jcollins-g wrt to the shlock from https://github.com/Homebrew/homebrew-core/pull/27395, maybe we can check if shlock returns not permitted / 1 and parent process id is brew, don't shlock. Also we can lock write to parts of the cache to prevent self update when brew installed.

For context in that Homebrew PR, I wrote about the shlock issue in the comments starting here: https://github.com/Homebrew/homebrew-core/pull/27395/files#diff-b438c13e924f5f36b1ce4398a89436d2R36

Actually, we went through this idea a bit more and I think ultimately, we'd want the official formula to be in a homebrew tap (non-core repository). This way, we can keep the flutter upgrade and brew upgrade targets hermetically synchronized.

Hopefully we can bring a version of your formula into the tap in the near future and simplify the official install process.

Sure! In that case, I'd be happy to close the PR on homebrew-core if that makes sense?

Yes. Thanks for making the contribution!

@xster fwiw that's not necessary. Formulae in Homebrew/homebew-core get upgraded within hours of upstream releases since we run brew livecheck several times per day.

@xster / @briankung shlock's behavior in brew is a little surprising to me. It's not like much special is going on here:

https://opensource.apple.com/source/shell_cmds/shell_cmds-118/shlock/shlock.c.auto.html

openloop:
    if ((fd = open(tempname, O_RDWR|O_CREAT|O_EXCL, 0644)) < 0) {

That should always be valid to do on a POSIX filesystem -- well, unless you've set chflags on the directory to prevent it from being written:

jcollins-macbookpro:shlock jcollins$ sudo chflags uchg .
jcollins-macbookpro:shlock jcollins$ ls -la
total 0
drwxr-xr-x   2 jcollins  wheel    64 May  3 08:50 .
drwxrwxrwt  69 root      wheel  2208 May  3 08:52 ..
jcollins-macbookpro:shlock jcollins$ echo hi > foo
-bash: foo: Operation not permitted
jcollins-macbookpro:shlock jcollins$ ls -la
total 0
drwxr-xr-x   2 jcollins  wheel    64 May  3 08:50 .
drwxrwxrwt  69 root      wheel  2208 May  3 08:52 ..
jcollins-macbookpro:shlock jcollins$ shlock -f foo -p $$
shlock: open(shlock14741): Operation not permitted
jcollins-macbookpro:shlock jcollins$

If something in homebrew or the way you're setting it up does that, fixing shlock isn't going to cut it because you'll then fail when other write operations are inevitably attempted in the cache.

If adding this line:

chflags -R nouchg "$FLUTTER_ROOT/bin/cache"

here fixes it, you've got a chflags problem and probably should deal with that somehow. Somehow, bin/cache may already exist at the point you first run flutter (maybe you're starting with a binary build of flutter? Those have cache-premade and so they'll pass the mkdir fine, but you won't be able to write to the cache).

[edited to fix chflags]

@jcollins-g Ah, my unix-fu isn't up to snuff - I didn't know about chflags, but it makes sense. I suppose it's academic at this point, but I'll look into it. Thanks!

I added the line as follows:

diff --git a/bin/flutter b/bin/flutter
index 079c3f94d..1b7e06f43 100755
--- a/bin/flutter
+++ b/bin/flutter
@@ -39,6 +39,7 @@ function _rmlock () {

 function upgrade_flutter () {
   mkdir -p "$FLUTTER_ROOT/bin/cache"
+  chflags -R nouchg "$FLUTTER_ROOT/bin/cache"

   # This function is executed with a redirect that pipes the source of
   # this script into file descriptor 3.

And the test flutter --version still fails with the shlock error.

I missed something you said earlier:

maybe you're starting with a binary build of flutter? Those have cache-premade and so they'll pass the mkdir fine, but you won't be able to write to the cache

I think I am using a binary build of flutter. It's the zip from https://flutter.io/setup-macos/#get-sdk.

Since I was curious, I deleted the cache folder to see if the flutter script could create the folder itself. It could not: mkdir: /usr/local/Cellar/flutter/0.3.1-beta/bin/cache: Operation not permitted and inserting an echo $(whoami) into flutter shows that the script is running as my personal user (sanity check).

I'm not too familiar with Unix permissions, but it looks like I do need sudo to edit any files in /usr/local/Cellar/flutter/, and reviewing the permissions shows that all the files are in the admin group:

$ pwd && echo && ls -al bin
/usr/local/Cellar/flutter/0.3.1-beta

total 32
drwxr-xr-x   5 briankung  admin   160 May  4 10:01 .
drwxr-xr-x  26 briankung  admin   832 May  4 09:53 ..
-r-xr-xr-x   1 briankung  admin  6892 May  4 10:01 flutter
-r--r--r--   1 briankung  admin  6338 May  4 09:52 flutter.bat
drwxr-xr-x   8 briankung  admin   256 May  4 09:52 internal

Copying the directory into my home directory assigns it the staff group, and then running ~/flutter/bin/flutter --version with the cache directory deleted starts downloading the Dart language. However, changing the group on Homebrew's flutter folder, /usr/local/Cellar/flutter/, does not allow the brew keg to create the folder, and when I create the folder myself, I end up right back at the shlock: open(/usr/local/Cellar/flutter/0.3.1-beta/bin/cache/shlock9849): Operation not permitted error.

Thanks for the detailed response @briankung. I could dive further into this with you, but it sounds like the fundamental bug is that we can't guarantee writeability into bin/cache under the flutter installation by regular users and Flutter assumes this.

Most Unix packages separate the cached bits they manage from the binary installation. Flutter's packaging method is a bit unorthodox in that the cached bits include most of the binary installation. Homebrew, apt-get, virtually all package managers and operating systems will have some combination of permissions, chroot during build, chattr/chflags, etc to try to prevent installed packages from being modified by regular users.

I think the right thing to do here might be to have a flag set in a file that locks the flutter cache as read-only, and make flutter's built-in update tools respect it. That way we can distinguish between user-configuration error and the user using an installed package, and display appropriate errors. Or, more simply, we could just check for cache writeability and skip it if we can't write to the cache.

@xster's original suggestion might be enough if the rest of the tools already support this. which sounds like it might be the case.

I've done a little more digging. It looks like we _mostly_ do not need to write to FLUTTER_ROOT and its subdirectories.

However, there are exceptions that look likely to result in crashes:

The shlock we're running into here is definitely one.
The locking in flutter upgrade is another.
The locking for golden files is another.

Additionally, the preference for a flutter root pub cache looks suspicious to me -- unless pub is coded to handle this case that's probably not going to work for cases where a developer wants to use a different package, either.

Given that I found this many little issues right away, I think to fix this for good we probably need to add running integration tests using a read-only FLUTTER_ROOT and track down any little one-offs like this. That'll also keep this from cropping up again as it is really easy as a Flutter developer to accidentally introduce something like this.

+1 on testing with read-only root

Any updates on this?

This is not currently something we're planning to do, but if someone wanted to work on this we would support this work. I presume it would either involve integrating with our continuous integration scripts to publish to homebrew in some manner, or creating a bootstrap script that knows how to integrate with flutter, and maintaining that (and especially, writing tests to make sure that we know when it breaks, so we can fix it). If you are interested in working on this, please don't hesitate to reach out to me.

I've changed this bug to be specifically about homebrew, if you are interested in the same thing for apt-get please file a separate bug (though the comment above applies equally to that).

I made a tap repo fo Mac OS: (https://github.com/eclewlow/homebrew-formulas)

All it does is install flutter, though.
brew install eclewlow/formulas/flutter

You still have to download IOS & Android Dev Tools yourself.

It didn't pass the brew audit though, so I can't add it to homebrew.
Here's why:

  * Stable version URLs should not contain beta
  * Non-executables were installed to "/usr/local/opt/flutter/bin"
    The offending files are:
      /usr/local/opt/flutter/bin/cache
      /usr/local/opt/flutter/bin/internal
  * flutter has broken dynamic library links:

Since the 1.0 version of flutter has been released, I hope I can see the formula😄.

Since the 1.0 version of flutter has been released, I hope I can see the formula😄.

looking forward for it too.

@eclewlow please update to 1.0

Sorry, I’m on a cruise and the satellite internet is terrible.

I’ll be back on the 10th, and then I can do it.

If someone wants to do it themselves, they can just create a repository.

I changed the formula so it actually checks out Flutter from git, rather than downloading the precompiled package.

But I haven’t figured out how to get the latest version tag from a repository.

Here’s what the formula would look like:

class Flutter < Formula
desc "Build beautiful native apps in record time"
homepage "https://flutter.io/"
version “1.0.0"
url "https://github.com/flutter/flutter.git"
sha256 "6e3ba2da94fb150d2cb8e0596eeb92c86e5e437e91a5f39f211bd4b21d0b24f8"

bottle :unneeded

def install
system "git", "fetch", "--tags"
# checkout latest tag, something like this?
# git checkout $(git describe --abbrev=0 --tags)
# and use instead of this next line:
system "git", "checkout", "tags/v1.0.0"
system "./bin/flutter"
allfiles = File.join(buildpath, "*", "{,.*}")
mv Dir.glob(allfiles), Dir.glob(prefix), :force => true

# bin.install File.join(prefix, "bin/cache/dart-sdk/bin/dart")
# bin.install File.join(prefix, "bin/cache/dart-sdk/bin/pub")

end

def post_install
rm File.join(HOMEBREW_PREFIX, "bin", "flutter.bat")
chmod_R "+rwx", File.join(prefix, "bin"), :verbose => true

# this line could be useful, it installs the dependencies
# of flutter, such as xcode and android if needed
# "flutter packages get"

end

test do
system "false"
end
end

On Dec 6, 2018, at 11:39 AM, Alberto Xamin notifications@github.com wrote:

@eclewlow https://github.com/eclewlow please update to 1.0


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/flutter/flutter/issues/14050#issuecomment-445002396, or mute the thread https://github.com/notifications/unsubscribe-auth/AfVSYcUOrJtVDISTEwKF4pRcsO5PLvRhks5u2XKMgaJpZM4RbS2W.

Looking forward too 🚶

Since android-sdk is available as a cask I thought it would make more sense for flutter to also be available as a cask. So I went ahead and did a homebrew tap for the flutter cask. You can check it out here.

I first tried to create a simple formula and failed miserably as I have absolutely no experience with developing of homebrew formulae.

If you would like this, can you clarify what you would actually like it to do?

e.g. what should flutter channel beta do after you run brew install flutter? Would you want to be able to submit PRs for changes to flutter from your local flutter install? Would you want this to install the Android SDK or Xcode for you? Would you want to be able to do flutter run in the examples directories?

I am a heavy homebrew user, but have never written a homebrew plugin. That said, here's one man's opinion:

what should flutter channel beta do after you run brew install flutter?

Switch to the beta channel.

Would you want to be able to submit PRs for changes to flutter from your local flutter install?

No. Homebrew in this use case is for using packages, not necessarily modifying those packages.

Would you want this to install the Android SDK or Xcode for you?

It should install all dependencies.

Would you want to be able to do flutter run in the examples directories?

Yes. Once you run brew install flutter, flutter will be on the path and you can use it as if you installed it the same way as described in the Flutter tutorial.

Ok. I updated my homebrew formula for Flutter.

https://github.com/eclewlow/homebrew-formulas

It installs the most recent tagged version of Flutter in the flutter repository (https://github.com/flutter/flutter) via Git.
(Currently v1.1.1, but it will auto-detect the latest on installation)

To upgrade, you would probably have to reinstall flutter via brew

brew uninstall flutter
brew install flutter

I wrote a very small tutorial to reach out to other people.
https://medium.com/@sadmansamee/installing-flutter-via-homebrew-a5d7009c95ba?fbclid=IwAR0DJZOdi-av2X1ofmbc1MaO7SZ7c30bowlkPK9EjIztPCrOhTv2tGbdx7E

I wrote my homebrew formula for Flutter.

https://github.com/miderwong/homebrew-flutter

It installs the latest stable version(v1.0.0) of Flutter in the flutter repository (https://github.com/flutter/flutter) via Git.

brew install flutter
brew upgrade flutter

Just a simple example, there are a lot of deficiencies, welcome to correct me.

https://github.com/flutter/flutter/issues/14050#issuecomment-449447441

This works grate, please don't be confused like I for the message before the installation or the long wait on install, That is normal and the message only apply if you are in chine or you have problems to run flutter doctor after install.
Thanks :)

Related to #9401

brew install flutter                                                                                                                                                                                        
Error: No available formula with the name "flutter"
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

@jesusvallez gonna need a tap, for example brew tap MiderWong/flutter. This is what https://github.com/flutter/flutter/issues/14050#issuecomment-449447441 didn't say, but meant. Just follow https://github.com/miderwong/homebrew-flutter .

I wrote my homebrew formula for Flutter.

https://github.com/miderwong/homebrew-flutter

It installs the latest stable version(v1.0.0) of Flutter in the flutter repository (https://github.com/flutter/flutter) via Git.

brew install flutter
brew upgrade flutter

Just a simple example, there are a lot of deficiencies, welcome to correct me.

The script has been updated. Please update the git repository with the following command:

brew untap MiderWong/flutter
brew tap MiderWong/flutter

And follow the instructions in the README:
Flutter-homebrew-README

@MiderWong
getting

Error: Invalid formula: /usr/local/Homebrew/Library/Taps/miderwong/homebrew-flutter/flutter.rb
flutter: cannot load such file -- nokogiri
Error: Cannot tap miderwong/flutter: invalid syntax in tap!

@TuxujPes Made a cask for installing flutter, which can be installed by running

brew tap probablykasper/tap
brew cask install flutter
flutter upgrade

https://github.com/probablykasper/homebrew-tap/blob/master/Casks/flutter.rb
It simply downloads the macOS flutter installation zip and links the flutter executable. Then you'd run flutter doctor afterwards.

So instead of me having to install from a user's custom tap, be it @SpectralKH 's or @MiderWong 's or @eclewlow 's, and then have to trust & hope that:

  1. That user's tap will become the "official" one that is well-supported and updated when necessary.
  2. That user isn't going to inject malicious software onto my machine.

My suggestion is do the same as what Dart have done where Dart has a brew tap named dart-lang/dart and is referenced in the official Dart docs.
This aligns Flutter with Dart (considering they're effectively sister-projects) and keeps things consistent and simple.
(Shower-thought: Considering Flutter is a sister-project to Dart and Flutter requires Dart, why not just bundle it as another formulae in the dart-lang tap?)

I guess my questions are, as a non-brew developer and who is new to this discussion:

  1. Is this in progress? and if so what's the update? Because this has been an open issue since Jan 2018?
  2. If it hasn't been started yet, what do we need to do as a community to get it done?

@Harmelodic Very fair concerns. They could make an official brew cask at the very least - Mine is literally 10 lines of code.

It's also worth noting that of the 6000+ open issues, this is fourth on the list when sorting by 👍 reactions. I appreciate the community efforts, but I prefer to use something that is officially supported where possible, and it seems that I'm not alone in that. Please make this a priority 🙏

any update?

If anyone is interested in owning this, this is something we'd be happy to help you set up in the Flutter build infrastructure.

If anyone is interested in owning this, this is something we'd be happy to help you set up in the Flutter build infrastructure.

Anyone working on this?

I wrote my homebrew formula for Flutter.

https://github.com/miderwong/homebrew-flutter

It installs the latest stable version(v1.0.0) of Flutter in the flutter repository (https://github.com/flutter/flutter) via Git.

brew install flutter
brew upgrade flutter

Just a simple example, there are a lot of deficiencies, welcome to correct me.

It works great.
But we need a MASTER branch also (not only dev/stable) to be able to use Flutter for Web!

This seems like such an easy win for the project. Please spend a little time and ship this!

This would mean a bunch of changes to the way we do our tooling. Since in a brew-world, Flutter would not be in control of self-updating. It also would need to be aware of Brew's layout, or how to find a write-able place for caching. This would fall under @zanderso's perview and likely be a good bit of work.

@eseidelGoogle What about having an official cask?

@probablykasper that's the easy part. :) The hard part is making sure that the futter tool knows how to behave correctly when installed as part of a normal cask installation location/process, etc.

The hard part is making sure that the futter tool knows how to behave correctly when installed as part of a normal cask installation location/process, etc.

That's correct. Teaching the flutter tool that something else is responsible for installation, updating, and teaching it to understand a more diverse arrangement of filesystems permissions is a pretty good chunk of work.

Also, it's not a hard blocker, but this is also somewhat in conflict with our desire to have a low friction way for folks to contribute to Flutter, which is trickier if the Flutter repo bits aren't managed by git.

@probablykasper that's the easy part. :) The hard part is making sure that the futter tool knows how to behave correctly when installed as part of a normal cask installation location/process, etc.

I'm testing Flutter on Homebrew Cask, it seem to work fine for me. Should you reconsider using Cask instead of Formula for Homebrew?

socheatsok78/homebrew-flutter

Test Result

Switching to different channel can be perform using flutter CLI.
And the installation directory is pretty much straight forward for Cask then using Formula.

@socheatsok78 will give this a try. thanks

brew cask install socheatsok78/flutter/flutter

x-MacBook-Pro:flutter apple$ which flutter
/usr/local/bin/flutter

But, it looks like it has issues on Mac due to the new security in Catolina.

x-MacBook-Pro:mac apple$ flutter
/usr/local/bin/flutter: line 183: 73175 Killed: 9               "$DART" --packages="$FLUTTER_TOOLS_DIR/.packages" $FLUTTER_TOOL_ARGS "$SNAPSHOT_PATH" "$@"

But, it looks like it has issues on Mac due to the new security in Catolina.

x-MacBook-Pro:mac apple$ flutter
/usr/local/bin/flutter: line 183: 73175 Killed: 9               "$DART" --packages="$FLUTTER_TOOLS_DIR/.packages" $FLUTTER_TOOL_ARGS "$SNAPSHOT_PATH" "$@"

I'm on Catalina, I'm not quite sure about that. The only problem I was having was idevice_id which can be found here #42302

But, it looks like it has issues on Mac due to the new security in Catolina.

x-MacBook-Pro:mac apple$ flutter
/usr/local/bin/flutter: line 183: 73175 Killed: 9               "$DART" --packages="$FLUTTER_TOOLS_DIR/.packages" $FLUTTER_TOOL_ARGS "$SNAPSHOT_PATH" "$@"

I'm on Catalina, I'm not quite sure about that. The only problem I was having was idevice_id which can be found here #42302

go to System Preferences, open the security menu, under general section you can allow access to Dart. Run flutter upgrade again. It might failed a second time, saying that something kernel is failing. repeat the same procedure again and voila !

Installing Fluter in /usr/local/Cellar/flutter and softlinking binaries in /usr/local/bin should do the trick IMHO. I cannot check it currently since I didn't dare upgrading to Catalina yet.

Any updates on this issue?

Still hoping that we will have a canonical brew tap and cask. Catalina PATH config is just annoying!

this is probably two hours of work and will save tones of hours for many many people, so please

Looking forward to this.

Thumb up, Looking forward to this!

Yo

Hi folks, a quick reminder about our issue hygiene polices:

https://github.com/flutter/flutter/wiki/Issue-hygiene#do-not-add-me-too-or-same-comments-to-bugs

Having said that, though, please know that we are aware of this issue.

@zanderso I appreciate the moderation, but I think some communication on this particular request is warranted at this point. There's clearly a very major interest in this, and a desire for official support rather than community support. While several users have proposed solutions, many more more users have expressed a desire for official support for this. Unfortunately, the general response has been one of no action.

On behalf of everyone on this thread, I ask the core team to please make a plan to address this and to communicate that plan to the user base.

Hi folks, a quick reminder about our issue hygiene polices:

https://github.com/flutter/flutter/wiki/Issue-hygiene#do-not-add-me-too-or-same-comments-to-bugs

Having said that, though, please know that we are aware of this issue.

This is ridiculous. I just came from the Flutter homepage, and I was all set up to give it a go when I saw the archaic process of installation. Came here, and saw this issue open for two whole years with no tangible updates.

Oh well, onto Kotlin then.

Came here because the flutter.dev site, like many other Google sites, is full of things that are filterable and do not work with Adblocker. So I am not able to download flutter sdk without disabling everything.
apt-get / brew would be much more convenient.

Also, like mentianed by @timmyjose

Hi folks, a quick reminder about our issue hygiene polices:
https://github.com/flutter/flutter/wiki/Issue-hygiene#do-not-add-me-too-or-same-comments-to-bugs
Having said that, though, please know that we are aware of this issue.

This is ridiculous. I just came from the Flutter homepage, and I was all set up to give it a go when I saw the archaic process of installation. Came here, and saw this issue open for two whole years with no tangible updates.

Oh well, onto Kotlin then.

Why isn't that addressed...

@CAoTx Flutter's site doesn't have any ads on it, and I have no problems downloading with ad blockers installed. Perhaps your custom adblock filters are too restrictive? The site itself is open source, if you want to see how to adjust your filters.

Another alternative is to use git clone as described on the bottom of the downloads page for getting the master channel. You can use that, and then use flutter channel to switch to another channel if you don't want to use master.

Onboarding new macOS user to flutter development and the installation process is archaic and confusing at best. brew install flutter should be doable and supported by the core team as the official installation method for flutter.

Since this issue has been labeled with P6, which is the lowest priority possible, I guess it won't be solved anytime soon? It's pretty funny, since this is one of the most commented and active issues in repository.

@timsneath is there any way we can get more transparency into how these community requests are prioritized?

https://github.com/flutter/flutter/wiki/Triage
https://github.com/flutter/flutter/wiki/Issue-hygiene
talk about the processes.

Although our teams do not currently have bandwidth to take on this issue, that doesn't mean someone else can't. This would be a medium/large endeavor, but should be doable by a motivated contributor.

There are a bunch of questions I could imagine need answering here:

  • Teaching flutter_tools (and other scripts) not to write into the sdk install directory but rather use other cache directories (this may be useful for code-hygiene regardless).
  • Teaching fluttter_tools that it's OK to have an un-upgradable (non-writable) install and to somehow point users to different upgrade methods.
  • Is Flutter's git-based installation method compatible with these tools? We already offer tarballs/zips for initial download, but currently we assume users install flutter/flutter as a git repo. If it's not compatible, there may be some non-trivial process work on the infrastructure side to support producing/distributing/testing non-git distributions of flutter.

Happy to argue about priorities (maybe in another forum), but I'd encourage looking through what other bugs are labeled higher priority than this one. Flutter has a lot of users and from those a lot of (sometimes urgent) requests. We try to address them in the order of making the most impact towards our/users goals.

@eseidelGoogle Thanks for the clarification, and the strategy sketch, it is very much appreciated and super empowering!

To answer the question about updating I think if the regular flutter update command can just not be available for not git installs then that should be good enough. Is there a way to do that? Ideally, it wouldn't be another distribution, just an if check in the code to see if the location of the flutter binary has a .git folder. Is this possible?

The formula could also just download the git repository and run the commands for a user. Formulas don't have to just install binaries.

As a reference, this is how rustup does:

rustup, the toolchain manager of the Rust programming language, it can be installed by running a installing script (standalone installation) or installed from a OS package manager. When you want to upgrade rustup, you can run rustup self update for standalone installation, or upgrade via your OS package manager if you installed rustup via OS package manager. If you try to run rustup self update when rustup is installed via OS package manager, it will give you an error, says please upgrade it from your OS package manager. I really like this implementation, because when you firstly installed something via your OS package manager and upgrade it using the built-in functionality of it, it may run out of control of the OS package manager and may cause some unknown errors in the future.

I think the best way for flutter is to adopt similar implementation as rustup does, but this is a huge work (need to refactor many things to let flutter can managed by a system package manager) and may requires the help from core team members of flutter, so I just give my suggestions here and I won't expect this can be done soon.

Yeah it sounds waaaaay more complicated than the alleged 10 liner that was referenced earlier in this thread.

TIL there are more discussion on this going on: http://flutter.dev/go/sdk-per-platform-installers

Was this page helpful?
0 / 5 - 0 ratings