asdf-community/asdf-php

The workflow for asdf-php seems broken.

cocoonkid opened this issue · 12 comments

I tried the install on a fresh MacOs Catalina today.
Failed at compiling with Bison:

configure: error: bison 3.0.0 or later is required to generate PHP parsers (excluded versions: none).

It's still using the system bison.

All homebrew dependencies are satisfied. I tried exporting respective PATH's but it still doesn't find the correct PKS.

The asdf-php workflow.yml DID NOT install the dependencies which might mean that the error already appears earlier..

$ asdf install php latest
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   125  100   125    0     0    357      0 --:--:-- --:--:-- --:--:--   357
100 13.8M    0 13.8M    0     0  3708k      0 --:--:--  0:00:03 --:--:-- 5073k
buildconf: Checking installation
buildconf: autoconf version 2.69 (ok)
buildconf: Forcing buildconf. The configure files will be regenerated.
buildconf: Cleaning cache and configure files
buildconf: Rebuilding configure
buildconf: Rebuilding main/php_config.h.in
buildconf: Run ./configure to proceed with customizing the PHP build.
configure: WARNING: unrecognized options: --with-freetype-dir, --with-icu-dir, --with-jpeg-dir, --with-png-dir, --with-libxml-dir, --with-libzip, --enable-gd-native-ttf, --enable-wddx, --enable-zip, --with-gd, --with-mysql
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking build system type... x86_64-apple-darwin19.4.0
checking host system type... x86_64-apple-darwin19.4.0
checking target system type... x86_64-apple-darwin19.4.0
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking how to run the C preprocessor... cc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether ln -s works... yes
checking for system library directory... lib
checking whether to enable runpaths... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking for bison... bison
checking for bison version... 2.3
configure: error: bison 3.0.0 or later is required to generate PHP parsers (excluded versions: none).

First of all, please provide your environmental information...

Thank you for your swift reply.


SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.tCmay9febK/Listeners
LC_TERMINAL_VERSION=3.3.9
COLORFGBG=7;0
ITERM_PROFILE=Default
XPC_FLAGS=0x0
PWD=/Users/cocoonkid
SHELL=/bin/zsh

LC_CTYPE=UTF-8
TERM_PROGRAM_VERSION=3.3.9
TERM_PROGRAM=iTerm.app
PATH=/Users/cocoonkid/.asdf/shims:/usr/local/opt/asdf/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/MacGPG2/bin:/Applications/Wireshark.app/Contents/MacOS

HOME=/Users/cocoonkid
ASDF_DIR=/usr/local/opt/asdf
STARSHIP_SHELL=zsh
HOMEBREW_NO_ANALYTICS=1
_=/usr/bin/printenv

Did you try this before installing?

export PKG_CONFIG_PATH="$(brew --prefix icu4c)/lib/pkgconfig:$(brew --prefix krb5)/lib/pkgconfig:$(brew --prefix libedit)/lib/pkgconfig:$(brew --prefix libxml2)/lib/pkgconfig:$(brew --prefix openssl)/lib/pkgconfig"

export PATH="$(brew --prefix bison)/bin:$PATH"

If you still have problems, please open this again.

Hi @imbsky,

Something might be broken for asdf-php on macOS Catalina.

I didn't had any problems with asdf until PHP. Installation processes for the below was very smooth:

> asdf list
dotnet-core
  3.1.300
nodejs
  14.2.0
ruby
  2.6.5
  2.6.6

These are nearly all of the commands I had to run until I gave up and just used Homebrew:

asdf plugin add php
asdf install php latest
brew install autoconf automake bison ccache freetype gettext icu4c krb5 libedit libiconv libjpeg libpng libxml2 libzip pkg-config re2c zlib
asdf install php latest
export PKG_CONFIG_PATH="$(brew --prefix icu4c)/lib/pkgconfig:$(brew --prefix krb5)/lib/pkgconfig:$(brew --prefix libedit)/lib/pkgconfig:$(brew --prefix libxml2)/lib/pkgconfig:$(brew --prefix openssl)/lib/pkgconfig"
export PATH="$(brew --prefix bison)/bin:$PATH"
asdf install php latest # requires oniguruma
brew install oniguruma
asdf install php latest # requires libpq-fe
brew search libpq-fe # failed
brew search libpq # yep.
brew install libpq
asdf install php latest # failed & gave up

Have you installed all the dependencies listed here?

run: brew install autoconf automake bison freetype gettext icu4c krb5 libedit libiconv libjpeg libpng libxml2 libzip pkg-config re2c zlib

Yes. They are the third line on the command block I have shared above.

Well, I don't have a brand-new MacBook at this point so I can't check it out, but it's probably not too difficult. It may also be useful to check the dependencies listed here.
https://github.com/Homebrew/homebrew-core/blob/master/Formula/php.rb

I’m busy with some exams this month so I think it will be difficult to give you enough support, but next month I will give you as much support as I can.

Thank you 🚀

export PKG_CONFIG_PATH="$(brew --prefix icu4c)/lib/pkgconfig:$(brew --prefix krb5)/lib/pkgconfig:$(brew --prefix libedit)/lib/pkgconfig:$(brew --prefix libxml2)/lib/pkgconfig:$(brew --prefix openssl)/lib/pkgconfig"

export PATH="$(brew --prefix bison)/bin:$PATH"

In addition, I had to `brew install postgresql`

I could run `asdf install php latest` without any issues now.

All the best for your exams!

noticed a small remaining issue.

❯ asdf global php 7.4.8RC1

❯ php --version
PHP 7.3.11 (cli) (built: Apr 17 2020 19:14:14) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies

❯ which php
/usr/bin/php

❯ asdf reshim php

❯ which php
/usr/bin/php

❯ php --version
PHP 7.3.11 (cli) (built: Apr 17 2020 19:14:14) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies

It doesn't seem to respond to the global directive?

I’m currently in an area with a unstable internet connectivity so I can't check it until next month, but it’s too weird and I think you have something wrong.