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

brew extract produces unusable target names from already-versioned names #7057

Closed
3 tasks done
gromgit opened this issue Feb 20, 2020 · 1 comment
Closed
3 tasks done
Labels
bug Reproducible Homebrew/brew bug help wanted We want help addressing this outdated PR was locked due to age

Comments

@gromgit
Copy link
Member

gromgit commented Feb 20, 2020

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

  • ran brew update and can still reproduce the problem?
  • ran brew doctor, fixed all issues and can still reproduce the problem?
  • ran brew config and brew doctor and included their output with your issue?

What you were trying to do (and why)

Extract the defunct python@2 formula into a new tap, as a test for my answer to a related question on Discourse.

What happened (include command output)

I created a new tap, then extracted the python@2 formula to it.

$ brew tap-new gromgit/python2
==> Created gromgit/python2
/usr/local/Homebrew/Library/Taps/gromgit/homebrew-python2

$ brew extract python@2 gromgit/python2
==> Searching repository history
==> Writing formula for python@2 from revision 86a44a0 to /usr/local/Homebrew/Library/Taps/gromgit/homebrew-python2/Formula/python@2@2.7.17.rb

Now, python@2@2.7.17 is a rather bizarre formula name, and it turns out even Homebrew itself chokes on it.

$ brew search python@2
==> Formulae
gromgit/python2/python@2@2.7.17

$ brew info gromgit/python2/python@2
Error: No available formula with the name "gromgit/python2/python@2" 
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.

What's worse, the actual formula generated seems to be invalid.

$ brew info gromgit/python2/python@2@2.7.17
Error: gromgit/python2/python@2@2.7.17: /usr/local/Homebrew/Library/Taps/gromgit/homebrew-python2/Formula/python@2@2.7.17.rb:1: `@2' is not allowed as an instance variable name
/usr/local/Homebrew/Library/Taps/gromgit/homebrew-python2/Formula/python@2@2.7.17.rb:1: syntax error, unexpected end-of-input
class PythonAT2@2717 < Formula
               ^

What you expected to happen

I expected brew extract to create a valid formula file that's usable as either gromgit/python2/python@2 or gromgit/python2/python@2.7.17.

Step-by-step reproduction instructions (by running brew commands)

See What happened section above.

Output of brew config and brew doctor commands

$ brew config
HOMEBREW_VERSION: 2.2.6-18-g5b126ec
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 5b126ec850b688cba57a9cf17be08d321ad4d10f
Last commit: 23 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 0492536b0c6b60a57463a7d82380e8dc156d09f2
Core tap last commit: 15 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_DEV_CMD_RUN: 1
HOMEBREW_NO_ANALYTICS_THIS_RUN: 1
HOMEBREW_NO_AUTO_UPDATE: yes
CPU: quad-core 64-bit haswell
Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/bin/ruby
Clang: 11.0 build 1100
Git: 2.25.0 => /usr/local/bin/git
Curl: 7.54.0 => /usr/bin/curl
macOS: 10.14.6-x86_64
CLT: 11.3.1.0.1.1576735732
Xcode: 11.3.1
XQuartz: 2.7.11 => /opt/X11

$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Putting non-prefixed coreutils in your path can cause gmp builds to fail.

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
  /usr/local/include/libpgtcl.h

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  fuse4x
  moreutils
  scheme48
  cvs

@MikeMcQuaid MikeMcQuaid added bug Reproducible Homebrew/brew bug help wanted We want help addressing this labels Feb 20, 2020
@MikeMcQuaid
Copy link
Member

Fixed by #7066, thanks @alebcay!

@lock lock bot added the outdated PR was locked due to age label Mar 27, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/brew bug help wanted We want help addressing this outdated PR was locked due to age
Projects
None yet
Development

No branches or pull requests

2 participants