Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Homebrew Formula #97

Closed
tinder-maxwellelliott opened this issue Mar 4, 2020 · 17 comments
Closed

Support for Homebrew Formula #97

tinder-maxwellelliott opened this issue Mar 4, 2020 · 17 comments

Comments

@tinder-maxwellelliott
Copy link
Contributor

I have been investigating possibly allowing Mockolo to be installed via Homebrew. Are there any blockers to doing this? My strategy was to use the tarball creation script

./install-script.sh -s [source dir] -t mockolo -d [destination dir] -o [output filename]

To generate a tarball that the brew formula would install and then use homebrew's bin linking to make mockolo globally executable

@tinder-maxwellelliott tinder-maxwellelliott changed the title Support for Homebrew Forumula Support for Homebrew Formula Mar 4, 2020
@marciniwanicki
Copy link
Collaborator

marciniwanicki commented Mar 4, 2020

It's a nice idea. I think there are no technical obstacles. On the other hand the formula might be not accepted for homebrew/core just yet. One of the requirements is for the formula to "be known". Maybe mockolo is already "known" - don't know :) Check out https://docs.brew.sh/Acceptable-Formulae for more info.

Another option would be to create a custom tap, maybe Uber org (https://github.com/uber) already has one (I haven't checked); in that case the formula could be pushed there. It's quite common solution and allows to quickly upstream new versions.

@tinder-maxwellelliott
Copy link
Contributor Author

tinder-maxwellelliott commented Mar 4, 2020

Can we just update the latest release with the output from ./install-script.sh -s [source dir] -t mockolo -d [destination dir] -o [output filename] (basically upload a tar.gz of the two files). If we do that our teams can at least make their own taps and start using mockolo via homebrew

@marciniwanicki
Copy link
Collaborator

Could work but it would probably skip few artifacts which brew implicitly include in the so called bottles (README.md, LICENSE etc.). Also, not sure if the output is brew-friendly, have the right folder structure (mockolo/<version>/bin etc).

A simple formula using swift build should allow the users to build the brew formula locally (when using brew install). It can also use prebuilt binary (bottle) if the link to the binary is also specified in the formula. You can make the bottle view brew bottle.. command, no need to package everything by hand.

I'd be interested to know how you use homebrew to distribute dev tools, from my experience it does not work well for bigger teams, quite tricky to enforce all dev and CI environments to use the right versions.

@tinder-maxwellelliott
Copy link
Contributor Author

The issue with building from source is that it is very painful, can take up to 5 minutes! Other swift command line tools are able to support this so I believe it is possible for mockolo. Using brew would really open up the user base of this project.

As for version management yes you need to write more code to manage the versions as brew does not have the ability built it, is is pretty easy to script around it though

@elsh
Copy link
Contributor

elsh commented Mar 5, 2020

There's nothing preventing it; it's been on the todo list. Looks like brew cask might be an option for a binary only distribution if we go down that road. We can look into this soon.

@tinder-maxwellelliott
Copy link
Contributor Author

Can I build a cask for you guys? Is that okay?

@elsh
Copy link
Contributor

elsh commented Mar 6, 2020

Can I build a cask for you guys? Is that okay?

Yes go ahead

@tinder-maxwellelliott
Copy link
Contributor Author

Formula PR is here Homebrew/homebrew-core#51274

@tinder-maxwellelliott
Copy link
Contributor Author

This will not work, building the formula takes too long on CI to even pass, we need to create a Cask. Can we make a new tagged release with a tar.gz of the built binaries attached to it? I need that tar.gz to create the cask https://github.com/Homebrew/homebrew-cask/blob/master/doc/development/adding_a_cask.md

@elsh
Copy link
Contributor

elsh commented Mar 8, 2020

@tinder-maxwellelliott
Copy link
Contributor Author

@elsh
Copy link
Contributor

elsh commented Mar 8, 2020

Fyi, the dylib in the same tarball, which is needed to run mockolo (and has to be in the same directory as the executable), requires xcode 11.0+ (swift 5.1+).

@tinder-maxwellelliott
Copy link
Contributor Author

Okay I am attempting this again, Homebrew/homebrew-core#51274 , I am not sure the build will finish in time, sometimes the swift build times out

@elsh
Copy link
Contributor

elsh commented Mar 11, 2020

Thanks for pushing the pr. Looks like all checks have passed, pending a final review.

@tinder-maxwellelliott
Copy link
Contributor Author

Do you want to comment on that PR, I am not sure when they will get around to looking at it

@elsh
Copy link
Contributor

elsh commented Mar 13, 2020

🎉

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

No branches or pull requests

3 participants