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

Install size #19254

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open

Install size #19254

wants to merge 39 commits into from

Conversation

tyuwags
Copy link

@tyuwags tyuwags commented Feb 6, 2025

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

resolve #18373

As discussed in the issue, these changes add the --ask option and the HOMEBREW_ASK environment variable to display the packages and dependencies that will be installed, along with their sizes, and prompt the user for input.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tyuwags, great work so far!

@tyuwags tyuwags marked this pull request as draft February 11, 2025 23:55
@tyuwags tyuwags marked this pull request as ready for review February 16, 2025 05:29
@tyuwags
Copy link
Author

tyuwags commented Feb 16, 2025

Adding the --ask option for reinstall and upgrade commands. Modifying code to take into account pinned and build from source option

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good so far, thanks @tyuwags! Remaining bits would be:

  • extracting into shared methods
  • adding a unit test for the extracted method to get some code coverage for this

Shout if you need help with any of that!

@@ -302,6 +307,98 @@ def run
Install.perform_preinstall_checks_once
Install.check_cc_argv(args.cc)

ask_input = lambda {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these be dedicated methods rather than a lambda? The method this is part of is getting very long and we don't typically use lambda like this just for variable scoping.

@@ -126,6 +131,98 @@ def run
unless formulae.empty?
Install.perform_preinstall_checks_once

ask_input = lambda {
ohai "Do you want to proceed with the installation? [Y/y/yes/N/n]"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a lot of duplicated code here, would be good to extract into shared method(s) in Library/Homebrew/install.rb

@tyuwags
Copy link
Author

tyuwags commented Feb 18, 2025

For the shared library:
That's what I thought too but I didn't know where to put that code to be correct and how to call it properly

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.

brew install should display download size
2 participants