Homebrew / homebrew-core

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

jpeg-xl 0.8.0 broke php #122389

Closed the-csaba closed 1 year ago

the-csaba commented 1 year ago

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

❯ brew config
HOMEBREW_VERSION: 3.6.20-261-gb3a71ba
ORIGIN: https://github.com/Homebrew/brew
HEAD: b3a71ba7cdb7e005c26c86bcc627f0549dfe19d0
Last commit: 9 hours ago
Core tap origin: https://github.com/Homebrew/homebrew-core
Core tap HEAD: f9ecf308945d7ec25a17c1c3ca3c8a4eb8a9890c
Core tap last commit: 3 days ago
Core tap branch: master
Core tap JSON: 06 Feb 02:40 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_BOOTSNAP: set
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: nano
HOMEBREW_MAKE_JOBS: 10
HOMEBREW_NO_ANALYTICS: set
Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 14.0.0 build 1400
Git: 2.39.1 => /opt/homebrew/bin/git
Curl: 7.86.0 => /usr/bin/curl
macOS: 13.2-arm64
CLT: 14.2.0.0.1.1668646533
Xcode: N/A
Rosetta 2: false

❯ 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: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  php@8.0
  php@7.2
  php@7.3
  php@7.4

Verification

What were you trying to do (and why)?

run php script

What happened (include all command output)?

❯ php -v
dyld[89420]: Library not loaded: /opt/homebrew/opt/jpeg-xl/lib/libjxl.0.7.dylib
  Referenced from: <A72D24E1-5548-35C3-9838-2ED81CBCD000> /opt/homebrew/Cellar/aom/3.5.0_1/lib/libaom.3.5.0.dylib
  Reason: tried: '/opt/homebrew/opt/jpeg-xl/lib/libjxl.0.7.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/jpeg-xl/lib/libjxl.0.7.dylib' (no such file), '/opt/homebrew/opt/jpeg-xl/lib/libjxl.0.7.dylib' (no such file), '/usr/local/lib/libjxl.0.7.dylib' (no such file), '/usr/lib/libjxl.0.7.dylib' (no such file, not in dyld cache), '/opt/homebrew/Cellar/jpeg-xl/0.8.1/lib/libjxl.0.7.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/jpeg-xl/0.8.1/lib/libjxl.0.7.dylib' (no such file), '/opt/homebrew/Cellar/jpeg-xl/0.8.1/lib/libjxl.0.7.dylib' (no such file), '/usr/local/lib/libjxl.0.7.dylib' (no such file), '/usr/lib/libjxl.0.7.dylib' (no such file, not in dyld cache)
[1]    89420 abort      php -v

What did you expect to happen?

run php without error

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

- make sure you are have php and jpeg-xl 0.7.0 installed 
- run `brew update && brew upgrade`, which updates jpeg-xl f to 0.8.0.
- try to run php -v. (see errors abowe) 

Note: `brew reinstall --build-from-source php` does not solve the problem.

It hard to recount all the steps, but looks like checkout the homebrew core before jpeg-xl 0.8.0 and `HOMEBREW_NO_AUTO_UPDATE=1 brew install jpeg-xl` soleved the problme for me, even I ended up having 0.8.1 from jpeg-xl:

❯ brew info jpeg-xl
==> jpeg-xl: stable 0.8.1 (bottled)
New file format for still image compression
https://jpeg.org/jpegxl/index.html
/opt/homebrew/Cellar/jpeg-xl/0.8.1 (41 files, 10.7MB) *
  Poured from bottle using the formulae.brew.sh API on 2023-02-06 at 11:57:54
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/jpeg-xl.rb
License: BSD-3-Clause
==> Dependencies
Build: cmake ✘, doxygen ✘, pkg-config βœ”, sphinx-doc ✘
Required: brotli βœ”, giflib βœ”, highway βœ”, imath βœ”, jpeg-turbo βœ”, libpng βœ”, little-cms2 βœ”, openexr βœ”, webp βœ”
carlocab commented 1 year ago

What's the output of

which -a php
brew info php

?

gromgit commented 1 year ago

Also, what's the output of

brew info aom

? aom was revision-bumped on Jan 25 due to jpeg-xl's version bump, so brew upgrade should've upgraded that too.

carlocab commented 1 year ago

Just ran php -v from a fresh brew install php in GitHub Actions, and it works fine. php also does not show any linkage to aom or jpeg-xl.

Your php is likely one (or more) of:

None of the above is supported. If it's outdated but installed from homebrew-core, please do brew update && brew upgrade php. We can reopen this if that doesn't fix it. If you installed it from a third-party tap, please report this to that tap instead.

the-csaba commented 1 year ago

@carlocab , @gromgit :

