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

Error after updating to brew version 2.2.8 #7115

Closed
3 tasks done
tokawpl opened this issue Mar 4, 2020 · 20 comments · Fixed by #7116
Closed
3 tasks done

Error after updating to brew version 2.2.8 #7115

tokawpl opened this issue Mar 4, 2020 · 20 comments · Fixed by #7116
Labels
outdated PR was locked due to age python Homebrew/brew's python support

Comments

@tokawpl
Copy link

tokawpl commented Mar 4, 2020

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

Installing carthage-copy-frameworks via brew.
Why? Avoiding error prone iOS framework adding .

What happened (include command output)

Installation failed with a Ruby error.

Command output
  Error: An exception occurred within a child process:
  NoMethodError: undefined method `delete' for nil:NilClass
  

What you expected to happen

Successful installation.

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

brew install lvillani/tap/carthage-copy-frameworks

Output of brew config and brew doctor commands

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: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
  /Users//.pyenv/shims/python-config
  /Users//.pyenv/shims/python3-config
  /Users//.pyenv/shims/python3.8-config

brew config

HOMEBREW_VERSION: 2.2.8
ORIGIN: https://github.com/Homebrew/brew
HEAD: 89fd3cc234c5f47bb807eb97613eb614184d51c3
Last commit: 57 minutes ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 999e8d8129268ccafa9f4e4e785724044be6eb2e
Core tap last commit: 5 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_AWS_ACCESS_KEY_ID: set
HOMEBREW_AWS_SECRET_ACCESS_KEY: set
CPU: octa-core 64-bit kabylake
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.64.1 => /usr/bin/curl
Java: 12.0.2, 11.0.5, 1.8.0_232
macOS: 10.15.3-x86_64
CLT: N/A
Xcode: 11.3.1
@MikeMcQuaid
Copy link
Member

Please run brew install --debug ... and paste the output.

@tokawpl
Copy link
Author

tokawpl commented Mar 4, 2020

/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/lvillani/homebrew-tap/Formula/carthage-copy-frameworks.rb
==> Installing carthage-copy-frameworks from lvillani/tap
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::AliasLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/python.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/pkg-config.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gdbm.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/openssl@1.1.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/readline.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/sqlite.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/xz.rb
/usr/local/Homebrew/Library/Homebrew/build.rb (Formulary::FromPathLoader): loading /usr/local/Homebrew/Library/Taps/lvillani/homebrew-tap/Formula/carthage-copy-frameworks.rb
/usr/local/Homebrew/Library/Homebrew/build.rb (Formulary::AliasLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/python.rb
/usr/local/Homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gdbm.rb
/usr/local/Homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/openssl@1.1.rb
/usr/local/Homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/readline.rb
/usr/local/Homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/sqlite.rb
/usr/local/Homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/xz.rb
/usr/local/Homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/pkg-config.rb
==> Downloading https://github.com/lvillani/carthage-copy-frameworks/archive/v2.0.0.tar.gz
/usr/bin/curl -q --globoff --show-error --user-agent Homebrew/2.2.8\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 10.15.3\)\ curl/7.64.1 --location --silent --head --request GET https://github.com/lvillani/carthage-copy-frameworks/archive/v2.0.0.tar.gz
Already downloaded: /Users/tka/Library/Caches/Homebrew/downloads/882ec6d16c8039878574289d942d75a8476d63d117aa79a10dee7c756b26795b--carthage-copy-frameworks-2.0.0.tar.gz
tar xof /Users/tka/Library/Caches/Homebrew/downloads/882ec6d16c8039878574289d942d75a8476d63d117aa79a10dee7c756b26795b--carthage-copy-frameworks-2.0.0.tar.gz -C /private/tmp/d20200304-30341-115o0ha
cp -pR /private/tmp/d20200304-30341-115o0ha/carthage-copy-frameworks-2.0.0/. /private/tmp/carthage-copy-frameworks-20200304-30341-1vlvys/carthage-copy-frameworks-2.0.0
/usr/local/Homebrew/Library/Homebrew/language/python.rb:177:in `virtualenv_install_with_resources'
NoMethodError: undefined method `delete' for nil:NilClass
1. raise
2. backtrace
3. shell
Choose an action:

@MikeMcQuaid MikeMcQuaid added the python Homebrew/brew's python support label Mar 4, 2020
@MikeMcQuaid
Copy link
Member

CC @iMichka that https://github.com/lvillani/homebrew-tap/blob/master/Formula/carthage-copy-frameworks.rb is no longer a valid formula after the Python changes.

@benjohnde
Copy link

Ah that's good news, so we could fork that one over there and could modify it according to your changes. Could you give us a hint what should be changed? I highly believe it has something to do with the virtualenv usage. Still, we couldn't find any information at all that there were breaking changes released, that's a bit sad :( Thanks a lot for your fast response!!

@MikeMcQuaid
Copy link
Member

Could you give us a hint what should be changed?

I'm not sure anything needs to be changed, I need @iMichka to verify why this is an error. It's likely a bug.

@iMichka
Copy link
Member

iMichka commented Mar 4, 2020

I can have a look in 3-4 hours when I am back. I am travelling right now, but I will be able to connect in the train back home.

@iMichka
Copy link
Member

iMichka commented Mar 4, 2020

@iMichka
Copy link
Member

iMichka commented Mar 4, 2020

depends_on "python@3"

That's unusual. It should be depends_on "python" or depends_on "python@3.8"

@benjohnde
Copy link

That's not relevant here, both version descriptions are valid. I just found out that for the case if you want to build from source or your formula does not contain a bottle brew is broke right now.

Can easily be tested with any python formula which uses virtualenv_install_with_resources, for instance brew install --build-from-source git-revise. We also got other ci processes which fail because of that.

@Bo98
Copy link
Member

Bo98 commented Mar 4, 2020

Here is the failing code: https://github.com/Homebrew/brew/blob/master/Library/Homebrew/language/python.rb#L168-L181

The removal of python = wanted.first || "python2.7" is problematic. Now wanted isn't used at all and python won't be set at all in that if block.

@MikeMcQuaid
Copy link
Member

@Bo98 Good catch, could you submit a PR?

Bo98 added a commit to Bo98/brew that referenced this issue Mar 4, 2020
@benjohnde
Copy link

Thanks for all the quick help! Nice catch @Bo98!

@Bo98
Copy link
Member

Bo98 commented Mar 4, 2020

#7116.

@benjohnde
Copy link

@MikeMcQuaid Is there any ETA für an upcoming release? As mentioned above, all Python builds are currently broken if there exists no bottle or building from sources.

@MikeMcQuaid
Copy link
Member

@benjohnde There is a new release now.

@benjohnde
Copy link

That's super awesome! Thanks a million for the quick help ❤️!

@iMichka
Copy link
Member

iMichka commented Mar 4, 2020

Thanks all for the fixes ! :)

@mitch-seymour
Copy link

We're seeing the same issue with one of our internal packages. We're also using virtualenv_install_with_resources but our package depends on python 2, not python 3. We're also using the latest brew version, which should have @Bo98 's fix.

$ brew --version
Homebrew 2.2.9-23-g78140ce

What's interesting is if we change depends_on "python@2" to depends_on "python@3", the package installs (but our python code isn't compatible with python 3, so this isn't really a fix).

Unfortunately, our package and formula aren't open source. But I was able to reproduce by copying the formula mentioned in this bug report to a personal tap, and changing the dependency to python@2.

You can therefore reproduce this ongoing bug using the following command:

$ brew install mitch-seymour/tap/carthage-copy-frameworks
==> Auto-updated Homebrew!
Updated 1 tap (mitch-seymour/tap).
No changes to formulae.

Updating Homebrew...
==> Installing carthage-copy-frameworks from mitch-seymour/tap
==> Downloading https://github.com/lvillani/carthage-copy-frameworks/archive/v2.0.0.tar.gz
Already downloaded: /Users/mseymour/Library/Caches/Homebrew/downloads/882ec6d16c8039878574289d942d75a8476d63d117aa79a10dee7c756b26795b--carthage-copy-frameworks-2.0.0.tar.gz
Error: An exception occurred within a child process:
  NoMethodError: undefined method `delete' for nil:NilClass

@Bo98
Copy link
Member

Bo98 commented Mar 6, 2020

That'll be because Homebrew no longer has any knowledge of what "python@2" is and thus does not recognise it as a Python formula.

You could use virtualenv_install_with_resources, :using => "python2".

@mitch-seymour
Copy link

Thanks @Bo98 , that fixed our issue :)

@lock lock bot added the outdated PR was locked due to age label Apr 15, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Apr 15, 2020
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 python Homebrew/brew's python support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants