crossdirect: can't handle LD_PRELOAD: libfakeroot.so -- meson cannot generate gtkdoc in cross-compilation environment
First of all, I bumped into this issue while compiling feedbackd, which is currently not part of pmaports. However, as that is a package related to postmarketOS, I decided to still submit this issue.
I am trying some development for feedbackd. To use pmbootstrap for compiling, I have copied the relevant community/feedbackd
folder from aport to temp/feedbackd
in my pmbootstrap config aports
folder. In addition, there seems to be some issues running libfeedback
tests in the chroot. Therefore, to reprocude this issue it necessary to comment the libfeedback
parts of the test/meson.build
file.
So finally the actual error. Building feedbackd failed when running pmbootstrap build --arch aarch64 --src feedbackd feedbackd
. The error printed
ERROR: crossdirect: can't handle LD_PRELOAD: libfakeroot.so
Please report this at: https://gitlab.com/postmarketOS/pmaports/issues
As a workaround, you can compile without crossdirect.
Therefore, I run the build with QEMU, which succeeded: pmbootstrap --no-cross build --arch aarch64 --src feedbackd feedbackd
The relevant part of the log:
Full log written to /tmp/pmbootstrap-local-source-copy/output/meson-logs/testlog.txt
>>> feedbackd: Entering fakeroot...
]0;abuild: feedbackdInstalling data/lfb-gdbus.h to /home/pmos/build/pkg/feedbackd/usr/include/libfeedback-0.0
Installing libfeedback/lfb-enums.h to /home/pmos/build/pkg/feedbackd/usr/include/libfeedback-0.0
Installing libfeedback/libfeedback-0.0.so.0 to /home/pmos/build/pkg/feedbackd/usr/lib
Installing libfeedback/Lfb-0.0.gir to /home/pmos/build/pkg/feedbackd/usr/share/gir-1.0
Installing libfeedback/Lfb-0.0.typelib to /home/pmos/build/pkg/feedbackd/usr/lib/girepository-1.0
Installing libfeedback/libfeedback-0.0.vapi to /home/pmos/build/pkg/feedbackd/usr/share/vala/vapi
Installing src/feedbackd to /home/pmos/build/pkg/feedbackd/usr/libexec
Installing src/fbd-ledctrl to /home/pmos/build/pkg/feedbackd/usr/libexec
Installing cli/fbcli to /home/pmos/build/pkg/feedbackd/usr/bin
Installing /tmp/pmbootstrap-local-source-copy/libfeedback/libfeedback.h to /home/pmos/build/pkg/feedbackd/usr/include/libfeedback-0.0
Installing /tmp/pmbootstrap-local-source-copy/libfeedback/lfb-event.h to /home/pmos/build/pkg/feedbackd/usr/include/libfeedback-0.0
Installing /tmp/pmbootstrap-local-source-copy/data/org.sigxcpu.Feedback.xml to /home/pmos/build/pkg/feedbackd/usr/share/dbus-1/interfaces
Installing /tmp/pmbootstrap-local-source-copy/data/org.sigxcpu.feedbackd.gschema.xml to /home/pmos/build/pkg/feedbackd/usr/share/glib-2.0/schemas
Installing /tmp/pmbootstrap-local-source-copy/output/data/org.sigxcpu.Feedback.service to /home/pmos/build/pkg/feedbackd/usr/share/dbus-1/services
Installing /tmp/pmbootstrap-local-source-copy/data/default.json to /home/pmos/build/pkg/feedbackd/usr/share/feedbackd/themes
Installing /tmp/pmbootstrap-local-source-copy/output/meson-private/libfeedback-0.0.pc to /home/pmos/build/pkg/feedbackd/usr/lib/pkgconfig
Installing /tmp/pmbootstrap-local-source-copy/output/meson-private/libfeedback-0.0.deps to /home/pmos/build/pkg/feedbackd/usr/share/vala/vapi
Running custom install script '/usr/bin/python3 /tmp/pmbootstrap-local-source-copy/build-aux/post_install.py /usr/share'
Running custom install script '/usr/bin/meson --internal gtkdoc --sourcedir=/tmp/pmbootstrap-local-source-copy --builddir=/tmp/pmbootstrap-local-source-copy/output --subdir=doc --headerdirs=/tmp/pmbootstrap-local-source-copy/libfeedback@@/tmp/pmbootstrap-local-source-copy/output/libfeedback@@/tmp/pmbootstrap-local-source-copy/output/data --mainfile=libfeedback-docs.xml --modulename=libfeedback --moduleversion= --mode=auto --gtkdoc-scan=/usr/bin/gtkdoc-scan --gtkdoc-scangobj=/usr/bin/gtkdoc-scangobj --gtkdoc-mkdb=/usr/bin/gtkdoc-mkdb --gtkdoc-mkhtml=/usr/bin/gtkdoc-mkhtml --gtkdoc-fixxref=/usr/bin/gtkdoc-fixxref --scanargs=--rebuild-types@@--ignore-headers= --gobjects-types-file=/tmp/pmbootstrap-local-source-copy/doc/libfeedback.types --fixxrefargs=--html-dir=share/gtk-doc/html@@--extra-dir=/usr/share/gtk-doc/html/glib@@--extra-dir=/usr/share/gtk-doc/html/gobject@@--extra-dir=/usr/share/gtk-doc/html/gio@@--extra-dir=/usr/share/gtk-doc/html/gi --content-files=/tmp/pmbootstrap-local-source-copy/doc/overview.xml --installdir=libfeedback --cc=gcc --ld=gcc --cflags=-I@BUILD_ROOT@/libfeedback/. -I@SOURCE_ROOT@/libfeedback/. -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -Os -fomit-frame-pointer -Os -fomit-frame-pointer \'-DFEEDBACKD_THEME_DIR="/usr/share/feedbackd/themes"\' -DLIBFEEDBACK_COMPILATION -Wcast-align -Wdate-time -Werror=format-security -Werror=format=2 -Wendif-labels -Werror=incompatible-pointer-types -Werror=missing-declarations -Werror=overflow -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=implicit-fallthrough=3 -Wformat-nonliteral -Wformat-security -Winit-self -Wmaybe-uninitialized -Wmissing-field-initializers -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wno-missing-field-initializers -Wno-sign-compare -Wno-strict-aliasing -Wno-unused-parameter -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wtype-limits -Wundef -Wunused-function --ldflags=-L/tmp/pmbootstrap-local-source-copy/output/libfeedback -Wl,-rpath,/tmp/pmbootstrap-local-source-copy/output/libfeedback -lfeedback-0.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl -Wl,--as-needed,-O1,--sort-common -Os -fomit-frame-pointer -Os -fomit-frame-pointer'
--- stdout ---
Building documentation for libfeedback
ERROR: Error in gtkdoc helper script:
ERROR: ['/usr/bin/gtkdoc-scangobj', '--types=/tmp/pmbootstrap-local-source-copy/output/doc/libfeedback.types', '--module=libfeedback', '--run=', '--cflags=-I@BUILD_ROOT@/libfeedback/. -I@SOURCE_ROOT@/libfeedback/. -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -Os -fomit-frame-pointer -Os -fomit-frame-pointer \'-DFEEDBACKD_THEME_DIR="/usr/share/feedbackd/themes"\' -DLIBFEEDBACK_COMPILATION -Wcast-align -Wdate-time -Werror=format-security -Werror=format=2 -Wendif-labels -Werror=incompatible-pointer-types -Werror=missing-declarations -Werror=overflow -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=implicit-fallthrough=3 -Wformat-nonliteral -Wformat-security -Winit-self -Wmaybe-uninitialized -Wmissing-field-initializers -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wno-missing-field-initializers -Wno-sign-compare -Wno-strict-aliasing -Wno-unused-parameter -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wtype-limits -Wundef -Wunused-function', '--ldflags=-L/tmp/pmbootstrap-local-source-copy/output/libfeedback -Wl,-rpath,/tmp/pmbootstrap-local-source-copy/output/libfeedback -lfeedback-0.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl -Wl,--as-needed,-O1,--sort-common -Os -fomit-frame-pointer -Os -fomit-frame-pointer', '--cc=gcc', '--ld=gcc', '--output-dir=/tmp/pmbootstrap-local-source-copy/output/doc'] failed with status 1
ERROR: crossdirect: can't handle LD_PRELOAD: libfakeroot.so
Please report this at: https://gitlab.com/postmarketOS/pmaports/issues
As a workaround, you can compile without crossdirect.
See 'pmbootstrap -h' for related options.
2021-05-16 21:37:42,702:scangobj.py:execute_command:1289:WARNING:Compiling scanner failed: 1, command: gcc -I@BUILD_ROOT@/libfeedback/. -I@SOURCE_ROOT@/libfeedback/. -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -Os -fomit-frame-pointer -Os -fomit-frame-pointer -DFEEDBACKD_THEME_DIR="/usr/share/feedbackd/themes" -DLIBFEEDBACK_COMPILATION -Wcast-align -Wdate-time -Werror=format-security -Werror=format=2 -Wendif-labels -Werror=incompatible-pointer-types -Werror=missing-declarations -Werror=overflow -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=implicit-fallthrough=3 -Wformat-nonliteral -Wformat-security -Winit-self -Wmaybe-uninitialized -Wmissing-field-initializers -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wno-missing-field-initializers -Wno-sign-compare -Wno-strict-aliasing -Wno-unused-parameter -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wtype-limits -Wundef -Wunused-function -c -o libfeedback-scan.o libfeedback-scan.c
--- stderr ---
FAILED: install script '/usr/bin/meson --internal gtkdoc --sourcedir=/tmp/pmbootstrap-local-source-copy --builddir=/tmp/pmbootstrap-local-source-copy/output --subdir=doc --headerdirs=/tmp/pmbootstrap-local-source-copy/libfeedback@@/tmp/pmbootstrap-local-source-copy/output/libfeedback@@/tmp/pmbootstrap-local-source-copy/output/data --mainfile=libfeedback-docs.xml --modulename=libfeedback --moduleversion= --mode=auto --gtkdoc-scan=/usr/bin/gtkdoc-scan --gtkdoc-scangobj=/usr/bin/gtkdoc-scangobj --gtkdoc-mkdb=/usr/bin/gtkdoc-mkdb --gtkdoc-mkhtml=/usr/bin/gtkdoc-mkhtml --gtkdoc-fixxref=/usr/bin/gtkdoc-fixxref --scanargs=--rebuild-types@@--ignore-headers= --gobjects-types-file=/tmp/pmbootstrap-local-source-copy/doc/libfeedback.types --fixxrefargs=--html-dir=share/gtk-doc/html@@--extra-dir=/usr/share/gtk-doc/html/glib@@--extra-dir=/usr/share/gtk-doc/html/gobject@@--extra-dir=/usr/share/gtk-doc/html/gio@@--extra-dir=/usr/share/gtk-doc/html/gi --content-files=/tmp/pmbootstrap-local-source-copy/doc/overview.xml --installdir=libfeedback --cc=gcc --ld=gcc --cflags=-I@BUILD_ROOT@/libfeedback/. -I@SOURCE_ROOT@/libfeedback/. -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -Os -fomit-frame-pointer -Os -fomit-frame-pointer '-DFEEDBACKD_THEME_DIR="/usr/share/feedbackd/themes"' -DLIBFEEDBACK_COMPILATION -Wcast-align -Wdate-time -Werror=format-security -Werror=format=2 -Wendif-labels -Werror=incompatible-pointer-types -Werror=missing-declarations -Werror=overflow -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=implicit-fallthrough=3 -Wformat-nonliteral -Wformat-security -Winit-self -Wmaybe-uninitialized -Wmissing-field-initializers -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wno-missing-field-initializers -Wno-sign-compare -Wno-strict-aliasing -Wno-unused-parameter -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wtype-limits -Wundef -Wunused-function --ldflags=-L/tmp/pmbootstrap-local-source-copy/output/libfeedback -Wl,-rpath,/tmp/pmbootstrap-local-source-copy/output/libfeedback -lfeedback-0.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl -Wl,--as-needed,-O1,--sort-common -Os -fomit-frame-pointer -Os -fomit-frame-pointer' exit code 1, stopped
>>> ERROR: feedbackd*: package failed
]0;>>> ERROR: feedbackd: rootpkg failed
]0;(011691) [23:37:43] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(011691) [23:37:43] NOTE: The failed command's output is above the ^^^ line in the log file: /home/pablo/VM/pmbootstrap/log.txt
(011691) [23:37:43] ERROR: Command failed: (buildroot_aarch64) % cd /home/pmos/build; busybox su pmos -c CARCH=aarch64 SUDO_APK='abuild-apk --no-progress' PATH=/native/usr/lib/crossdirect/aarch64:/usr/lib/ccache/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOME=/home/pmos abuild -D postmarketOS -d -f
(011691) [23:37:43] See also: <https://postmarketos.org/troubleshooting>
(011691) [23:37:43] Traceback (most recent call last):
File "/home/pablo/.local/lib/python3.6/site-packages/pmb/__init__.py", line 49, in main
getattr(frontend, args.action)(args)
File "/home/pablo/.local/lib/python3.6/site-packages/pmb/helpers/frontend.py", line 116, in build
args.strict, src=src):
File "/home/pablo/.local/lib/python3.6/site-packages/pmb/build/_package.py", line 507, in package
suffix, src)
File "/home/pablo/.local/lib/python3.6/site-packages/pmb/build/_package.py", line 436, in run_abuild
pmb.chroot.user(args, cmd, suffix, "/home/pmos/build", env=env)
File "/home/pablo/.local/lib/python3.6/site-packages/pmb/chroot/user.py", line 27, in user
output_return, check, {}, auto_init)
File "/home/pablo/.local/lib/python3.6/site-packages/pmb/chroot/root.py", line 78, in root
disable_timeout)
File "/home/pablo/.local/lib/python3.6/site-packages/pmb/helpers/run_core.py", line 342, in core
check_return_code(args, code, log_message)
File "/home/pablo/.local/lib/python3.6/site-packages/pmb/helpers/run_core.py", line 218, in check_return_code
raise RuntimeError("Command failed: " + log_message)
RuntimeError: Command failed: (buildroot_aarch64) % cd /home/pmos/build; busybox su pmos -c CARCH=aarch64 SUDO_APK='abuild-apk --no-progress' PATH=/native/usr/lib/crossdirect/aarch64:/usr/lib/ccache/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOME=/home/pmos abuild -D postmarketOS -d -f