-
-
Notifications
You must be signed in to change notification settings - Fork 20k
ffmpeg-headless: fix signing on darwin #513225
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| config, | ||
| stdenv, | ||
| buildPackages, | ||
| darwin, | ||
| removeReferencesTo, | ||
| addDriverRunpath, | ||
| pkg-config, | ||
|
|
@@ -836,6 +837,7 @@ stdenv.mkDerivation ( | |
| perl | ||
| pkg-config | ||
| ] | ||
| ++ optionals stdenv.hostPlatform.isDarwin [ darwin.sigtool ] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would IMO wanting to be aiming to use rcodesign instead of sigtool in here. But again that can be done in a followup.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not using |
||
| ++ optionals stdenv.hostPlatform.isx86 [ nasm ] | ||
| # Texinfo version 7.1 introduced breaking changes, which older versions of ffmpeg do not handle. | ||
| ++ optionals (lib.versionAtLeast version "6") [ texinfo ] | ||
|
|
@@ -1044,6 +1046,11 @@ stdenv.mkDerivation ( | |
| patchelf $lib/lib/libavcodec.so --add-needed libvulkan.so --add-rpath ${ | ||
| lib.makeLibraryPath [ vulkan-loader ] | ||
| } | ||
| '' | ||
| # Re-sign binaries and libraries on Darwin to ensure valid and deterministic signatures | ||
| + optionalString stdenv.hostPlatform.isDarwin '' | ||
| find "$bin" -type f -executable -exec codesign -f -s - {} + | ||
| find "$lib" -name "*.dylib" -exec codesign -f -s - {} + | ||
| ''; | ||
|
|
||
| enableParallelBuilding = true; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with the underlying bug is that it’s a non-deterministic impurity. So you can’t actually trivially test if this produces any meaningful change without being able to reproduce or verify that the particular build was going to be broken anyway.
Simply making any change to the drv will cause a rebuild that will likely work, regardless of this change.