Bug #5894
build failure with pngquant
0%
Description
Hitting a build failure as soon as I add --enable-pngquant option.
Cross-compiling on synology NAS using spksrc repository.
pngquant is available properly linked to shared libimagequant (also tried using static with no change).
Here is the end of the build output:CC src/descrambler/dvbcam.o
CC src/input/mpegts/linuxdvb/linuxdvb_ddci.o
CC src/descrambler/algo/libaesdec.o
CC src/descrambler/algo/libaes128dec.o
CC src/descrambler/algo/libdesdec.o
MKBUNDLE bundle.c
Traceback (most recent call last):
File "/home/spksrc/git-ffmpeg-next/spksrc/spk/tvheadend/work-apollolake-6.1/tvheadend-git221c29b40b1e53ae09a69d9458442dd4fea665f5/support/mkbundle", line 201, in <module>
idx = add_entry(ents)
File "/home/spksrc/git-ffmpeg-next/spksrc/spk/tvheadend/work-apollolake-6.1/tvheadend-git221c29b40b1e53ae09a69d9458442dd4fea665f5/support/mkbundle", line 180, in add_entry
tmp = add_entry(ents[k], d, k, idx, p)
File "/home/spksrc/git-ffmpeg-next/spksrc/spk/tvheadend/work-apollolake-6.1/tvheadend-git221c29b40b1e53ae09a69d9458442dd4fea665f5/support/mkbundle", line 180, in add_entry
tmp = add_entry(ents[k], d, k, idx, p)
File "/home/spksrc/git-ffmpeg-next/spksrc/spk/tvheadend/work-apollolake-6.1/tvheadend-git221c29b40b1e53ae09a69d9458442dd4fea665f5/support/mkbundle", line 180, in add_entry
tmp = add_entry(ents[k], d, k, idx, p)
File "/home/spksrc/git-ffmpeg-next/spksrc/spk/tvheadend/work-apollolake-6.1/tvheadend-git221c29b40b1e53ae09a69d9458442dd4fea665f5/support/mkbundle", line 180, in add_entry
tmp = add_entry(ents[k], d, k, idx, p)
File "/home/spksrc/git-ffmpeg-next/spksrc/spk/tvheadend/work-apollolake-6.1/tvheadend-git221c29b40b1e53ae09a69d9458442dd4fea665f5/support/mkbundle", line 174, in add_entry
output_file(d, k, idx+1, p)
File "/home/spksrc/git-ffmpeg-next/spksrc/spk/tvheadend/work-apollolake-6.1/tvheadend-git221c29b40b1e53ae09a69d9458442dd4fea665f5/support/mkbundle", line 92, in output_file
stdin=fd, stdout=fd, stderr=fd)
File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Makefile:834: recipe for target '/home/spksrc/git-ffmpeg-next/spksrc/spk/tvheadend/work-apollolake-6.1/tvheadend-git221c29b40b1e53ae09a69d9458442dd4fea665f5/build.linux/bundle.c' failed
make[3]: *** [/home/spksrc/git-ffmpeg-next/spksrc/spk/tvheadend/work-apollolake-6.1/tvheadend-git221c29b40b1e53ae09a69d9458442dd4fea665f5/build.linux/bundle.c] Error 1
make[3]: Leaving directory '/home/spksrc/git-ffmpeg-next/spksrc/spk/tvheadend/work-apollolake-6.1/tvheadend-git221c29b40b1e53ae09a69d9458442dd4fea665f5'
../../mk/spksrc.compile.mk:36: recipe for target 'compile_target' failed
make[2]: *** [compile_target] Error 2
make[2]: Leaving directory '/home/spksrc/git-ffmpeg-next/spksrc/cross/tvheadend'
../../mk/spksrc.depend.mk:44: recipe for target 'depend_target' failed
make[1]: *** [depend_target] Error 2
make[1]: Leaving directory '/home/spksrc/git-ffmpeg-next/spksrc/spk/tvheadend'
../../mk/spksrc.spk.mk:463: recipe for target 'arch-apollolake' failed
make: [arch-apollolake] Error 2 (ignored)
History
Updated by Flole Systems over 4 years ago
Most likely not a tvheadend bug. Try with latest master from tvheadend repo and see if the issue is still there. This sounds like a build system issue to me.
Updated by th0ma7 ^ over 4 years ago
- https://github.com/tvheadend/tvheadend
With last commit 221c29b on 23 Nov 2019
Is there another tree elsewhere?
This really looks like a build issue within tvheadend and not with spksrc build system.
It can be reproduced easily by pulling my spksrc clone at https://github.com/th0ma7/spksrc
just do a "make setup" then change to spk/tvheadend directory and invoke "make arch-apollolake" and be really patient
Otherwise I can provide a full or partial build output as needed.
Updated by Flole Systems over 4 years ago
Reproduce it by using only tvheadend master and not some other third party stuff. Only if that is possible it's a tvheadend issue, otherwise it isn't.
Updated by th0ma7 ^ over 4 years ago
I was able to fix the issue (while not entirely sure where the root-cause was)
Adding a native/python environment for cross-compiling instead of default allowed MKBUNDLE to complete with the addition of pngquant on new builds for all SynoCommunity supported platforms. I would guess default python which dates way too much might be the reason while it was failing (hopefully upcoming DSM7 will solve that). The native/python uses a newer version which seems to solve the issue.
Updated packages will ultimately be made availble through default SynoCommunity channels: In the meantime experimental builds are available in my local repositoryThnx for your time, issue solved.
Updated by th0ma7 ^ over 4 years ago
Comming back on this one.
I think I've actually I've finally nailed it: tvheadend does not fully "honor" the cross-compile environment for pngquant.
Explanation: I got this error only on system where the pngquant package is not installed system-wide. Although it is being compiled and provided in full within the cross-compile environment provided to tvheadend.
Updated by th0ma7 ^ over 4 years ago
I believe the error is within support/mkbundle:# PNGquant
pngquant_bin = '/usr/bin/pngquant'
if opts.pngquant:
import distutils.spawn
import subprocess
import time
distutils.spawn.find_executable('pngquant')
On Synology NAS the resulting package will also include all its dependencies. As such the pngquant binary will not be located anywhere close to /usr/bin/. Also when building all dependencies (and tvheadend as well) they get to be installed into a target directory which is not taken into account in here in the find_executable call. Perhaps if the PATH environment was adjusted accordingly to reflect the expected target bin directory where pngquant resides?
Updated by th0ma7 ^ over 4 years ago
Here is my local workaround that solves the build issue for me:
https://github.com/SynoCommunity/spksrc/pull/3998/commits/aa5c4c180670dd15681ff6b2b34292ec942f7c3e
I'm actually wondering why is it even trying to find the pngquant path as once "installed" the path in question may have varied depending upon the $PATH value.
Updated by th0ma7 ^ over 4 years ago
Here are my findings:
It cannot be enabled when cross-compiling unless using a native platform (i.e. cross-compiling apollolake on x64 use case). The support/mkbundle
script does a call to the binary to validate proper functionality and as such cannot work on non-native platform where it is being compiled onto.
The only way to circumvent this is to have pngquant package also installed on the cross-building image so mkbuild does not exit with an error when invoking a call to the binary hence "faking" functionality.
So all in all, cross-compiling tvheadend with pngquant does not work.