Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg fails with dylib error #153177

Closed
4 tasks done
llimllib opened this issue Nov 2, 2023 · 8 comments
Closed
4 tasks done

ffmpeg fails with dylib error #153177

llimllib opened this issue Nov 2, 2023 · 8 comments
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age

Comments

@llimllib
Copy link
Contributor

llimllib commented Nov 2, 2023

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

https://gist.github.com/llimllib/2cd4aab015fd4d31fff5adce1587ae6e

Verification

  • My "brew doctor output" says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.

What were you trying to do (and why)?

run ffmpeg

What happened (include all command output)?

I tried to run ffmpeg:

$ ffmpeg --version
dyld[29385]: Library not loaded: /opt/homebrew/opt/mbedtls/lib/libmbedcrypto.14.dylib
  Referenced from: <8C2E2CF9-054E-300F-BDE7-3DE52F848638> /opt/homebrew/Cellar/librist/0.2.7_3/lib/librist.4.dylib
  Reason: tried: '/opt/homebrew/opt/mbedtls/lib/libmbedcrypto.14.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/mbedtls/lib/libmbedcrypto.14.dylib' (no such file), '/opt/homebrew/opt/mbedtls/lib/libmbedcrypto.14.dylib' (no such file), '/usr/local/lib/libmbedcrypto.14.dylib' (no such file), '/usr/lib/libmbedcrypto.14.dylib' (no such file, not in dyld cache), '/opt/homebrew/Cellar/mbedtls/3.5.0/lib/libmbedcrypto.14.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/mbedtls/3.5.0/lib/libmbedcrypto.14.dylib' (no such file), '/opt/homebrew/Cellar/mbedtls/3.5.0/lib/libmbedcrypto.14.dylib' (no such file), '/usr/local/lib/libmbedcrypto.14.dylib' (no such file), '/usr/lib/libmbedcrypto.14.dylib' (no such file, not in dyld cache)
zsh: abort      ffmpeg --version

I search for libmbedcrypto.14.dylib and it's no longer available - I guess homebrew cleaned it up? I'm a frequent user of ffmpeg and it definitely worked recently, so this couldn't have happened long ago.

$ fd -u libmbedcrypto.14.dylib /opt/homebrew

$ fd -u libmbedcrypto.15.dylib /opt/homebrew
/opt/homebrew/Cellar/mbedtls/3.5.0/lib/libmbedcrypto.15.dylib
/opt/homebrew/lib/libmbedcrypto.15.dylib

OK, looks like there's an updated version of libmbedcrypto, so the first issue is: homebrew shouldn't have removed the version that ffmpeg was depending on.

Nevertheless, let's try to reinstall ffmpeg. No joy:

$ brew reinstall ffmpeg
==> Downloading https://ghcr.io/v2/homebrew/core/ffmpeg/manifests/6.0_1-2
################################################################################################################################################################################################################ 100.0%
==> Fetching ffmpeg
==> Downloading https://ghcr.io/v2/homebrew/core/ffmpeg/blobs/sha256:42d52253402650e0213379f160c55d84b65dd00f6399f164df05f114c74ebcc4
################################################################################################################################################################################################################ 100.0%
==> Reinstalling ffmpeg 
==> Pouring ffmpeg--6.0_1.arm64_sonoma.bottle.2.tar.gz
🍺  /opt/homebrew/Cellar/ffmpeg/6.0_1: 284 files, 48.7MB
==> Running `brew cleanup ffmpeg`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

$ ffmpeg --help        
dyld[34884]: Library not loaded: /opt/homebrew/opt/mbedtls/lib/libmbedcrypto.14.dylib
  Referenced from: <8C2E2CF9-054E-300F-BDE7-3DE52F848638> /opt/homebrew/Cellar/librist/0.2.7_3/lib/librist.4.dylib
  Reason: tried: '/opt/homebrew/opt/mbedtls/lib/libmbedcrypto.14.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/mbedtls/lib/libmbedcrypto.14.dylib' (no such file), '/opt/homebrew/opt/mbedtls/lib/libmbedcrypto.14.dylib' (no such file), '/usr/local/lib/libmbedcrypto.14.dylib' (no such file), '/usr/lib/libmbedcrypto.14.dylib' (no such file, not in dyld cache), '/opt/homebrew/Cellar/mbedtls/3.5.0/lib/libmbedcrypto.14.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/mbedtls/3.5.0/lib/libmbedcrypto.14.dylib' (no such file), '/opt/homebrew/Cellar/mbedtls/3.5.0/lib/libmbedcrypto.14.dylib' (no such file), '/usr/local/lib/libmbedcrypto.14.dylib' (no such file), '/usr/lib/libmbedcrypto.14.dylib' (no such file, not in dyld cache)
zsh: abort      ffmpeg --help

It's still trying to dynamically link libmbedcrypto.14.dylib, so there's nothing I can think of to do.

So that's the second issue: the current bottle of ffmpeg appears to depend on a dynamic library that's not available in homebrew?

What did you expect to happen?

ffmpeg worked

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

1. `brew install ffmpeg`
2. `ffmpeg --help`
@llimllib llimllib added the bug Reproducible Homebrew/homebrew-core bug label Nov 2, 2023
@llimllib
Copy link
Contributor Author

llimllib commented Nov 2, 2023

Update: brew reinstall librist fixed the problem!

However, I think there's still a bug here as homebrew should not have gotten itself into this situation?

@llimllib
Copy link
Contributor Author

llimllib commented Nov 2, 2023

Is the issue maybe with brew cleanup being to liberal in removing packages? Like in this instance it should not have felt itself clear to remove mbedtls 3.4.1 (which provides libmbedcrypto.14.dylib) because librist was clearly depending on it, but it did it anyway?

@SMillerDev
Copy link
Member

@Homebrew/brew any ideas?

@cho-m
Copy link
Member

cho-m commented Nov 2, 2023

Probably related to Homebrew/brew#16152

@Bo98
Copy link
Member

Bo98 commented Nov 2, 2023

Yes it is, sorry for the disruption - I recognise this is very widespread at the moment. I'm still trying to think up a solution.

@llimllib
Copy link
Contributor Author

llimllib commented Nov 3, 2023

Appreciate the clarity! I see you already know how disruptive this feels for users, this is the first time homebrew has felt broken for me and I've been using it for a long time.

Good luck fixing it, looking forward to the fix.

@cho-m
Copy link
Member

cho-m commented Nov 13, 2023

Homebrew/brew#16152 is merged and in brew release. Any broken installs will need manual intervention but future upgrades/installs should be okay.

Going to close this. Let us know if issue is hit in future install/upgrade.

@cho-m cho-m closed this as completed Nov 13, 2023
@llimllib
Copy link
Contributor Author

Thank you very much @cho-m! Appreciate your work

@github-actions github-actions bot added the outdated PR was locked due to age label Dec 13, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age
Projects
None yet
Development

No branches or pull requests

4 participants