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

Look at recommendation to run brew update, which can take multiple minutes depending on state of host computer #932

Open
gingerbeardman opened this issue Aug 26, 2022 · 2 comments

Comments

@gingerbeardman
Copy link

gingerbeardman commented Aug 26, 2022

(Following on from twitter thread)

Describe
When doing setup/install, during the ESP32/ESP-IDF phase for my M5Paper, it is advised to run brew update.

Depending on the state of the host computer (how many packages are installed using brew, when brew update was last run, network and cpu speeds, etc) the brew update process can take tens of minutes to complete - for me it took over 30 minutes on a 10-core M1 Pro MBP running macOS 12.5.1.

See: Step 5 in documentation/devices/esp32.md (emphasis mine)

  1. Update homebrew and then install Python, cmake, ninja, the pip package management system, and pyserial. Also run a brew upgrade on those packages, in case you already had older versions installed:
brew update
brew install python3 cmake ninja dfu-util
brew upgrade python3 cmake ninja dfu-util
sudo easy_install pip
pip install pyserial

Note: be wary of the differences between

  1. brew update
    • updates homebrew itself
    • updates version information for all packages installed
    • can take many minutes depending on current config of host computer
  2. brew upgrade
    • downloads and installs newer package binaries

Why do you think this feature would be useful?

  • quicker setup/install would reduce friction and make onboarding quicker and more pleasant
  • reduce the number of users who drop-off at the install phase

and

  • is a mass brew update truly needed?
  • is it desirable to allow brew update to add a speed bump of unknown severity to your install process?

Describe alternatives you've considered

  • update version info of only ESP-IDF dependencies
  • use an alternative package management approach that does not have adverse runtime surprises
    • manually
    • nix
    • macports
    • etc.
@andycarle
Copy link
Member

Hi @gingerbeardman — thank you for the report. I'm sorry to hear that this portion of the install process was misbehaving for you.

It's curious (and unfortunate) that brew update took so long to complete on your machine. My understanding is that brew update is intended to be a very fast operation. On a quick survey of macOS machines we have available on the team, it took somewhere in the range of 10 to 60 seconds to complete. That said, I see a variety of GitHub issues and StackOverflow posts out there with people complaining about slow brew update executions. (e.g. Homebrew/brew#4755 and Homebrew/brew#13224) And anecdotally I've heard a couple of times that early brew installs on M1 hardware were particularly broken and may need to be re-installed now that the kinks have been worked out.

I will consider some alternatives here, including those that you've listed. Unfortunately, it is not possible, as far as I know, to scope the execution of brew update. That is, it does not take any arguments to restrict the update to specific packages/taps in the way that brew upgrade does.

MacPorts would be fine. Indeed, if you have MacPorts installed it would be just as good to do port install cmake ninja dfu-util.

Brew and MacPorts are the two options suggested by Espressif in their ESP-IDF setup instructions, so I'm inclined to agree that we should include that option in our ESP32 guide as well. Perhaps it would suffice to go with the ESP-IDF language and explain how to do this with either brew or port and also link to direct installers.

@gingerbeardman
Copy link
Author

gingerbeardman commented Aug 26, 2022

I'll leave the final decision to you, no worries. Mentioning brew and macports would be a good start.

It is indeed concerning and perhaps this is something I can take up with brew. My M1 laptop is only a couple of months old so brew is quite fresh, I don't use the package manager much, though I did install all my regulars when I migrated settings to the new computer.

I wish I could turn back time and profile the commands a little more, issuing them one by one. On closer inspection I wonder if I pasted all the lines at once, and thus could it have been something other than the brew update taking a long time? I'll give it some thought.

It would be great if before each set of commands expectations could be set as to the time taken.

I wondered if it was normal for the ESP-IDF install to take 30+ minutes, or whether that was only with brew? So I did port install cmake ninja dfu-util and it completed in a couple of minutes.

ps: I still use my Sony Reader PRS-650 that runs Kinoma! Small world.

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

2 participants