Homebrew / homebrew-core

🍻 Default formulae for the missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
13.62k stars 12.35k forks source link

Probable typo in "php" bottle configuration #150214

Closed srigi closed 10 months ago

srigi commented 11 months ago

brew gist-logs <formula> link OR brew config AND brew doctor output

# brew config
HOMEBREW_VERSION: 4.1.14
ORIGIN: https://github.com/Homebrew/brew
HEAD: affc4c01aada2c973b63e084e7696e896edf2b7b
Last commit: 7 days ago
Core tap JSON: 08 Oct 20:42 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_BROWSER: open
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: vim
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_blizzard_avalanche
Clang: 15.0.0 build 1500
Git: 2.42.0 => /opt/homebrew/bin/git
Curl: 8.1.2 => /usr/bin/curl
macOS: 13.6-arm64
CLT: 15.0.0.0.1.1694021235
Xcode: 15.0
Rosetta 2: false

# brew doctor
Your system is ready to brew.

Verification

What were you trying to do (and why)?

PHP info page (<?php phpinfo();) returns invalid iconv support:

Screenshot 2023-10-08 at 22 57 43

What happened (include all command output)?

I believe there is a typo on this line: https://github.com/Homebrew/homebrew-core/blob/e0e87ed974ed800f73dfe7ebcc49af030b088a16/Formula/p/php.rb#L160

The configuration directive should contains the = char as described here.

What did you expect to happen?

Iconv support should be reported without unknown values for iconv implementation and iconv library version directives.

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

brew install php
php -i | grep iconv
Bo98 commented 11 months ago

headers_path has the =: https://github.com/Homebrew/homebrew-core/blob/e0e87ed974ed800f73dfe7ebcc49af030b088a16/Formula/p/php.rb#L117 A little confusing to read I realise.

If this was macOS 14, it would make sense since Apple changed the iconv implementation from GNU iconv to Citrus iconv (from FreeBSD) and it's possible PHP doesn't support detecting this yet.

But it seems you're runnning macOS 13, so we will need to investigate build logs. The issue seems however largely cosmetic.

cho-m commented 11 months ago

Sounds related to upstream issue https://github.com/php/php-src/issues/10751 which has fix in HEAD.

Snippet of previous php PR run:

configure:44346: checking if using GNU libiconv
configure:44365: clang -o conftest  -I/private/tmp/php-20230928-8112-fa75td/php-8.2.11/ext/date/lib -I/opt/homebrew/Cellar/openssl@3/3.1.3/include -I/opt/homebrew/Cellar/pcre2/10.42/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/Cellar/curl/8.3.0/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/ffi -I/opt/homebrew/Cellar/gd/2.3.3_6/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/gmp/include -g -O2 -fvisibility=hidden  -D_GNU_SOURCE   -Wl,-rpath,/opt/homebrew/Cellar/krb5/1.21.2/lib -L/opt/homebrew/Cellar/krb5/1.21.2/lib -Wl,-rpath,/opt/homebrew/Cellar/openssl@3/3.1.3/lib -L/opt/homebrew/Cellar/openssl@3/3.1.3/lib -Wl,-rpath,/opt/homebrew/Cellar/pcre2/10.42/lib -L/opt/homebrew/Cellar/pcre2/10.42/lib -Wl,-rpath,/opt/homebrew/opt/sqlite/lib -L/opt/homebrew/opt/sqlite/lib -Wl,-rpath,/opt/homebrew/Cellar/curl/8.3.0/lib -L/opt/homebrew/Cellar/curl/8.3.0/lib -Wl,-rpath,/opt/homebrew/Cellar/gd/2.3.3_6/lib -L/opt/homebrew/Cellar/gd/2.3.3_6/lib -Wl,-rpath,/opt/homebrew/opt/gettext/lib -L/opt/homebrew/opt/gettext/lib -Wl,-rpath,/opt/homebrew/opt/gmp/lib -L/opt/homebrew/opt/gmp/lib conftest.c -liconv -lgmp -lintl -lbz2 -lnetwork -lm  -lxml2 -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lpcre2-8 -lsqlite3 -lz -lcurl -lxml2 -lffi -lssl -lcrypto -lgd >&5
conftest.c:280:3: error: call to undeclared library function 'printf' with type 'int (const char *, ...)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  printf("%d", _libiconv_version);
  ^
conftest.c:280:3: note: include the header <stdio.h> or explicitly provide a declaration for 'printf'
1 error generated.
Bo98 commented 11 months ago

Yep, that'll be it.

github-actions[bot] commented 11 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.