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: ffmpeg_6 -> ffmpeg_7 #337855

Merged
merged 4 commits into from
Sep 7, 2024
Merged

ffmpeg: ffmpeg_6 -> ffmpeg_7 #337855

merged 4 commits into from
Sep 7, 2024

Conversation

emilazy
Copy link
Member

@emilazy emilazy commented Aug 28, 2024

Description of changes

It’s finally time! 🎉

This PR is pretty mundane; the main points for review are the changes to the release notes and the comments about updating and pinning FFmpeg, which are based on my experiences getting rid of old FFmpeg dependencies over the past however long it’s been. The real fun will come during the staging cycle. I’ve documented my procedure for handling FFmpeg version problems below for the benefit of people working on the cycle.

I have successfully built ffmpeg{,4,6}{,-headless,-full} and python{311,312}Packages.{av,ffmpeg-python} on aarch64-linux, and am in the process of building them on the other major platforms.

I hope that FFmpeg 6 won’t stick around as long as previous versions have. Major distros like Arch have already moved over to FFmpeg 7 and removed FFmpeg 6, so I anticipate that the vast majority of packages won’t be stuck on 6 for long. I intend to do my bit to ensure we can remove it as soon as possible, although I suspect there’ll be enough stragglers that the 24.11 release will still include it.

How to fix things this change breaks

First off, everything this breaks should be able to be fixed by pinning FFmpeg 6. If you don’t have the time, just change the dependency to one of the ffmpeg_6 packages and be done with it. Please ping me, on Matrix or GitHub, if you notice any suspiciously FFmpeg‐looking failures, or if you open a PR to fix one, so that I can review and keep track of what packages need looking into.

If you want to do your part to get the package working on FFmpeg 7, though, here’s my procedure:

  1. Check if there’s a new upstream stable release that builds with the newer FFmpeg.

  2. Check if there’s unreleased upstream commits that fix the build with the newer FFmpeg that we can either patch in or bump to.

  3. Check if any other distributions have made downstream patches for FFmpeg support. Repology is good for finding packages here. Arch, Debian, and even Cygwin have helped me here in the past.

  4. Check if there are any open pull requests upstream to add support that look high‐quality enough for us to vendor.

  5. Consider patching in support yourself, sending it upstream, and vendoring the changes in Nixpkgs for now. FFmpeg breaking changes are rarely very involved to fix, just tedious. (There’s some sharp edges for this bump, though; the channel layout stuff touches on their options API, which is not statically checked, so it’s easy to miss things.)

  6. Give up and pin the older version.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

Copy link
Member

@Atemu Atemu left a comment

Choose a reason for hiding this comment

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

This generally LGTM but we need to do a little more QA as we should verify that we don't cause any additional build failures by doing this.

Building an entire eval on at least one Linux platform would be on order. Technically, I think building direct dependants ought to be enough but I don't immediately know how to realise that.

Comment on lines 53 to 62
# Please make sure this is updated to the latest version on the next major
# update to ffmpeg
# Packages which use ffmpeg as a library, should pin to the relevant major
# version number which the upstream support.
# Please make sure this is updated to new major versions once they
# build and work on all the major platforms. If absolutely necessary
# due to severe breaking changes, the bump can wait a little bit to
# give the most proactive users time to migrate, but don’t hold off
# for too long.
#
# Packages which depend on FFmpeg should generally use these
# unversioned aliases to allow for quicker migration to new releases,
# but can pin one of the versioned variants if they do not work with
# the current default version.
Copy link
Member

Choose a reason for hiding this comment

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

ACK.

@@ -17,16 +17,16 @@

