0

I've php70-xdebug package and I did the following steps:

  1. Edited formula by brew edit php70-xdebug
  2. Then replaced the following line:

    url "https://pecl.php.net/get/xdebug-2.5.5.tgz"
    

    with:

    url "https://github.com/xdebug/xdebug/archive/master.zip"
    
  3. Run reinstall by: brew reinstall php70-xdebug --build-from-source

However it fails with:

Error: invalid attribute for formula 'homebrew/php/php70-xdebug': version (nil)
/usr/local/Homebrew/Library/Homebrew/formula.rb:252:in `validate_attributes!'
/usr/local/Homebrew/Library/Homebrew/formula.rb:199:in `initialize'
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-php/Abstract/abstract-php-extension.rb:20:in `initialize'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:88:in `new'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:88:in `get_formula'

I've seen that there is a reference to build.head in the following line:

Dir.chdir "xdebug-#{version}" unless build.head?

which suggest it's possible to build with HEAD, but I'm not sure how.

What would be a proper way of reinstalling php70-xdebug from the source using the latest HEAD?

0

1 Answer 1

1

The proper way of installing the package from the HEAD, is to add --HEAD parameter, e.g.

brew reinstall php70-xdebug --build-from-source --HEAD

If --HEAD or --devel is passed, fetch that version instead of the stable version.

See: man brew.


Error: invalid attribute for formula 'homebrew/...': version (nil)

indicates the missing version which should be added like:

version "2.6.0-dev"

right after url line (see example here).

2
  • github.com/Homebrew/homebrew-php/blob/master/Formula/… does not specify a version … is that even valid?
    – slhck
    Aug 1, 2017 at 20:26
  • @slhck I believe version is automatically fetched based on the provided url, when I changed the url without having version in it, Homebrew started to complain about the missing version.
    – kenorb
    Aug 1, 2017 at 20:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .