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

formula_installer: handle nil runtime dependencies #16952

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

EricFromCanada
Copy link
Member

@EricFromCanada EricFromCanada commented Mar 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?

Some old bottles (Sierra and earlier) will fail to install when the downloaded bottle manifest has its runtime_dependencies set to null rather than []. This happens during manifest generation when Tab finds the tab's homebrew_version to be either not present or earlier than 1.1.6. The existing fetch_bottle_tab method passes an empty list if runtime_dependencies is not present; this change ensures that the same happens if runtime_dependencies is present but nil.

Also, Tab#runtime_dependencies could return an empty list if homebrew_version < 1.1.6 to avoid this in future manifests. Not sure if that's necessary.

Before:

==> Downloading https://ghcr.io/v2/homebrew/core/libcuefile/manifests/r475-1
Already downloaded: /Users/vmadmin/Library/Caches/Homebrew/downloads/bcfd5f9c5e66525827bd2c1024f9dbee05db47868b3077b3e19178fe9e25fd91--libcuefile-r475-1.bottle_manifest.json
Error: undefined method `each_with_object' for nil:NilClass

After:

==> Downloading https://ghcr.io/v2/homebrew/core/libcuefile/manifests/r475-1
Already downloaded: /Users/vmadmin/Library/Caches/Homebrew/downloads/bcfd5f9c5e66525827bd2c1024f9dbee05db47868b3077b3e19178fe9e25fd91--libcuefile-r475-1.bottle_manifest.json
==> Fetching libcuefile
==> Downloading https://ghcr.io/v2/homebrew/core/libcuefile/blobs/sha256:66ec2d9281a5459326a1b2d220b9f68fa241a6b9f8370324377af
Already downloaded: /Users/vmadmin/Library/Caches/Homebrew/downloads/f1ebb348b1ce9b4e5bd593221f88ed9bd76af0441b08cf3acda6e7fe1c45306e--libcuefile--r475.sierra.bottle.1.tar.gz
==> Pouring libcuefile--r475.sierra.bottle.1.tar.gz
🍺  /usr/local/Cellar/libcuefile/r475: 11 files, 177.2KB
==> Running `brew cleanup libcuefile`...

Copy link
Member

@Bo98 Bo98 left a comment

Choose a reason for hiding this comment

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

Thanks!

@EricFromCanada EricFromCanada merged commit 6eb589f into master Mar 26, 2024
25 checks passed
@EricFromCanada EricFromCanada deleted the nil-runtime-deps branch March 26, 2024 23:00
@MikeMcQuaid
Copy link
Member

Makes sense, thanks @EricFromCanada!

@github-actions github-actions bot added the outdated PR was locked due to age label Apr 27, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants