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

cmd/info: show size information #18172

Merged
merged 1 commit into from
Sep 25, 2024
Merged

Conversation

cho-m
Copy link
Member

@cho-m cho-m commented Aug 26, 2024

  • 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?

Follow up to #18144

Proof of concept for now on getting size info into brew info.

May need to see if any better ways to get this information out of the manifest. A bit trickier than just tab info.

brew info cling git-town --github-manifest
==> cling: stable 1.0 (bottled)
C++ interpreter
https://root.cern/cling/
Not installed
Bottle size: 264.3MB
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/c/cling.rb
License: (LGPL-2.1-only or NCSA) and (Apache-2.0 with LLVM-exception)
==> Dependencies
Build: cmake ✘

==> git-town: stable 15.3.0 (bottled)
High-level command-line interface for Git
https://www.git-town.com/
Not installed
Bottle size: 5MB
Installed size: 16.0MB
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/g/git-town.rb
License: MIT
==> Dependencies
Build: go ✔

For comparison

Also, mainly an approximate if pouring bottle into non-standard prefix.

Library/Homebrew/cmd/info.rb Outdated Show resolved Hide resolved
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.

Makes sense to me so far, nice work!

Would be interested (post-merge) in benchmarks for this so we can consider how to get to being able to put these in the API.

CC @reitermarkus also for thoughts on whether the parallel downloading work overlaps here and when it might be ready.

Library/Homebrew/cmd/info.rb Outdated Show resolved Hide resolved
Library/Homebrew/resource.rb Show resolved Hide resolved
@reitermarkus
Copy link
Member

on whether the parallel downloading work overlaps here

Yes, slight overlap, but the changes to Resource here seem to be exactly the same, so shouldn't conflict too hard.

Library/Homebrew/cmd/info.rb Outdated Show resolved Hide resolved
Library/Homebrew/cmd/info.rb Outdated Show resolved Hide resolved
@cho-m cho-m force-pushed the brew-info-size branch 2 times, most recently from e30935d to c53a7e3 Compare September 24, 2024 22:34
@cho-m
Copy link
Member Author

cho-m commented Sep 24, 2024

Updated and should be ready for review. Will be working on more JSON API code path in #18403 (WIP).

Changes include:

  • always show size info if manifest is already downloaded
  • Renamed arg to --fetch-manifest as that is literally what it does. After WIP PR, this will behave similar to brew fetch --only-manifest <formula>; brew info <formula>

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.

This is great, thanks @cho-m!

Library/Homebrew/cmd/info.rb Outdated Show resolved Hide resolved
Library/Homebrew/software_spec.rb Outdated Show resolved Hide resolved
Library/Homebrew/software_spec.rb Outdated Show resolved Hide resolved
Co-authored-by: Mike McQuaid <[email protected]>
Co-authored-by: Markus Reiter <[email protected]>
@MikeMcQuaid MikeMcQuaid merged commit e030625 into Homebrew:master Sep 25, 2024
28 checks passed
@cho-m cho-m deleted the brew-info-size branch September 25, 2024 13:14
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.

3 participants