docopt / docopts

Shell interpreter for docopt, the command-line interface description language.
Other
494 stars 53 forks source link

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

Closed agilgur5 closed 1 year ago

agilgur5 commented 1 year ago

Summary

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

Details

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)

Sylvain303 commented 1 year ago

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 :wink:, especially to help my mac user. (2 up to 4 I guess :yum: ) 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

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

image

agilgur5 commented 1 year ago

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 commented 1 year ago

Seems great. Lets merge that.