Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pkgs/development/libraries/ffmpeg/generic.nix

Copy link
Copy Markdown
Member

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.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
config,
stdenv,
buildPackages,
darwin,
removeReferencesTo,
addDriverRunpath,
pkg-config,
Expand Down Expand Up @@ -836,6 +837,7 @@ stdenv.mkDerivation (
perl
pkg-config
]
++ optionals stdenv.hostPlatform.isDarwin [ darwin.sigtool ]

@eveeifyeve eveeifyeve May 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using autoSignDarwinBinariesHook?

++ 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 ]
Expand Down Expand Up @@ -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;
Expand Down
Loading