Hi, Le jeu. 14 sept. 2023 à 14:10, Sebert, Holger.ext < holger.sebert....@karlstorz.com> a écrit :
> Hi Zoran, > > I was able to reproduce the behavior described in my original post by > enabling CCache. Here are the precise steps to reproduce: > > 1. Checkout Poky/Mickledore > 2. Add the following to `build/conf/local.conf`: > INHERIT += "ccache" > 3. Run `bitbake -c menuconfig virtual/kernel` > > The reason for the failure is that due to CCache the compiler is no longer > `gcc` but `ccache gcc`, i.e. we have the following variables in the > environment: > > CC="ccache x86_64-poky-linux-gcc" > HOSTCC="ccache gcc" > ... > etc. > > This is when the wrong quoting in the invocation of `menuconfig` leads to > errors. > > Could you please verify/check? > I have reproduced this. It really looks like a bug! > [...] > On Mon, Aug 21, 2023 at 3:48 PM Sebert, Holger.ext > <holger.sebert....@karlstorz.com> wrote: > > > > Hi, > > > > I am using a Yocto-Poky-Mickledore (version 4.2.1) based system. > > > > For configuring the kernel, I would like to use the command > > > > bitbake -c menuconfig virtual/kernel > > > > If I do that, Bitbake opens an xterm window and runs the build steps > > for Kconfig. However, after the compiler has finised, the xterm window > > immediately closes and Bitbake exists as if nothing happened, i.e. it > > does not show any error message or similar. > > > > I investigated the problem and found out that, internally, Bitbake > > calls the following command for starting Kconfig: > > > > make menuconfig CC="ccache x86_64-system-linux-gcc ..." \ > > CFLAGS="..." HOSTCC="ccache gcc" HOSTCCFLAGS="..." > > > > The quotes, however, seem to get lost when starting the actual command > > in the terminal. This leads to a command line like follows: > > > > make menuconfig CC=ccache x86_64-system-linux-gcc ... \ > > CFLAGS=... HOSTCC="ccache gcc" HOSTCCFLAGS="... > > > > which is clearly wrong. > > > > The following patch fixes the problem in > meta/classes-recipe/cml1.bbclass: > > > > diff --git a/meta/classes-recipe/cml1.bbclass > b/meta/classes-recipe/cml1.bbclass > > index a09a042c3f..d6001d6fd0 100644 > > --- a/meta/classes-recipe/cml1.bbclass > > +++ b/meta/classes-recipe/cml1.bbclass > > @@ -53,7 +53,8 @@ python do_menuconfig() { > > # ensure that environment variables are overwritten with this tasks > 'd' values > > d.appendVar("OE_TERMINAL_EXPORTS", " PKG_CONFIG_DIR PKG_CONFIG_PATH > PKG_CONFIG_LIBDIR PKG_CONFIG_SYSROOT_DIR") > > > > - oe_terminal("sh -c \"make %s; if [ \\$? -ne 0 ]; then echo 'Command > failed.'; printf 'Press any key to continue... '; read r; fi\"" % > d.getVar('KCONFIG_CONFIG_COMMAND'), > > + make_cmd = "make %s" % > d.getVar('KCONFIG_CONFIG_COMMAND').replace('"', '\\"') > > + oe_terminal("sh -c \"%s; if [ \\$? -ne 0 ]; then echo 'Command > failed.'; printf 'Press any key to continue... '; read r; fi\"" % make_cmd, > > d.getVar('PN') + ' Configuration', d) > This patch looks interesting! I would use shlex.join() to safely construct the command : https://docs.python.org/3/library/shlex.html#shlex.join > > What do you think? Is my observed behavior a configuration error of my > > setup or does the patch above indeed make sense? > The patch makes sense to me. I guess your next steps are : * If you want to contribute your patch : reproduce the bug and rebase your patch on master and send it to the mailing list * Or, create a bug in https://bugzilla.yoctoproject.org/ Best Regards, -- Yoann Congal Smile ECS - Tech expert
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#61012): https://lists.yoctoproject.org/g/yocto/message/61012 Mute This Topic: https://lists.yoctoproject.org/mt/100872991/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-