asdf-community / asdf-community/asdf-php

Install of PHP 7.2.34 fails on M1 Macbook

Open
#142 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
256
Forks
117
PR merge metrics
No merged PRs in 30d

Description

With all the right homebrew packages in place, this error ends up blocking an install.

```
> asdf install php 7.2.34

...

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /var/folders/kx/wsz1xqjj5cncxlwzwh1rh_4c0000gp/T/php-src-php-7.2.34/modules/opcache.a(shared_alloc_shm.o) has no symbols
/bin/sh /var/folders/kx/wsz1xqjj5cncxlwzwh1rh_4c0000gp/T/php-src-php-7.2.34/libtool --silent --preserve-dup-deps --mode=compile cc -I/usr/local/Cellar/icu4c/69.1/include -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Iext/intl/ -I/var/folders/kx/wsz1xqjj5cncxlwzwh1rh_4c0000gp/T/php-src-php-7.2.34/ext/intl/ -DPHP_ATOM_INC -I/var/folders/kx/wsz1xqjj5cncxlwzwh1rh_4c0000gp/T/php-src-php-7.2.34/include -I/var/folders/kx/wsz1xqjj5cncxlwzwh1rh_4c0000gp/T/php-src-php-7.2.34/main -I/var/folders/kx/wsz1xqjj5cncxlwzwh1rh_4c0000gp/T/php-src-php-7.2.34 -I/var/folders/kx/wsz1xqjj5cncxlwzwh1rh_4c0000gp/T/php-src-php-7.2.34/ext/date/lib -I/usr/local/Cellar/libxml2/2.9.12/include/libxml2 -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/zlib/include -I/usr/local/opt/webp/include -I/usr/local/opt/jpeg/include -I/usr/local/opt/libpng/include -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/opt/gettext/include -I/usr/local/opt/gmp/include -I/usr/local/opt/libiconv/include -I/usr/local/Cellar/icu4c/69.1/include -I/var/folders/kx/wsz1xqjj5cncxlwzwh1rh_4c0000gp/T/php-src-php-7.2.34/ext/mbstring/oniguruma -I/var/folders/kx/wsz1xqjj5cncxlwzwh1rh_4c0000gp/T/php-src-php-7.2.34/ext/mbstring/libmbfl -I/var/folders/kx/wsz1xqjj5cncxlwzwh1rh_4c0000gp/T/php-src-php-7.2.34/ext/mbstring/libmbfl/mbfl -I/usr/local/include -I/var/folders/kx/wsz1xqjj5cncxlwzwh1rh_4c0000gp/T/php-src-php-7.2.34/ext/sqlite3/libsqlite -I/usr/local/opt/libedit/include -I/usr/local/opt/libsodium/include -I/usr/local/opt/libzip/include -I/var/folders/kx/wsz1xqjj5cncxlwzwh1rh_4c0000gp/T/php-src-php-7.2.34/TSRM -I/var/folders/kx/wsz1xqjj5cncxlwzwh1rh_4c0000gp/T/php-src-php-7.2.34/Zend -no-cpp-precomp -I/usr/local/opt/libiconv/include -g -O2 -fvisibility=hidden -DZEND_SIGNALS -c /var/folders/kx/wsz1xqjj5cncxlwzwh1rh_4c0000gp/T/php-src-php-7.2.34/ext/intl/formatter/formatter_data.c -o ext/intl/formatter/formatter_data.lo
mkdir: ext/intl/formatter/.libs: File exists
/var/folders/kx/wsz1xqjj5cncxlwzwh1rh_4c0000gp/T/php-src-php-7.2.34/ext/intl/collator/collator_sort.c:349:26: error: use of undeclared identifier 'TRUE'
collator_sort_internal( TRUE, INTERNAL_FUNCTION_PARAM_PASSTHRU );
^
/var/folders/kx/wsz1xqjj5cncxlwzwh1rh_4c0000gp/T/php-src-php-7.2.34/ext/intl/collator/collator_sort.c:543:26: error: use of undeclared identifier 'FALSE'
collator_sort_internal( FALSE, INTERNAL_FUNCTION_PARAM_PASSTHRU );
^
2 errors generated.
make: *** [ext/intl/collator/collator_sort.lo] Error 1
make: *** Waiting for unfinished jobs....
```

I found reference to the same error here: https://github.com/henkrehorst/homebrew-php/issues/134

The fix includes passing a flag `-DU_DEFINE_FALSE_AND_TRUE=1`

I have tested and this does appear to fix. I'll submit a PR. Untested on any other systems / installs though, so please test before merging.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing `asdf install php 7.2.34` on an M1 Mac and inspect the failure in `ext/intl/collator/collator_sort.c`, where `TRUE` and `FALSE` are undeclared. Verify the reported `-DU_DEFINE_FALSE_AND_TRUE=1` configuration change and confirm the install succeeds without breaking other systems.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, shell
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.