NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.45k stars 13.65k forks source link

`yt-dlp` won't build on a headless box #179938

Closed paperdigits closed 2 years ago

paperdigits commented 2 years ago

Describe the bug

Using 22.05 on a computer with no x11 or wayland, yt-dlp fails to build because SDL2 tries to pull in a bunch of wayland dependencies. The dependency chain seems to be yt-dlp -> ffmpeg -> SDL2 -> libdecor

The SDL2 commit seems to be: https://github.com/NixOS/nixpkgs/commit/baee63f5e1af6d6a16fc0d3bd993673ecc689e00

Steps To Reproduce

Steps to reproduce the behavior:

  1. use 22.05
  2. include yt-dlp in system packages, but without wayland or x11
  3. nixos-rebuild switch fails

Expected behavior

I'd expect to install yt-dlp

Notify maintainers

@cpages @SuperSandro2000

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[micas@mucho:~]$ nix-shell -p nix-info --run "nix-info -m"
this path will be fetched (0.06 MiB download, 0.30 MiB unpacked):
  /nix/store/9m5k22zdy4s1yh003ma0igqmmrvncww1-bash-interactive-5.1-p16-dev
copying path '/nix/store/9m5k22zdy4s1yh003ma0igqmmrvncww1-bash-interactive-5.1-p16-dev' from 'https://cache.nixos.org'...
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.49, NixOS, 22.05 (Quokka), 22.05.1322.915f5a5b3cc`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.8.1`
 - channels(root): `"nixos-22.05.1322.915f5a5b3cc"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
paperdigits commented 2 years ago
these 19 derivations will be built:
  /nix/store/drdpylm1mrsqhp69p4pdqavdmfwkamhq-libdecor-0.1.0.drv
  /nix/store/icsz29v59mr1yym0xvrg0rvzch76cc1x-SDL2-2.0.20.drv
  /nix/store/d20qilvg2gfxwdl1bbp92l79cb1m5a0q-ffmpeg-4.4.1.drv
  /nix/store/smgskd5fmlg5kb1bkdf48kzwli1bypqw-libcamera-unstable-2022-01-03.drv
  /nix/store/znn7qmprs40ksm1gmkpidri3hrpifs75-libcanberra-0.30.drv
  /nix/store/rd3y78jv111yxwmnq165dxfgbr1sh4n0-pipewire-0.3.51.drv
  /nix/store/gfl5k9dzrrf4ydwd8k1xawmr70n24igz-SDL2-2.0.20.drv
  /nix/store/g5kv475c1g93c9g6b8y90gp5w5ak9n3f-ffmpeg-4.4.1.drv
  /nix/store/xrxvpfxlqyan2ri53n82pp47y5kb5026-python3.9-yt-dlp-2022.6.29.drv
  /nix/store/9bkdz4z04rr5dsjj6wd9fiz6p9zikqz9-system-path.drv
  /nix/store/bg8hz488n3lkmdaxij2sj2aprkga37xj-dbus-1.drv
  /nix/store/y2hcy2q29swxmvfhrg32fhwsc8x1lb0h-unit-dbus.service.drv
  /nix/store/nqafbm28zqivnr5hz71h4896vc6nkwb1-user-units.drv
  /nix/store/i6rd5cvnk65dgn0kgm30ww2ysh9ab5aa-unit-polkit.service.drv
  /nix/store/p7sfwvvjikw54mg77cxks195h93jj1id-unit-systemd-fsck-.service.drv
  /nix/store/vj4qx5gcljk9p9p2z8c9q2wnc4kf6cjx-unit-dbus.service.drv
  /nix/store/ylf52ci9asciwy29arsc7kvyd14xygzn-system-units.drv
  /nix/store/x8a5y0a7bgl8vj792mnh52sxbnwdplsc-etc.drv
  /nix/store/0z5rfmgg6112m5mp04120g1kbxl7w2b8-nixos-system-mucho-22.05.1322.915f5a5b3cc.drv
building '/nix/store/drdpylm1mrsqhp69p4pdqavdmfwkamhq-libdecor-0.1.0.drv'...
building '/nix/store/smgskd5fmlg5kb1bkdf48kzwli1bypqw-libcamera-unstable-2022-01-03.drv'...
building '/nix/store/znn7qmprs40ksm1gmkpidri3hrpifs75-libcanberra-0.30.drv'...
unpacking sources
unpacking source archive /nix/store/pj8kla3kgs3w0fbcvhb7dvp7g2kjlj6a-source
source root is source
patching sources
configuring
meson flags: --buildtype=plain         --libdir=/nix/store/6aksx12g10kq8ay3aip0zgcm9r5b2z4j-libdecor-0.1.0/lib --libexecdir=/nix/store/6aksx12g10kq8ay3aip0zgcm9r5b2z4j-libdecor-0.1.0/libexec         --bindir=/nix/store/6aksx12g10kq8ay3aip0zgcm9r5b2z4j-libdecor-0.1.0/bin --sbindir=/nix/store/6aksx12g10kq8ay3aip0zgcm9r5b2z4j-libdecor-0.1.0/sbin         --includedir=/nix/store/6aksx12g10kq8ay3aip0zgcm9r5b2z4j-libdecor-0.1.0/include         --mandir=/nix/store/6aksx12g10kq8ay3aip0zgcm9r5b2z4j-libdecor-0.1.0/share/man --infodir=/nix/store/6aksx12g10kq8ay3aip0zgcm9r5b2z4j-libdecor-0.1.0/share/info         --localedir=/nix/store/6aksx12g10kq8ay3aip0zgcm9r5b2z4j-libdecor-0.1.0/share/locale         -Dauto_features=enabled         -Dwrap_mode=nodownload         --prefix=/nix/store/6aksx12g10kq8ay3aip0zgcm9r5b2z4j-libdecor-0.1.0  
unpacking sources
unpacking source archive /nix/store/dvpifcwjhnwx2g42x2d166nfmfpiwpqn-libcamera-1db1e31
unpacking sources
unpacking source archive /nix/store/j5k96cc599x1bsxzaynvvc7yd8xkiysq-libcanberra-0.30.tar.xz
source root is libcanberra-0.30
source root is libcamera-1db1e31
setting SOURCE_DATE_EPOCH to timestamp 1348532939 of file libcanberra-0.30/gtkdoc/tmpl/libcanberra-unused.sgml
patching sources
applying patch /nix/store/j0ir0x6m2kh4zkkssg4jg6w4lvsqiwhv-0001-gtk-Don-t-assume-all-GdkDisplays-are-GdkX11Displays-.patch
patching file src/canberra-gtk-module.c
patching file src/canberra-gtk.c
configuring
patching sources
fixing libtool script ./build-aux/ltmain.sh
patching script interpreter paths in utils/
utils/checkstyle.py: interpreter directive changed from "#!/usr/bin/python3" to "/nix/store/7l0dc127v4c2m3yar0bmqy9q6sfmypin-python3-3.9.13/bin/python3"
configure flags: --disable-static --disable-dependency-tracking --prefix=/nix/store/30q8z37yw3hs3j11kj1k1qlfjw7k3n3j-libcanberra-0.30 --disable-oss
utils/gen-controls.py: interpreter directive changed from "#!/usr/bin/env python3" to "/nix/store/7l0dc127v4c2m3yar0bmqy9q6sfmypin-python3-3.9.13/bin/python3"
utils/gen-formats.py: interpreter directive changed from "#!/usr/bin/env python3" to "/nix/store/7l0dc127v4c2m3yar0bmqy9q6sfmypin-python3-3.9.13/bin/python3"
utils/gen-header.sh: interpreter directive changed from "#!/bin/sh" to "/nix/store/iffl6dlplhv22i2xy7n1w51a5r631kmi-bash-5.1-p16/bin/sh"
utils/gen-ipa-priv-key.sh: interpreter directive changed from "#!/bin/sh" to "/nix/store/iffl6dlplhv22i2xy7n1w51a5r631kmi-bash-5.1-p16/bin/sh"
utils/gen-ipa-pub-key.py: interpreter directive changed from "#!/usr/bin/env python3" to "/nix/store/7l0dc127v4c2m3yar0bmqy9q6sfmypin-python3-3.9.13/bin/python3"
utils/gen-version.sh: interpreter directive changed from "#!/bin/sh" to "/nix/store/iffl6dlplhv22i2xy7n1w51a5r631kmi-bash-5.1-p16/bin/sh"
utils/hooks/post-commit: interpreter directive changed from "#!/bin/sh" to "/nix/store/iffl6dlplhv22i2xy7n1w51a5r631kmi-bash-5.1-p16/bin/sh"
utils/hooks/pre-commit: interpreter directive changed from "#!/bin/sh" to "/nix/store/iffl6dlplhv22i2xy7n1w51a5r631kmi-bash-5.1-p16/bin/sh"
utils/hooks/pre-push: interpreter directive changed from "#!/bin/sh" to "/nix/store/iffl6dlplhv22i2xy7n1w51a5r631kmi-bash-5.1-p16/bin/sh"
utils/ipc/extract-docs.py: interpreter directive changed from "#!/usr/bin/env python3" to "/nix/store/7l0dc127v4c2m3yar0bmqy9q6sfmypin-python3-3.9.13/bin/python3"
utils/ipc/generate.py: interpreter directive changed from "#!/usr/bin/env python3" to "/nix/store/7l0dc127v4c2m3yar0bmqy9q6sfmypin-python3-3.9.13/bin/python3"
utils/ipc/mojo/public/tools/bindings/concatenate-files.py: interpreter directive changed from "#!/usr/bin/env python" to "/nix/store/7l0dc127v4c2m3yar0bmqy9q6sfmypin-python3-3.9.13/bin/python"
utils/ipc/mojo/public/tools/bindings/concatenate_and_replace_closure_exports.py: interpreter directive changed from "#!/usr/bin/env python" to "/nix/store/7l0dc127v4c2m3yar0bmqy9q6sfmypin-python3-3.9.13/bin/python"
utils/ipc/mojo/public/tools/bindings/format_typemap_generator_args.py: interpreter directive changed from "#!/usr/bin/env python" to "/nix/store/7l0dc127v4c2m3yar0bmqy9q6sfmypin-python3-3.9.13/bin/python"
utils/ipc/mojo/public/tools/bindings/generate_type_mappings.py: interpreter directive changed from "#!/usr/bin/env python" to "/nix/store/7l0dc127v4c2m3yar0bmqy9q6sfmypin-python3-3.9.13/bin/python"
utils/ipc/mojo/public/tools/bindings/mojom_bindings_generator.py: interpreter directive changed from "#!/usr/bin/env python" to "/nix/store/7l0dc127v4c2m3yar0bmqy9q6sfmypin-python3-3.9.13/bin/python"
utils/ipc/mojo/public/tools/bindings/mojom_types_downgrader.py: interpreter directive changed from "#!/usr/bin/env python" to "/nix/store/7l0dc127v4c2m3yar0bmqy9q6sfmypin-python3-3.9.13/bin/python"
utils/ipc/mojo/public/tools/bindings/validate_typemap_config.py: interpreter directive changed from "#!/usr/bin/env python" to "/nix/store/7l0dc127v4c2m3yar0bmqy9q6sfmypin-python3-3.9.13/bin/python"
utils/ipc/mojo/public/tools/mojom/check_stable_mojom_compatibility.py: interpreter directive changed from "#!/usr/bin/env python" to "/nix/store/7l0dc127v4c2m3yar0bmqy9q6sfmypin-python3-3.9.13/bin/python"
utils/ipc/mojo/public/tools/mojom/check_stable_mojom_compatibility_unittest.py: interpreter directive changed from "#!/usr/bin/env python" to "/nix/store/7l0dc127v4c2m3yar0bmqy9q6sfmypin-python3-3.9.13/bin/python"
checking for a BSD-compatible install... /nix/store/7jr7pr4c6yb85xpzay5xafs5zlcadkhz-coreutils-9.0/bin/install -c
checking whether build environment is sane... yes
utils/ipc/mojo/public/tools/mojom/mojom_parser.py: interpreter directive changed from "#!/usr/bin/env python" to "/nix/store/7l0dc127v4c2m3yar0bmqy9q6sfmypin-python3-3.9.13/bin/python"
The Meson build system
Version: 0.61.2
Source dir: /build/source
Build dir: /build/source/build
Build type: native build
utils/ipc/mojo/public/tools/run_all_python_unittests.py: interpreter directive changed from "#!/usr/bin/env python" to "/nix/store/7l0dc127v4c2m3yar0bmqy9q6sfmypin-python3-3.9.13/bin/python"
checking for a thread-safe mkdir -p... /nix/store/7jr7pr4c6yb85xpzay5xafs5zlcadkhz-coreutils-9.0/bin/mkdir -p
checking for gawk... gawk
utils/ipc/parser.py: interpreter directive changed from "#!/usr/bin/env python3" to "/nix/store/7l0dc127v4c2m3yar0bmqy9q6sfmypin-python3-3.9.13/bin/python3"
checking whether make sets $(MAKE)... yes
utils/ipu3/ipu3-capture.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/iffl6dlplhv22i2xy7n1w51a5r631kmi-bash-5.1-p16/bin/bash"
checking whether make supports nested variables... yes
utils/ipu3/ipu3-process.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/iffl6dlplhv22i2xy7n1w51a5r631kmi-bash-5.1-p16/bin/bash"
Project name: libdecor
Project version: 0.1.0
utils/raspberrypi/ctt/ctt.py: interpreter directive changed from "#!/usr/bin/env python3" to "/nix/store/7l0dc127v4c2m3yar0bmqy9q6sfmypin-python3-3.9.13/bin/python3"
utils/rkisp1/rkisp1-capture.sh: interpreter directive changed from "#!/bin/sh" to "/nix/store/iffl6dlplhv22i2xy7n1w51a5r631kmi-bash-5.1-p16/bin/sh"
checking how to create a pax tar archive... gnutar
checking whether make supports nested variables... (cached) yes
utils/tracepoints/analyze-ipa-trace.py: interpreter directive changed from "#!/usr/bin/env python3" to "/nix/store/7l0dc127v4c2m3yar0bmqy9q6sfmypin-python3-3.9.13/bin/python3"
utils/tracepoints/gen-tp-header.py: interpreter directive changed from "#!/usr/bin/env python3" to "/nix/store/7l0dc127v4c2m3yar0bmqy9q6sfmypin-python3-3.9.13/bin/python3"
utils/update-kernel-headers.sh: interpreter directive changed from "#!/bin/sh" to "/nix/store/iffl6dlplhv22i2xy7n1w51a5r631kmi-bash-5.1-p16/bin/sh"
utils/update-mojo.sh: interpreter directive changed from "#!/bin/sh" to "/nix/store/iffl6dlplhv22i2xy7n1w51a5r631kmi-bash-5.1-p16/bin/sh"
configuring
meson flags: --buildtype=plain         --libdir=/nix/store/x5dl94xkxm1i4dpqw7bg2r9hm5h0650i-libcamera-unstable-2022-01-03/lib --libexecdir=/nix/store/x5dl94xkxm1i4dpqw7bg2r9hm5h0650i-libcamera-unstable-2022-01-03/libexec         --bindir=/nix/store/x5dl94xkxm1i4dpqw7bg2r9hm5h0650i-libcamera-unstable-2022-01-03/bin --sbindir=/nix/store/x5dl94xkxm1i4dpqw7bg2r9hm5h0650i-libcamera-unstable-2022-01-03/sbin         --includedir=/nix/store/x5dl94xkxm1i4dpqw7bg2r9hm5h0650i-libcamera-unstable-2022-01-03/include         --mandir=/nix/store/x5dl94xkxm1i4dpqw7bg2r9hm5h0650i-libcamera-unstable-2022-01-03/share/man --infodir=/nix/store/x5dl94xkxm1i4dpqw7bg2r9hm5h0650i-libcamera-unstable-2022-01-03/share/info         --localedir=/nix/store/x5dl94xkxm1i4dpqw7bg2r9hm5h0650i-libcamera-unstable-2022-01-03/share/locale         -Dauto_features=enabled         -Dwrap_mode=nodownload         --prefix=/nix/store/x5dl94xkxm1i4dpqw7bg2r9hm5h0650i-libcamera-unstable-2022-01-03 -Dv4l2=true -Dqcam=disabled -Dlc-compliance=disabled 
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking whether ln -s works... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
C compiler for the host machine: gcc (gcc 11.3.0 "gcc (GCC) 11.3.0")
C linker for the host machine: gcc ld.bfd 2.38
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
Host machine cpu family: x86_64
Host machine cpu: x86_64
checking whether gcc accepts -g... yes
The Meson build system
Version: 0.61.2
Source dir: /build/libcamera-1db1e31
Build dir: /build/libcamera-1db1e31/build
Build type: native build
Compiler for C supports arguments -Wno-unused-parameter: YES 
Project name: libcamera
Project version: 0.0.0
Compiler for C supports arguments -Wno-missing-field-initializers: YES 
checking for gcc option to accept ISO C89... none needed
Found pkg-config: /nix/store/szc9mx70l0lk32rbyixpq5mska4fzj61-pkg-config-wrapper-0.29.2/bin/pkg-config (0.29.2)
checking dependency style of gcc... none
checking the archiver (ar) interface... ar
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) none
Run-time dependency wayland-client found: YES 1.20.0
Run-time dependency wayland-protocols found: YES 1.25
C compiler for the host machine: gcc (gcc 11.3.0 "gcc (GCC) 11.3.0")
C linker for the host machine: gcc ld.bfd 2.38
checking for gcc option to accept ISO C99... none needed
Library dl found: YES
Run-time dependency dbus-1 found: YES 1.14.0
checking whether gcc and cc understand -c and -o together... yes
checking how to run the C preprocessor... gcc -E
Checking for function "memfd_create" : YES 
checking for grep that handles long lines and -e... /nix/store/qd9jxc0q00cr7fp30y6jbbww20gj33lg-gnugrep-3.7/bin/grep
checking for egrep... /nix/store/qd9jxc0q00cr7fp30y6jbbww20gj33lg-gnugrep-3.7/bin/grep -E
C++ compiler for the host machine: g++ (gcc 11.3.0 "g++ (GCC) 11.3.0")
C++ linker for the host machine: g++ ld.bfd 2.38
checking whether gcc needs -traditional... no
Checking for function "posix_fallocate" : YES 
Checking for function "asprintf" : YES 
Configuring config.h using configuration
Program wayland-scanner found: YES (/nix/store/sly7wm6a65lpm2a46rmzd20af0faafyq-wayland-1.20.0-bin/bin/wayland-scanner)
Run-time dependency cairo found: YES 1.16.0
Run-time dependency pangocairo found: YES 1.50.7
Run-time dependency wayland-cursor found: YES 1.20.0
checking for ANSI C header files... yes
checking for sys/types.h... yes
Library m found: YES
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
Host machine cpu family: x86_64
Host machine cpu: x86_64
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: https://github.com/mesonbuild/meson/issues/9300
checking for memory.h... yes
Header <unistd.h> has symbol "issetugid" : NO 
Header <stdlib.h> has symbol "secure_getenv" : YES 
checking for strings.h... yes
Compiler for C supports arguments -Wno-c99-designator: NO 
checking for inttypes.h... yes
Library lttng-ust found: YES
Program ./parser.py found: YES (/build/libcamera-1db1e31/utils/ipc/./parser.py)
Program ./generate.py found: YES (/build/libcamera-1db1e31/utils/ipc/./generate.py)
Program ./extract-docs.py found: YES (/build/libcamera-1db1e31/utils/ipc/./extract-docs.py)
checking for stdint.h... yes
Program ./gen-tp-header.py found: YES (/build/libcamera-1db1e31/utils/tracepoints/./gen-tp-header.py)
checking for unistd.h... yes
Configuring version.h using configuration
Program openssl found: YES (/nix/store/825gi3s5j4xp5cxrjwrzzi8r8gkgp0f4-openssl-1.1.1o-bin/bin/openssl)
C++ compiler for the host machine: g++ (gcc 11.3.0 "g++ (GCC) 11.3.0")
C++ linker for the host machine: g++ ld.bfd 2.38
Dependency wayland-cursor found: YES 1.20.0 (cached)
Library m found: YES
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency egl found: NO (tried pkgconfig)

demo/meson.build:7:0: ERROR: Dependency "egl" not found, tried pkgconfig

A full log can be found at /build/source/build/meson-logs/meson-log.txt
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
error: builder for '/nix/store/drdpylm1mrsqhp69p4pdqavdmfwkamhq-libdecor-0.1.0.drv' failed with exit code 1
error (ignored): error: cannot unlink '/tmp/nix-build-libcamera-unstable-2022-01-03.drv-1': Directory not empty
error: 1 dependencies of derivation '/nix/store/gfl5k9dzrrf4ydwd8k1xawmr70n24igz-SDL2-2.0.20.drv' failed to build
error: 1 dependencies of derivation '/nix/store/g5kv475c1g93c9g6b8y90gp5w5ak9n3f-ffmpeg-4.4.1.drv' failed to build
error: 1 dependencies of derivation '/nix/store/xrxvpfxlqyan2ri53n82pp47y5kb5026-python3.9-yt-dlp-2022.6.29.drv' failed to build
error: 1 dependencies of derivation '/nix/store/9bkdz4z04rr5dsjj6wd9fiz6p9zikqz9-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/0z5rfmgg6112m5mp04120g1kbxl7w2b8-nixos-system-mucho-22.05.1322.915f5a5b3cc.drv' failed to build

After adding yt-dlp to system packages and trying to rebuild.

SuperSandro2000 commented 2 years ago

If you have environment.noXlibs set to true then set it to false. It is known to cause a lot of problems.

milahu commented 2 years ago

wild speculation: ffmpeg needs a GUI for ffplay edit: pkgs/development/libraries/ffmpeg/generic.nix: "--disable-ffplay"

→ add package ffmpeg-headless? similar: ffmpeg-headless in AUR

SuperSandro2000 commented 2 years ago

fixed by #189507