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

Don't lowercase URL when those are specified in Brewfile #672

Closed
wants to merge 1 commit into from
Closed

Don't lowercase URL when those are specified in Brewfile #672

wants to merge 1 commit into from

Conversation

pinkahd
Copy link

@pinkahd pinkahd commented Apr 6, 2020

If a Brewfile defines a specific version of a package and this
package originates form an URL, the name shouldn't be lowercase.

An example of such file could be:

brew "https://raw.githubusercontent.com/Homebrew/homebrew-core/50c928c870001577ce6b7e28edf43e05df699852/Formula/etcd.rb"

Previous to this case this was falling with this error:

curl: (22) The requested URL returned error: 404 Not Found
Error: Failure while executing; `/usr/bin/curl -q --globoff --show-error --user-agent Homebrew/2.2.11\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 10.15.4\)\ curl/7.64.1 --fail --progress-bar --retry 3 --location --remote-time --continue-at 0 --output /Users/alexandru/Library/Caches/Homebrew/Formula/etcd.rb https://raw.githubusercontent.com/homebrew/homebrew-core/50c928c870001577ce6b7e28edf43e05df699852/formula/etcd.rb` exited with 22. Here's the output:

curl: (22) The requested URL returned error: 404 Not Found

The reason of the failure was due to the name been transformed
to lowercase.

If a Brewfile defines a specific version of a package and this
package originates form an URL, the name shouldn't be lowercase.

An example of such file could be:

```
brew "https://raw.githubusercontent.com/Homebrew/homebrew-core/50c928c870001577ce6b7e28edf43e05df699852/Formula/etcd.rb"
```

Previous to this case this was falling with this error:

```
curl: (22) The requested URL returned error: 404 Not Found
Error: Failure while executing; `/usr/bin/curl -q --globoff --show-error --user-agent Homebrew/2.2.11\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 10.15.4\)\ curl/7.64.1 --fail --progress-bar --retry 3 --location --remote-time --continue-at 0 --output /Users/alexandru/Library/Caches/Homebrew/Formula/etcd.rb https://raw.githubusercontent.com/homebrew/homebrew-core/50c928c870001577ce6b7e28edf43e05df699852/formula/etcd.rb` exited with 22. Here's the output:

curl: (22) The requested URL returned error: 404 Not Found
```

The reason of the failure was due to the name been transformed
to lowercase.
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.

We specifically don't want to support URLs in Brewfiles so would accept modifications to this PR to error on their use.

@pinkahd
Copy link
Author

pinkahd commented Apr 6, 2020

Is there a reason why URL's aren't supported?

My case here is that I need a specific version of etcd installed on the system. From my understanding the way to do that in brew is to install a past formula. (brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/50c928c870001577ce6b7e28edf43e05df699852/Formula/etcd.rb)unless I'm missing something.

@MikeMcQuaid
Copy link
Member

Is there a reason why URL's aren't supported?

Run brew install $URL and you'll see the reason 😉.

In short: they will break and when they do they can't be fixed. We provide tooling (brew extract) to make your own specific versions you depend on that can be fixed when they break.

@pinkahd
Copy link
Author

pinkahd commented Apr 6, 2020

Thanks for point that out.

I know this is not the best place to ask this but I've done exactly what you've said extracted the package and create a new tap. But now it tries to build the package... Since it can't find a pre-build package in:

==> Downloading https://homebrew.bintray.com/bottles-etcd/etcd-3.3.15.mojave.bottle.1.tar.gz
curl: (22) The requested URL returned error: 404 Not Found

Is this expected or did I messed something up?

When installing from an URL I can get the correct version ==> Downloading https://homebrew.bintray.com/bottles/etcd-3.3.15.mojave.bottle.1.tar.gz Is there a way to make my tap install this? Building the package from scratch I don't think should be the desired result since I cannot assume re-building it will generate a replicable build.


If this is not the case I still think URL installs should be allow, if brew install command allows them I see no reason why Brewfile shouldn't. Or at least have a way to specify a version of a package in the Brewfile.

@MikeMcQuaid
Copy link
Member

Is this expected or did I messed something up?

Somewhat expected. You'll want to remove the bottle do block. See Homebrew/brew#6059

If this is not the case I still think URL installs should be allow, if brew install command allows them I see no reason why Brewfile shouldn't.

There is a "warning" telling you not to use them. They are likely to be deprecated and removed in future.

Or at least have a way to specify a version of a package in the Brewfile.

This is not how Homebrew works. It's a rolling-release package manager. Read https://docs.brew.sh/Versions

@MikeMcQuaid
Copy link
Member

Sorry, passing on this due to reasons above.

@lock lock bot added the outdated label May 20, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants