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: Fix --only-dependencies formula arch handling #12968

Conversation

issyl0
Copy link
Member

@issyl0 issyl0 commented Mar 6, 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?

  • Fixes brew install --only-dependencies should not check arch requirements #12965.
  • For a formula with an architecture requirement and a user requesting --only-dependencices to be installed, this now proceeds to install the formula dependencies regardless of the requested formula architecture because the formula itself will never be installed.
  • The way dependencies and requirements are computed, the depends_on :arch is still a dependency, so it's in the list of formula dependencies to check and potentially install. Hence, we have to remove from the list the dependent from recursive_requirements with the same name as the formula so that there are no confusing unsatisfied requirements for the named formula when we don't need it to be installed.
  • I thought about why this might be, maybe it's because we can't guarantee that formula dependencies work on different architectures. But in that case they'd have their own architecture requirements, so we'd see the failure for them. So I don't know of any more reasons.

Before:

$ brew install --only-dependencies julia
julia: The x86_64 architecture is required for this software.
Error: julia: An unsatisfied requirement failed this build.

After:

❯ brew install --only-dependencies julia
==> Downloading [...]
==> Installing dependencies for julia: libnghttp2, mpfr and suite-sparse [...]

- For a formula with an architecture requirement and a user requesting
  `--only-dependencices` to be installed, this now proceeds to install the
  formula dependencies regardless of the requested formula architecture because
  the formula itself will never be installed.
- The way dependencies and requirements are computed, the `depends_on :arch` is
  still a dependency, so it's in the list of formula dependencies to check and
  potentially install. Hence, we have to remove from the list the dependent
  from `recursive_requirements` with the same name as the formula so that there
  are no confusing unsatisfied requirements for the named formula when we don't
  need it to be installed.
- I thought about why this might be, maybe it's because we can't guarantee that
  formula dependencies work on different architectures. But in that case they'd
  have their own architecture requirements, so we'd see the failure for them.
  So I don't know of any more reasons.

Before:

```shell
$ brew install --only-dependencies julia
julia: The x86_64 architecture is required for this software.
Error: julia: An unsatisfied requirement failed this build.
```

After:

```shell
❯ brew install --only-dependencies julia
==> Downloading [...]
==> Installing dependencies for julia: libnghttp2, mpfr and suite-sparse
```
@BrewTestBot
Copy link
Member

Review period will end on 2022-03-08 at 00:00:00 UTC.

@BrewTestBot BrewTestBot added the waiting for feedback Merging is blocked until sufficient time has passed for review label Mar 6, 2022
@issyl0 issyl0 added the critical Critical change which should be shipped as soon as possible. label Mar 6, 2022
@BrewTestBot BrewTestBot removed the waiting for feedback Merging is blocked until sufficient time has passed for review label Mar 6, 2022
@BrewTestBot
Copy link
Member

Review period skipped due to critical label.

@MikeMcQuaid
Copy link
Member

Thanks @issyl0!

@issyl0 issyl0 merged commit ea0ddc3 into Homebrew:master Mar 7, 2022
@issyl0 issyl0 deleted the dont-check-arch-requirements-for-only-dependencies branch March 7, 2022 09:49
@github-actions github-actions bot added the outdated PR was locked due to age label Apr 7, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
critical Critical change which should be shipped as soon as possible. outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

brew install --only-dependencies should not check arch requirements
3 participants