Brew: Error after updating to brew version 2.2.8

Created on 4 Mar 2020  路  20Comments  路  Source: Homebrew/brew

  • [x] ran brew update and can still reproduce the problem?
  • [x] ran brew doctor, fixed all issues and can still reproduce the problem?
  • [x] 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
outdated python

All 20 comments

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

/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/[email protected]
/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/[email protected]
/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:

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.

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!!

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.

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.

depends_on "python@3"

That's unusual. It should be depends_on "python" or depends_on "[email protected]"

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.

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.

@Bo98 Good catch, could you submit a PR?

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

7116.

@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.

@benjohnde There is a new release now.

That's super awesome! Thanks a million for the quick help 鉂わ笍!

Thanks all for the fixes ! :)

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

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".

Thanks @Bo98 , that fixed our issue :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vitahlin picture vitahlin  路  4Comments

fxcoudert picture fxcoudert  路  3Comments

zelsonia picture zelsonia  路  4Comments

jokeyrhyme picture jokeyrhyme  路  3Comments

hktalent picture hktalent  路  4Comments