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

Fix bottle prefix and repository handling #9481

Merged

Conversation

MikeMcQuaid
Copy link
Member

We were previously only looking at the cellar value when pouring bottles and ignoring the prefix and (implicit) repository.

Actually look at these values and set the defaults for each platform.

Also, when we're relocating to create or pour bottles when prefix and repository are equal then skip relocating the repository and always use references to the prefix instead.

Fixes #9453

@MikeMcQuaid MikeMcQuaid added the critical Critical change which should be shipped as soon as possible. label Dec 9, 2020
@BrewTestBot
Copy link
Member

BrewTestBot commented Dec 9, 2020

Review period ended.

@MikeMcQuaid MikeMcQuaid force-pushed the bottle_prefix_repository_handling branch 3 times, most recently from c43840e to f223fbb Compare December 9, 2020 13:25
We were previously only looking at the `cellar` value when pouring
bottles and ignoring the `prefix` and (implicit) `repository`.

Actually look at these values and set the defaults for each platform.

Also, when we're relocating to create or pour bottles when `prefix`
and `repository` are equal then skip relocating the `repository` and
always use references to the `prefix` instead.

Fixes #9453
@MikeMcQuaid MikeMcQuaid force-pushed the bottle_prefix_repository_handling branch from f223fbb to 0f9bad0 Compare December 9, 2020 13:53
@fxcoudert
Copy link
Member

Fixes bottling issues on ARM Big Sur (tested on pkg-config libpng freetype)

@MikeMcQuaid MikeMcQuaid merged commit 2c77a54 into Homebrew:master Dec 9, 2020
@MikeMcQuaid MikeMcQuaid deleted the bottle_prefix_repository_handling branch December 9, 2020 14:45
@sjackman
Copy link
Member

After this PR, it is no longer possible to install cellar :any bottles in a non-standard prefix. For example:

$ git clone --reference=/usr/local/Homebrew https://github.com/Homebrew/brew ~/.homebrew
$ git clone --reference=/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core https://github.com/Homebrew/homebrew-core ~/.homebrew/Library/Taps/homebrew/homebrew-core
$ ~/.homebrew/bin/brew install hello
Warning: Building hello from source as the bottle needs:
- HOMEBREW_CELLAR: any_skip_relocation (yours is /Users/shaun.jackman/.homebrew/Cellar)
- HOMEBREW_PREFIX: /usr/local (yours is /Users/shaun.jackman/.homebrew)
- HOMEBREW_REPOSITORY: /usr/local/Homebrew (yours is /Users/shaun.jackman/.homebrew)
==> Downloading https://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz

$ ~/.homebrew/bin/brew --version
Homebrew 2.6.2-9-g26a59c9
Homebrew/homebrew-core (git revision 1b4630; last commit 2020-12-14)

@sjackman
Copy link
Member

After this PR, brew install --force-bottle hello fails with Error: undefined method 'stage' for nil:NilClass when Homebrew is installed in a non-standard location like for example ~/.homebrew/. Steps to reproduce on macOS are:

$ git clone --reference=/usr/local/Homebrew https://github.com/Homebrew/brew ~/.homebrew
$ git clone --reference=/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core https://github.com/Homebrew/homebrew-core ~/.homebrew/Library/Taps/homebrew/homebrew-core
$ ~/.homebrew/bin/brew install --force-hello hello
==> Downloading https://homebrew.bintray.com/bottles/hello-2.10.catalina.bottle.
Already downloaded: /Users/shaun.jackman/Library/Caches/Homebrew/downloads/6a8a266068965d3a7ea16bfe4821367cb94c47f904e7fc23ec61fad8a9859c54--hello-2.10.catalina.bottle.tar.gz
Error: undefined method `stage' for nil:NilClass

Issue reported at #9521

@MikeMcQuaid
Copy link
Member Author

After this PR, it is no longer possible to install cellar :any bottles in a non-standard prefix.

Fixed in #10025

@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Jan 15, 2021
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Jan 15, 2021
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.

Bottle path substitution when HOMEBREW_REPOSITORY == HOMEBREW_PREFIX
4 participants