buildPythonPackage rec {
pname = "av";
version = "12.3.0";
version = "12.3.0-unstable-2024-08-19";
Copy link
Member

Choose a reason for hiding this comment

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

I assume a release is imminent and we wait for that?

Otherwise I say we do this in a separate PR. Unpinning is a secondary goal, we should get everything that isn't pinned upgraded first.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, per the PR and commit message – it’s scheduled for the start of September, before the next staging cycle will start, hence this being a draft for now. The reason to do this at the same time is to deal with the vast majority of FFmpeg 7 problems at once, Python system included, rather than stretching it out over multiple cycles.

@emilazy
Copy link
Member Author

emilazy commented Aug 28, 2024

This generally LGTM but we need to do a little more QA as we should verify that we don't cause any additional build failures by doing this.

Building an entire eval on at least one Linux platform would be on order. Technically, I think building direct dependants ought to be enough but I don't immediately know how to realise that.

It’s normal for a bunch of stuff to break during the staging cycle (otherwise nothing would ever get merged into staging; cf. #332957). The dependency graph here is many many thousands of packages so it’s not practical to do a complete rebuild.

Building all direct reverse dependencies would be nice, but is hard to compute (I tried @trofi’s arevdeps.nix script for #337624 but it started building a bunch of stuff at eval time for some reason, so I gave up and grepped the tree to get a rough approximation instead) If I could compute a reasonable reverse dependency list I would try, but we get together to run Hydra builds and fix most of it before it hits master for a reason :) Doing everything ahead of time doesn’t scale once you touch a sufficiently large number of packages.

I am active in the Staging Matrix room and will be monitoring the reports for regressions this causes to make sure I can update, patch, or pin them before the staging cycle is merged. Hopefully the instructions I gave at the start of the PR will help distribute the work, too. (There will probably be some regressions left over that don’t block the channel and that nobody noticed, but that’s pretty normal for staging and they can be fixed as they come up – or if nobody at all notices that the package is broken, that’s a pretty good sign that it’s unused and should be removed anyway…)

@emilazy
Copy link
Member Author

emilazy commented Aug 29, 2024

I have successfully built ffmpeg{,4,6}{,-headless,-full} and python{311,312}Packages.{av,ffmpeg-python} on aarch64-linux, and am in the process of building them on the other major platforms.

Now built on x86_64-linux and aarch64-darwin, after a lot of tedious stdenv‐building. Doing x86_64-darwin now.

@emilazy
Copy link
Member Author

emilazy commented Aug 29, 2024

I’ve successfully built mpv, yt-dlp, ardour, and falkon on this branch on aarch64-linux, as a somewhat random cross‐sample of prominent FFmpeg users. x86_64-darwin is still chugging away at LLVM.

Copy link
Member

Choose a reason for hiding this comment

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

Big fan of unpinning packages where we don't think we need pinning.

@emilazy
Copy link
Member Author

emilazy commented Aug 29, 2024

After many hours of babysitting and restarting builds on the Darwin community builder I’ve found that x86_64-darwin’s rustc is currently broken on staging, possibly only under Rosetta 2 🫠

So no hope of building that right now, but given that this is a simple alias switch and it built on all the other platforms I don’t anticipate any problems. I’ll bump to the final PyAV release once it’s out and mark this as ready for review.

@trofi
Copy link
Contributor

trofi commented Aug 31, 2024

Took me a while to workaround eval regressions in nixpkgs. Here is what arevdeps.nix gave out to me for depth level 2:

$ nix-instantiate --impure --read-write-mode --eval --strict ~/.config/nixpkgs/lib/arevdeps.nix --argstr attrName ffmpeg_6 -I nixpkgs=$PWD --arg depth 2 --show-trace

_64gram
aaxtomp3
aegisub
alass
alephone
amarok
ani-cli
arcan
ardour
ardour_7
audacious-plugins
av1an
av1an-unwrapped
baresip
bazarr
beets
beets-unstable
betterbird
blender
blender-hip
bombono
cantata
capture
cfdg
chiaki
chiaki4deck
chromedriver
ciano
clipgrab
cmus
codemov
corrscope
corsix-th
ctpv
CuboCore.coretoppings
darling
ddnet
deepin.dde-grand-search
deepin.deepin-movie-reborn
deepin.deepin-music
devede
diffoscope
dim
dmlive
dolphin-emu
dolphin-emu-primehack
dosbox-x
dr14_tmeter
dra-cla
droidcam
dsp
easyaudiosync
emacsPackages.telega
faircamp
famistudio
ffmpeg-normalize
ffms
firefox
firefox-beta
firefox-beta-bin
firefox-bin
firefox-devedition
firefox-devedition-bin
firefox-esr
firefox-esr-115
firefox-mobile
firefoxpwa
flac2all
flet-client-flutter
floorp
flowblade
footage
fooyin
freerdp
freerdp3
gamescope
get_iplayer
gif-for-cli
gifgen
gifski
giph
glaxnimate
glslviewer
gnomecast
gonic
gopro
gossip
gphotos-sync
gpu-screen-recorder
grass
gr-framework
gtk-pipe-viewer
harvid
hydrus
invidtui
iowatcher
jami
janus-gateway
kdePackages.ffmpegthumbs
kdePackages.kfilemetadata
kdePackages.kpipewire
kdePackages.mlt
keyfinder-cli
kid3
kid3-cli
kid3-qt
kodi
kodi-gbm
kodiPackages.inputstream-ffmpegdirect
kodi-wayland
kotatogram-desktop
kphotoalbum
ladybird
libretro.citra
librewolf
libsForQt5.clip
libsForQt5.k3b
libsForQt5.kfilemetadata
libsForQt5.kpipewire
libsForQt5.libopenshot
libsForQt5.mlt
libtas
libvlc
lightspark
livepeer
lms
local-ai
lux
manim
manim-slides
maptool
materialgram
media-downloader
mediaelch
mediaelch-qt6
mgba
minidlna
mixxx
mlt
moonlight-embedded
moonlight-qt
motion
mov-cli
mpd
mpd-notification
mpvScripts.encode
mpvScripts.mpris
mpvScripts.mpv-slicing
mpv-unwrapped
mullvad-browser
neatvnc
neothesia
notcurses
obs-studio-plugins.droidcam-obs
ocamlPackages.ffmpeg-av
ocamlPackages.ffmpeg-avcodec
ocamlPackages.ffmpeg-avdevice
ocamlPackages.ffmpeg-avfilter
ocamlPackages.ffmpeg-avutil
ocamlPackages.ffmpeg-swresample
ocamlPackages.ffmpeg-swscale
olaris-server
olive-editor
onthespot
opencv
openjfx21
openjfx22
openmw
openrw
opustags
ossia-score
ovito
owncast
palemoon-bin
parabolic
paraview
parrot
pcsx2
performous
persepolis
photofield
pianobar
pianotrans
pict-rs
pipe-viewer
pqiv
processing
punes
punes-qt6
pypy310Packages.mlt
pypy310Packages.opencv4
pypy3Packages.mlt
pypy3Packages.opencv4
pypyPackages.mlt
python310Packages.arviz
python310Packages.discordpy
python310Packages.ffmpeg-progress-yield
python310Packages.gradio
python310Packages.gymnasium
python310Packages.manim
python310Packages.manim-slides
python310Packages.mlt
python310Packages.opencv4
python310Packages.pyunifiprotect
python310Packages.uiprotect
python311Packages.arviz
python311Packages.discordpy
python311Packages.ffmpeg-progress-yield
python311Packages.gradio
python311Packages.gymnasium
python311Packages.manim
python311Packages.manim-slides
python311Packages.mlt
python311Packages.opencv4
python311Packages.pyunifiprotect
python311Packages.uiprotect
python313Packages.discordpy
python313Packages.ffmpeg-progress-yield
python313Packages.gradio
python313Packages.gymnasium
python313Packages.manim
python313Packages.manim-slides
python313Packages.mlt
python313Packages.opencv4
python313Packages.pyunifiprotect
python313Packages.uiprotect
python39Packages.ffmpeg-progress-yield
python39Packages.mlt
python39Packages.opencv4
python3Packages.arviz
python3Packages.discordpy
python3Packages.ffmpeg-progress-yield
python3Packages.gradio
python3Packages.gymnasium
python3Packages.manim-slides
python3Packages.mlt
python3Packages.opencv4
python3Packages.pyunifiprotect
python3Packages.uiprotect
qcm
qctools
qmmp
qmplay2
qmplay2-qt5
qstopmotion
qtox
renpy
ripgrep-all
rofi-screenshot
rpcs3
rsgain
rustdesk-flutter
rustplayer
ryujinx
sanjuuni
scrcpy
screen-pipe
sdrangel
seekwatcher
sharedown
sigal
siril
sonarr
songrec
spek
spotdl
squeezelite
squeezelite-pulse
srtrelay
stepmania
streamrip
stremio
substudy
subtitlecomposer
subtitleedit
survex
svtplay-dl
tartube-yt-dlp
tauon
telegram-desktop
tenacity
thunderbird
thunderbird-115
thunderbird-bin-unwrapped
tidal-hifi
timg
tor-browser
tplay
t-rec
unflac
unsilence
vbam
vcmi
vcs
vcsi
vdrPlugins.markad
vdrPlugins.softhddevice
vdrPlugins.xineliboutput
vgmstream
vhs
vivictpp
vkdt
vlc
waypipe
weylus
wf-recorder
wlroots_0_17
wlroots_0_18
wlvncc
wxSVG
xine-lib
xmms2
xpra
xscast
yaxg
yaydl
yle-dl
ytdownloader
ytmdl
yutto
zoneminder

@emilazy
Copy link
Member Author

emilazy commented Aug 31, 2024

Thank you @trofi!

It’s around ~7400 rebuilds on aarch64-linux after removing unsupported packages 🫠 I’ll leave it running for a while to catch any early failures high up the dependency tree, but this is probably going to have to be one mostly for Hydra on staging-next.

@emilazy
Copy link
Member Author

emilazy commented Sep 1, 2024

It’s paying dividends! Tracked down a gst-libav bump that I’ll push to this PR when the final PyAV release is out, and opened #338702 and #338715. Unfortunately the next staging cycle is also the Python 3.13 one, so there’s a lot of other random breakage that isn’t directly because of FFmpeg :) (not true, I was just building Python 3.13 packages!)

@emilazy
Copy link
Member Author

emilazy commented Sep 3, 2024

GStreamer bump is up: #339147.

@emilazy emilazy force-pushed the push-qytpkqnprvou branch 2 times, most recently from a1e6d21 to 979fad0 Compare September 4, 2024 05:45
@emilazy
Copy link
Member Author

emilazy commented Sep 4, 2024

The final PyAV release came out, and I verified that it still builds on aarch64-linux. #338715 and #339357 are relevant PRs awaiting review and merge. I will probably try to make some more builds happen to catch regressions early before the next staging cycle starts in the next few weeks but this should be ready to merge now.

@emilazy emilazy marked this pull request as ready for review September 4, 2024 05:52
@K900
Copy link
Contributor

K900 commented Sep 4, 2024

Qt should be fine, as long as it builds.

@emilazy
Copy link
Member Author

emilazy commented Sep 4, 2024

(Confirmed that Qt builds.)

Copy link
Member

@jopejoe1 jopejoe1 left a comment

Choose a reason for hiding this comment

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

I think it is time to get this merged.

Copy link
Member

@Atemu Atemu left a comment

Choose a reason for hiding this comment

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

Sure, let's go. This PR isn't going to get any better by sitting around.

@emilazy
Copy link
Member Author

emilazy commented Sep 7, 2024

Sure; the AArch64 builder kept restarting on me when I was trying to kick off more builds, so I think it’s probably best to leave most of the triage to the staging-next job. Could we get #338715 reviewed/merged first, as it’s the remaining known regression from the builds I already ran, and I’d like to include it in the mass unpinning commit when I rebase this?

It is best to keep as many FFmpeg dependencies unpinned as possible,
so that only the packages that actually break are kept behind on old
versions. I ran into many cases recently where a package was pinned
to an old version of FFmpeg but worked fine with the latest one,
making the older versions look more necessary than they actually were.

This will make it easier to find packages that need intervention to
be updated to newer versions and speed up the process of jettisoning
old FFmpeg versions. The cost of potentially holding back the default
version for a little while to let major parts of the ecosystem catch
up is minor by comparison, especially since it has happened with 7
anyway due to Darwin problems.
Per the adjusted FFmpeg pinning advice, packages that work on the
default version should use the unversioned variants to ease the
migration to future versions and reduce the number of packages that
end up referencing old versions.

I have left HandBrake pinned as it builds a custom patched FFmpeg.
Includes support for FFmpeg 7.
@emilazy
Copy link
Member Author

emilazy commented Sep 7, 2024

Let’s do this :)

I’m running the large build again and I’ve found at least one regression that I’ll send a follow‐up PR for, but this is as ready as it’ll ever be.

@emilazy emilazy merged commit 39ea8fd into NixOS:staging Sep 7, 2024
5 of 9 checks passed
@emilazy emilazy deleted the push-qytpkqnprvou branch September 7, 2024 20:31
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/breaking-changes-announcement-for-unstable/17574/58

@emilazy emilazy mentioned this pull request Sep 9, 2024
13 tasks
@emilazy
Copy link
Member Author

emilazy commented Oct 7, 2024

@surfaceflinger
Copy link
Member

#348374

@ghpzin ghpzin mentioned this pull request Oct 15, 2024
13 tasks
@7c6f434c 7c6f434c mentioned this pull request Oct 18, 2024
FliegendeWurst added a commit to FliegendeWurst/nixpkgs that referenced this pull request Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants