mpv-player / mpv-build

🔨 Helper scripts to compile mpv on Linux
http://mpv.io
403 stars 104 forks source link

git master build with meson fails #212

Closed razvaneduard closed 1 year ago

razvaneduard commented 1 year ago

mpv version and platform versions

Ubuntu 22.04.1 LTS mpv git master

Reproduction steps

this work without issues BUILDSYSTEM=waf ./rebuild -j12

but building using meson fail at final step. I use helper scripts.

ninja --version 1.11.1.git.kitware.jobserver-1 meson -v 1.0.0

ffmpeg_options --enable-libx264 --enable-libx265 --enable-libmp3lame --enable-libfdk-aac --enable-nonfree --enable-libvorbis --enable-libvpx --enable-libopus --enable-libtheora --enable-libpulse --enable-gnutls --enable-libcaca

mpv_options -Dprefer_static=true -Dx11=enabled -Dwayland=disabled

console output .... .... [242/242] Linking target mpv FAILED: mpv ... huge number of 'undefined reference' reported ... /usr/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed.

Expected behavior

I saw waf was deprecated and now I should use meson, but this fail

Log file

meson-log.txt output.txt

qmega commented 1 year ago

Pretty sure I've seen this when trying to do a meson build with waf artifacts left over in the same build dir and there's some sort of conflict/confusion. Try rm -rf build and do the meson stuff fresh.

razvaneduard commented 1 year ago

I always tried meson build in a fresh directory. In the last 1 week I think I tried 15-20 times, every time in a fresh directory, hopping it's a temp issue with either build scripts or mpv code (but in this case waf build should also fail)

git clone https://github.com/mpv-player/mpv-build.git mpv-build
cd mpv-build
printf "%s\n" --enable-libx264    >> ffmpeg_options
printf "%s\n" --enable-libx265    >> ffmpeg_options
printf "%s\n" --enable-libmp3lame >> ffmpeg_options
printf "%s\n" --enable-libfdk-aac >> ffmpeg_options
printf "%s\n" --enable-nonfree    >> ffmpeg_options
printf "%s\n" --enable-libvorbis  >> ffmpeg_options
printf "%s\n" --enable-libvpx     >> ffmpeg_options
printf "%s\n" --enable-libopus    >> ffmpeg_options
printf "%s\n" --enable-libtheora  >> ffmpeg_options
printf "%s\n" --enable-libpulse  >> ffmpeg_options
printf "%s\n" --enable-gnutls  >> ffmpeg_options
printf "%s\n" --enable-libcaca  >> ffmpeg_options

printf "%s\n" -Dprefer_static=true  >> mpv_options
printf "%s\n" -Dx11=enabled  >> mpv_options
printf "%s\n" -Dwayland=disabled  >> mpv_options

./rebuild -j12
Dudemanguy commented 1 year ago

You shouldn't need prefer-static. That was my dumb mistake in mpv-build and it's not enabled anymore in the latest commit.

razvaneduard commented 1 year ago

without -Dprefer_static=true the build complete.

So I shouldn't use prefer-static, right?

Dudemanguy commented 1 year ago

Right, you don't need it unless you really want to statically link absolutely everything possible (which is not the point of mpv-build).

razvaneduard commented 1 year ago

thank you for the help