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

Port bundle command to use AbstractCommand #1334

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

dduugg
Copy link
Member

@dduugg dduugg commented Apr 1, 2024

See Homebrew/homebrew-services#639

Discovered via https://github.com/Homebrew/brew/blob/master/Library/Homebrew/test/cmd/bundle_spec.rb (this should be the last PR of this type, going by setup_remote_tap call sites in brew tests)

@dduugg dduugg force-pushed the abstract-cmd branch 2 times, most recently from b2eb6c4 to fbb57a3 Compare April 1, 2024 19:39
@MikeMcQuaid MikeMcQuaid merged commit 984473e into Homebrew:master Apr 2, 2024
4 checks passed
@MikeMcQuaid
Copy link
Member

Looks good, thanks again @dduugg!

@ileitch
Copy link

ileitch commented Apr 2, 2024

This change appears to be breaking environments that use HOMEBREW_NO_AUTO_UPDATE=1, which is common in CI.

==> Tapping homebrew/bundle
Cloning into '/opt/homebrew/Library/Taps/homebrew/homebrew-bundle'...
Tapped 1 command (109 files, 2.3MB).
Error: cannot load such file -- abstract_command
/opt/homebrew/Library/Taps/homebrew/homebrew-bundle/cmd/bundle.rb:3:in `require'
/opt/homebrew/Library/Taps/homebrew/homebrew-bundle/cmd/bundle.rb:3:in `<top (required)>'
/opt/homebrew/Library/Homebrew/extend/kernel.rb:10:in `require'
/opt/homebrew/Library/Homebrew/extend/kernel.rb:10:in `require?'
/opt/homebrew/Library/Homebrew/commands.rb:78:in `external_ruby_v2_cmd_path'
/opt/homebrew/Library/Homebrew/brew.rb:85:in `<main>'

@MikeMcQuaid
Copy link
Member

@ileitch If you set HOMEBREW_NO_AUTO_UPDATE and do not e.g. pin your taps at a specific version: this will happen, sorry. As per all our issue templates: if brew update fixes the problem, we do not consider it a bug.

@ileitch
Copy link

ileitch commented Apr 2, 2024

@MikeMcQuaid Because the lock file contains local environment info, we can't use a lock file in our repo. Having to execute brew update in every workflow is problematic because it introduces a performance impact and potential instability.

@MikeMcQuaid
Copy link
Member

@ileitch You'll need to figure out how to solve this yourself then, sorry.

@MikeMcQuaid
Copy link
Member

@ileitch Care to explain the 👎🏻?

@ileitch
Copy link

ileitch commented Apr 2, 2024

@MikeMcQuaid The points I mentioned are very real problems for teams maintaining CI environments, and how you simply dismissed them is why I downvoted your comment. In our case, we explicitly introduced HOMEBREW_NO_AUTO_UPDATE=1 to avoid a source of breakages and performance issues. I don't think we can just go back to implicit updates, and we may need to find another approach that doesn't depend on brew bundle, or perhaps even Homebrew altogether.

It's unfortunate you were not able to identify a migration strategy that does not introduce sudden breakages for your users, especially given the inflexibility around lock files. At least a warning of some kind would have been helpful.

@MikeMcQuaid
Copy link
Member

@ileitch I'm aware of these problems but also: Homebrew maintainers are volunteers and we are not obligated to help you. Explaining the problem and getting a no context 👎🏻 makes us disinclined to help you in future.

You not need to go back to implicit updates but, in this case, you need to be able to figure out a way to solve this problem yourself as the default, supported Homebrew configuration does not have this problem. If you're tapping a repository during your build process at whatever the latest revision is: you're asking Homebrew (a rolling-release package manager) to not update some parts of itself while running the latest versions of other parts. This is going to break and there's nothing we can do about this.

I've opened Homebrew/brew#17003 to better explain that these issues should not be reported in these situations and that this is a known issue. I'm not sure what we can do beyond that; it's not tenable to have master of Homebrew/homebrew-bundle and other taps to work on arbitrary old versions of Homebrew (note: this issue would not have occurred if you were on the latest stable tag).

@ileitch
Copy link

ileitch commented Apr 2, 2024

I apologize for the flippant downvote, though I felt I was responding in kind to a flippant comment on your part. As an open-source maintainer myself, I completely understand you are under no obligation to help me, nor do I expect you to. I appreciate the full explanation in your last comment, it provides the level of detail I think your initial comment was lacking.

Perhaps there's a way to catch these errors as they occur, and explain the dangers around HOMEBREW_NO_AUTO_UPDATE and missing lock files. HOMEBREW_NO_AUTO_UPDATE is a fairly commonly used feature, in my experience, and I'm sure there are many users out there that will run into this sharp corner over the next few days.

@MikeMcQuaid
Copy link
Member

I apologize for the flippant downvote

Thanks, I appreciate the apology ❤️

Perhaps there's a way to catch these errors as they occur, and explain the dangers around HOMEBREW_NO_AUTO_UPDATE and missing lock files.

That's exactly the intent of Homebrew/brew#17003.

@MikeMcQuaid
Copy link
Member

@ileitch #1335 will now print an error if brew bundle is too old, too.

@dduugg dduugg deleted the abstract-cmd branch April 2, 2024 18:09
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants