Skip to content

ci: install bash5 on macOS via Brew w/ no auto-update#63

Merged
Sylvain303 merged 1 commit intodocopt:masterfrom
agilgur5:ci-install-bash5-via-brew
Aug 25, 2022
Merged

ci: install bash5 on macOS via Brew w/ no auto-update#63
Sylvain303 merged 1 commit intodocopt:masterfrom
agilgur5:ci-install-bash5-via-brew

Conversation

@agilgur5
Copy link
Copy Markdown
Contributor

Summary

Use HOMEBREW_NO_AUTO_UPDATE=1 brew install bash to install bash5 via Brew and skip Brew's slow auto-update

Details

  • per the deleted in-line comments, the reason it was installed as a static binary was because Brew's auto-update is slow
    • we can disable the auto-update though, so do that instead in order to install via Brew

Slowly making things a bit less hacky!

Testing

Can see CI passing on my branch here (which is built on top of #62 for CI to exist)

@agilgur5 agilgur5 changed the title ci: install bash5 on macOS via Brew w/ no auto-update ci: install bash5 on macOS via Brew w/ no auto-update Aug 14, 2022
@Sylvain303
Copy link
Copy Markdown
Collaborator

I don't understand where the conflict come from is this pull request?
So you finally found a work around for speeding up the brew install, great.

As you know, I'm a hacker, and obviously the repository has plenty of hack 😉, especially to help my mac user. (2 up to 4 I guess 😋 ) So spending time on hack is more fun than swearing against bash 3 version and non-GNU binaries and such.

This bash binary was a great hack I found not to not wait hours for the CI to finish on mac. Was more that 3 or 5 min for getting bash installed.

The run link CI you gave above we are at 30s for bash + bats

😆 19s vs 1m50s (you understand of much love I put in my hack for mac! 😋 )

image

- per the deleted in-line comments, the reason it was installed as a static binary was because Brew's auto-update is slow
  - we can disable the auto-update though, so do that instead in order to install via Brew
@agilgur5 agilgur5 force-pushed the ci-install-bash5-via-brew branch from 1d73617 to 9f439b4 Compare August 25, 2022 03:17
@agilgur5
Copy link
Copy Markdown
Contributor Author

agilgur5 commented Aug 25, 2022

I don't understand where the conflict come from is this pull request?

ah it was because these comments were deleted in this PR:

#- if [[ "$RUNNER_OS" == "macOS" ]]; then brew update ; fi
#- if [[ "$RUNNER_OS" == "macOS" ]]; then brew install bash; fi

In #62, I had to change the var from TRAVIS_OS_NAME to RUNNER_OS, resulting in the merge conflict.

Rebased and fixed the conflict now!

This bash binary was a great hack I found not to not wait hours for the CI to finish on mac. Was more that 3 or 5 min for getting bash installed.

Yea Brew's auto-update is painfully slow... I think it took me like 30 min when I did it on a Mac I hadn't used in several months... So it's a general pain point of Mac users for sure, not just for CI testing 😕

At least there's a flag to disable it!

😆 19s vs 1m50s (you understand of much love I put in my hack for mac! 😋 )

It is still slower since it has to download the newer Bash version.
That being said, in my experience, GitHub Action's Macs are generally slower than Ubuntu. That's been the case in nearly every repo I maintain, so I imagine the hardware GitHub's using for Macs is just slower. (I guess they're definitely not using the new, powerful M1s / M2s!)

Now that I've rebased this on top of the CI change, can see the timings in this PR's checks (a bit faster this time around):
Screen Shot 2022-08-24 at 11 27 23 PM

And if you click into each run, you can get the detailed timing of each step:
Screen Shot 2022-08-24 at 11 28 46 PM
Screen Shot 2022-08-24 at 11 28 58 PM

So, as you can see, GitHub's Mac hardware is significantly slower for every step, from setting up Go, installing, and testing. So it's not just downloading Bash 5 that's slower -- that actually doesn't add that much time -- the hardware itself being slower adds the most time. I.e. it seems to be CPU-bound, not I/O-bound (although the disk or network interface could be slower as well on the Mac hardware)

@Sylvain303
Copy link
Copy Markdown
Collaborator

Seems great. Lets merge that.

@Sylvain303 Sylvain303 merged commit 94099bb into docopt:master Aug 25, 2022
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