❯ which -a php
/opt/homebrew/bin/php
❯ brew info php
==> php: stable 8.2.2 (bottled), HEAD
General-purpose scripting language
https://www.php.net/
/opt/homebrew/Cellar/php/8.2.2 (519 files, 83.3MB) *
  Poured from bottle using the formulae.brew.sh API on 2023-02-06 at 10:01:47
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/php.rb
License: PHP-3.01
==> Dependencies
Build: httpd βœ”, pkg-config βœ”
Required: apr βœ”, apr-util βœ”, argon2 βœ”, aspell βœ”, autoconf βœ”, curl βœ”, freetds βœ”, gd βœ”, gettext βœ”, gmp βœ”, icu4c βœ”, krb5 βœ”, libpq βœ”, libsodium βœ”, libzip βœ”, oniguruma βœ”, openldap βœ”, openssl@1.1 βœ”, pcre2 βœ”, sqlite βœ”, tidy-html5 βœ”, unixodbc βœ”
==> Options
--HEAD
    Install HEAD version
==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
    LoadModule php_module $(brew --prefix)/opt/php/lib/httpd/modules/libphp.so

    <FilesMatch \.php$>
        SetHandler application/x-httpd-php
    </FilesMatch>

Finally, check DirectoryIndex includes index.php
    DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:
    $(brew --prefix)/etc/php/8.2/

To start php now and restart at login:
  brew services start php
❯ brew info aom
==> aom: stable 3.5.0 (bottled)
Codec library for encoding and decoding AV1 video streams
https://aomedia.googlesource.com/aom
/opt/homebrew/Cellar/aom/3.5.0_2 (23 files, 8.5MB) *
  Poured from bottle using the formulae.brew.sh API on 2023-02-06 at 12:00:05
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/aom.rb
License: BSD-2-Clause
==> Dependencies
Build: cmake ✘, pkg-config βœ”
Required: jpeg-xl βœ”, libvmaf βœ”

php also does not show any linkage to aom or jpeg-xl.

No, it doesn't state linkage, but a similar problem happened in the past: https://web.archive.org/web/20190629045728/https://github.com/Homebrew/homebrew-php/issues/4358

Let me tell you, the php package was not built from source, was not outdated, and not installed from a third party. Yesterday I spent three hours figuring out the problem and reporting it here. Closing an issue without understanding or investigating is a frustrating experience that genuinely discourages people from participating.

gromgit commented 1 year ago

❯ brew info aom ==> aom: stable 3.5.0 (bottled) Codec library for encoding and decoding AV1 video streams https://aomedia.googlesource.com/aom /opt/homebrew/Cellar/aom/3.5.0_2 (23 files, 8.5MB) * Poured from bottle using the formulae.brew.sh API on 2023-02-06 at 12:00:05

You're now running a different version of aom than when you first reported your issue. Is php -v still throwing errors?

the-csaba commented 1 year ago

I can't remember, but I probably have the same version. I have DevOps responsibilities, so I run brew update && brew upgrade every workday. And it was updated two weeks ago according to the aom.rb file history.

However, at some point, I reinstalled the aom (brew reinstall aom --force) because I had some error when I tried to install jpeg-xl.

gromgit commented 1 year ago

I can't remember, but I probably have the same version.

To be clear, your original report said:

  Referenced from: <A72D24E1-5548-35C3-9838-2ED81CBCD000> /opt/homebrew/Cellar/aom/3.5.0_1/lib/libaom.3.5.0.dylib

That's aom 3.5.0 revision 1. From 2 hours ago:

/opt/homebrew/Cellar/aom/3.5.0_2 (23 files, 8.5MB) *

That's aom 3.5.0 revision 2, which no longer references libjxl 1.0.7:

$ brew linkage aom
System libraries:
  /usr/lib/libSystem.B.dylib
  /usr/lib/libc++.1.dylib
Homebrew libraries:
  /opt/homebrew/opt/highway/lib/libhwy.1.dylib (highway)
  /opt/homebrew/opt/jpeg-xl/lib/libjxl.0.8.dylib (jpeg-xl)
  /opt/homebrew/opt/libvmaf/lib/libvmaf.1.dylib (libvmaf)
Indirect dependencies with linkage:
  highway
Variable-referenced libraries:
  @rpath/libaom.3.dylib

Running php -v should confirm whether that upgrade fixed your issue.

the-csaba commented 1 year ago

Thank you for pointing that out. Now it makes sense how the error happened in the first place. So, let me reconstructure what happened:

These two things caused aom to panic because it expected a different version of jpeg-xl, which ultimately made php fail.

I now have aom 3.5.0_2, jpeg-xl 0.8.1 and php 8.2.2 working well as intended. All poured from bottle.

I appreciate the help

cho-m commented 1 year ago

I wonder if this could be a JSON API issue. Would need data at time of issue to know for sure.

If it was an API issue, then shouldn't be seen in near term as default usage of API was reverted.