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

darling: fix build with ffmpeg_7 #348926

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

ghpzin
Copy link
Contributor

@ghpzin ghpzin commented Oct 15, 2024


Fixes build of darling (fails since 2024-10-13):
https://hydra.nixos.org/job/nixos/trunk-combined/nixpkgs.darling.x86_64-linux
https://hydra.nixos.org/build/274829843

Error log:

[11721/25908] Building CXX object src/CoreAudio/AudioToolbox/CMakeFiles/AudioToolbox.dir/AudioConverterImpl.cpp.o
FAILED: src/CoreAudio/AudioToolbox/CMakeFiles/AudioToolbox.dir/AudioConverterImpl.cpp.o 
/nix/store/3h5kbycdgc66c6p5927233wavdfirdbg-cc-wrapper-bypass/bin/clang++ -DAudioToolbox_EXPORTS -DDARLING -DDARWIN -DENABLE_PULSEAUDIO -DHAVE_AV_FRAME_ALLOC=1 -DPLATFORM_MacOSX -DTARGET_OS_MAC=1 -D_DARWIN_C_SOURCE -D_LIBC_NO_FEATURE_VERIFICATION -D_POSIX_C_SOURCE -D__APPLE__ -D__DYNAMIC__ -D__MACH__ -I/build/source/build/src/CoreAudio/AudioToolbox -I/build/source/src/external/libcxx/include -I/build/source/build/src/include -I/build/source/src/include -I/build/source/basic-headers -I/build/source/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -I/build/source/build/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -I/build/source/framework-include -I/build/source/framework-private-include -I/build/source/src/external/lkm/include -I/build/source/src/libDiagnosticMessagesClient/include -I/build/source/src/libMobileGestalt/include -I/build/source/src/lib/include -I/build/source/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2 -I/build/source/build/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2 -I/nix/store/bakyrc1qx6imk38276zpf4b4hlzpqi62-ffmpeg-7.0.2-dev/include -I/nix/store/apr4nzqrfv9bidsswxgmzhghsj4fn9i0-pulseaudio-17.0-dev/include -I/build/source/src/startup/mldr/elfcalls -I/build/source/src/CoreAudio/AudioToolbox/../include -I/build/source/src/CoreAudio/AudioToolbox/../include/AudioToolbox -isystem /nix/store/qb1x0mipbcvnkr40xwiwp24gg8lffrc0-clang-wrapper-18.1.8/resource-root/include -Wno-nullability-completeness -Wno-deprecated-declarations -Wno-availability -Wno-expansion-to-defined -Wno-elaborated-enum-base -Wno-undef-prefix -mmacosx-version-min=11.0 -std=c++17 -fPIC   -target x86_64-apple-darwin20  -B /build/source/build/src/external/cctools-port/cctools/misc/ -arch x86_64 -B /build/source/build/src/external/cctools-port/cctools/misc/ -arch x86_64 -MD -MT src/CoreAudio/AudioToolbox/CMakeFiles/AudioToolbox.dir/AudioConverterImpl.cpp.o -MF src/CoreAudio/AudioToolbox/CMakeFiles/AudioToolbox.dir/AudioConverterImpl.cpp.o.d -o src/CoreAudio/AudioToolbox/CMakeFiles/AudioToolbox.dir/AudioConverterImpl.cpp.o -c /build/source/src/CoreAudio/AudioToolbox/AudioConverterImpl.cpp
/build/source/src/CoreAudio/AudioToolbox/AudioConverterImpl.cpp:103:8: error: no member named 'channels' in 'AVCodecContext'
  103 |                 cIn->channels = inSourceFormat->mChannelsPerFrame;
      |                 ~~~  ^
/build/source/src/CoreAudio/AudioToolbox/AudioConverterImpl.cpp:106:52: error: no member named 'channels' in 'AVCodecContext'
  106 |                 std::cout << "Converting from PCM with " << cIn->channels << " channels at " << cIn->sample_rate << " Hz\n";
      |                                                             ~~~  ^
/build/source/src/CoreAudio/AudioToolbox/AudioConverterImpl.cpp:134:13: error: no member named 'channels' in 'AVCodecContext'
  134 |         m_encoder->channels = m_destinationFormat.mChannelsPerFrame;
      |         ~~~~~~~~~  ^
/build/source/src/CoreAudio/AudioToolbox/AudioConverterImpl.cpp:136:13: error: no member named 'channel_layout' in 'AVCodecContext'
  136 |         m_encoder->channel_layout = CAChannelCountToLayout(m_destinationFormat.mChannelsPerFrame);
      |         ~~~~~~~~~  ^
/build/source/src/CoreAudio/AudioToolbox/AudioConverterImpl.cpp:164:16: error: no member named 'channel_layout' in 'AVFrame'
  164 |         m_audioFrame->channel_layout = m_encoder->channel_layout;
      |         ~~~~~~~~~~~~  ^
/build/source/src/CoreAudio/AudioToolbox/AudioConverterImpl.cpp:164:44: error: no member named 'channel_layout' in 'AVCodecContext'
  164 |         m_audioFrame->channel_layout = m_encoder->channel_layout;
      |                                        ~~~~~~~~~  ^
/build/source/src/CoreAudio/AudioToolbox/AudioConverterImpl.cpp:167:78: error: no member named 'channels' in 'AVCodecContext'
  167 |         int audioSampleBuffer_size = av_samples_get_buffer_size(nullptr, m_encoder->channels, m_audioFrame->nb_samples, m_encoder->sample_fmt, 0);
      |                                                                          ~~~~~~~~~  ^
/build/source/src/CoreAudio/AudioToolbox/AudioConverterImpl.cpp:177:66: error: no member named 'channels' in 'AVCodecContext'
  177 |         if (int err = avcodec_fill_audio_frame(m_audioFrame, m_encoder->channels, m_encoder->sample_fmt,
      |                                                              ~~~~~~~~~  ^

build fails since default ffmpeg got updated to ffmpeg_7 in #337855

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

@emilazy emilazy left a comment

Choose a reason for hiding this comment

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

Thanks! Feel free to ping me for any future FFmpeg 7 fixes.

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 348926


x86_64-linux

✅ 2 packages built:
  • darling
  • darling.sdk

@emilazy emilazy merged commit da6d93c into NixOS:master Oct 16, 2024
10 of 11 checks passed
@emilazy
Copy link
Member

emilazy commented Oct 16, 2024

(And sorry for not catching more of them; it was a hell of a staging cycle.)

@ghpzin ghpzin deleted the darling/fix-build-with-ffmpeg_7 branch October 16, 2024 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants