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

set prefer_loading_from_api: true for brew fetch #13089

Merged
merged 2 commits into from
Apr 7, 2022

Conversation

steveh7812
Copy link

@steveh7812 steveh7812 commented Apr 5, 2022

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

This is to fix #13088 by passing prefer_loading_from_api: true when calling to_formulae_and_casks. I am following what I found in Library/Homebrew/cmd/install.rb and this solves the issue in my testing; however I know there are larger discussions happening around overall support for HOMEBREW_INSTALL_FROM_API so I'm happy to incorporate any additional changes that are needed.

@MikeMcQuaid MikeMcQuaid requested review from Rylan12 and Bo98 April 6, 2022 09:11
@Rylan12
Copy link
Member

Rylan12 commented Apr 6, 2022

Thanks for the PR! This is a good start (it's what I would have done). In testing, it looks like brew fetch --deps doesn't work quite right for formulae. I'll continue looking into it to figure out what the best fix for it is.

@Bo98
Copy link
Member

Bo98 commented Apr 6, 2022

I'm fine with merging even a partial fix given the situation could change under #12936.

@Rylan12
Copy link
Member

Rylan12 commented Apr 7, 2022

I'd rather not merge a known bug given that the other PR is still in draft form.

I poked around more and found that the problem is that brew fetch --deps fetches all dependencies and HOMEBREW_INSTALL_FROM_API only knows how to handle runtime dependencies. We avoid this when running brew install by only fetching runtime dependencies. I pushed a commit that modifies the way that brew fetch --deps works so that when HOMEBREW_INSTALL_FROM_API is set, it will only return runtime dependencies (I think this is fine since building from source with HOMEBREW_INSTALL_FROM_API isn't supported). All other cases are unchanged.

@Bo98
Copy link
Member

Bo98 commented Apr 7, 2022

I'd rather not merge a known bug

My point was that it was pre-existing but yes.

I poked around more and found that the problem is that brew fetch --deps fetches all dependencies and HOMEBREW_INSTALL_FROM_API only knows how to handle runtime dependencies. We avoid this when running brew install by only fetching runtime dependencies. I pushed a commit that modifies the way that brew fetch --deps works so that when HOMEBREW_INSTALL_FROM_API is set, it will only return runtime dependencies (I think this is fine since building from source with HOMEBREW_INSTALL_FROM_API isn't supported). All other cases are unchanged.

Does this overlap with #13065 at all?

@MikeMcQuaid
Copy link
Member

Thanks so much for your first contribution! Without people like you submitting PRs we couldn't run this project. You rock, @steveh7812!

@MikeMcQuaid MikeMcQuaid merged commit 9c58f9a into Homebrew:master Apr 7, 2022
@steveh7812
Copy link
Author

Thanks @MikeMcQuaid !

@steveh7812 steveh7812 deleted the fetch-from-api branch April 7, 2022 13:23
@github-actions github-actions bot added the outdated PR was locked due to age label May 8, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 8, 2022
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.

brew fetch returns error when HOMEBREW_INSTALL_FROM_API is set
4 participants