[Buildroot] [External] - Re: [PATCH 2/2] package/busybox: redirect errors to /dev/null

Vincent Fazio vfazio at xes-inc.com
Wed Nov 2 12:43:46 UTC 2022


Hey Tom,


> -----Original Message-----
> From: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
> Sent: Tuesday, November 1, 2022 5:42 PM
> To: Vincent Fazio <vfazio at xes-inc.com>
> Cc: buildroot at buildroot.org
> Subject: [External] - Re: [Buildroot] [PATCH 2/2] package/busybox: redirect
> errors to /dev/null
> 
> Hello Vincent,
> 
> On Fri,  7 Oct 2022 18:50:02 -0500
> Vincent Fazio <vfazio at xes-inc.com> wrote:
> 
> > When busybox.mk gets read, pkg-conf gets executed to determine the
> > location of relevant libraries.
> >
> > When Busybox is built with per-package directories enabled, a number of
> > errors related to executing pkg-conf occur because directories have not
> > been synced to provide pkg-confg at the point when it executes.
> 
> I don't get this. If pkg-config is executed before the per-package
> directories are created... then how can pkg-config find libtirpc?
> 

pkg-config gets executed multiple times because the commands that get built up to generate the config file looks like so:

(yes "" | PATH="/mnt/development/buildroot/output/per-package/busybox/host/bin:/mnt/development/buildroot/output/per-package/busybox/host/sbin:/home/vfazio/.pyenv/plugins/pyenv-virtualenv/shims:/home/vfazio/.pyenv/shims:/home/vfazio/.pyenv/bin:/home/vfazio/.local/bin:/home/vfazio/.asdf/shims:/home/vfazio/.asdf/bin:/home/vfazio/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/vfazio/.xes-python-apps/bin" CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os -g0 -D_FORTIFY_SOURCE=1 "`/mnt/development/buildroot/output/per-package/busybox/host/bin/pkg-config --cflags libtirpc`"" CFLAGS_busybox="`/mnt/development/buildroot/output/per-package/busybox/host/bin/pkg-config --libs libtirpc`"" /usr/bin/remake -j7 -C /mnt/development/buildroot/output/build/busybox-1.35.0 HOSTCC="/usr/bin/gcc" AR="/mnt/development/buildroot/output/per-package/busybox/host/bin/x86_64-linux-gcc-ar" NM="/mnt/development/buildroot/output/per-package/busybox/host/bin/x86_64-linux-gcc-nm" RANLIB="/mnt/development/buildroot/output/per-package/busybox/host/bin/x86_64-linux-gcc-ranlib" CC="/mnt/development/buildroot/output/per-package/busybox/host/bin/x86_64-linux-gcc" ARCH=x86_64 PREFIX="/mnt/development/buildroot/output/per-package/busybox/target" EXTRA_LDFLAGS="" CROSS_COMPILE="/mnt/development/buildroot/output/per-package/busybox/host/bin/x86_64-linux-" CONFIG_PREFIX="/mnt/development/buildroot/output/per-package/busybox/target" SKIP_STRIP=y oldconfig)

so they get executed prior to the directories being synced.

It works subsequently after sync because those paths are always reevaluated at runtime.

> I just did a build of the following configuration:
> 
> BR2_arm=y
> BR2_cortex_a9=y
> BR2_ARM_ENABLE_VFP=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> BR2_PER_PACKAGE_DIRECTORIES=y
> BR2_INIT_NONE=y
> BR2_SYSTEM_BIN_SH_NONE=y
> BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
> BR2_PACKAGE_LIBTIRPC=y
> # BR2_TARGET_ROOTFS_TAR is not set
> 
> and I couldn't see the errors (but perhaps I missed them). Could you
> provide an example configuration, the details of the error, and a
> rationale as to why not finding libtirpc is not a problem when we in
> fact expect to find it?

My configure and build log:

https://pastebin.com/w8WAGE53

for the pkg-config issues you should see:

/bin/bash: /mnt/development/buildroot/output/per-package/busybox/host/bin/pkg-config: No such file or directory
/bin/bash: /mnt/development/buildroot/output/per-package/busybox/host/bin/pkg-config: No such file or directory
/bin/bash: /mnt/development/buildroot/output/per-package/busybox/host/bin/pkg-config: No such file or directory
/bin/bash: /mnt/development/buildroot/output/per-package/busybox/host/bin/pkg-config: No such file or directory

You'll also see other errors such as:

/mnt/development/buildroot/output/build/busybox-1.35.0/scripts/gcc-version.sh: line 11: /mnt/development/buildroot/output/per-package/busybox/host/bin/x86_64-linux-gcc: No such file or directory
make[2]: /mnt/development/buildroot/output/per-package/busybox/host/bin/x86_64-linux-gcc: Command not found

but those are covered by the previous patch

> 
> Thanks!
> 
> Thomas
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com
> CAUTION: This email originated from outside of the organization. Do not click
> links or open attachments unless you recognize the sender and know the
> content is safe.

- Vincent



More information about the buildroot mailing list