All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2 1/2] busybox: always start do_compile with orig config files
       [not found] <20230109090339.120569-1-antoningodard@pm.me>
@ 2023-01-09 14:22 ` Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2023-01-09 14:22 UTC (permalink / raw)
  To: Antonin Godard, openembedded-core

On Mon, 2023-01-09 at 09:04 +0000, Antonin Godard wrote:
> When compiling busybox a second time (e.g. with `compile -f`), busybox
> can use an altered autoconf.h file for compiling, which can ultimately
> produces different and unwanted binaries.
> 
> This can produce errors like this one:
> 
> ERROR: busybox-1.35.0-r0 do_package: Error executing a python function in exec_func_python() autogenerated:
> The stack trace of python calls that resulted in this exception/failure was:
> File: 'exec_func_python() autogenerated', lineno: 2, function: <module>
>      0001:
>  *** 0002:ptest_update_alternatives(d)
>      0003:
> File: '…/poky/meta/classes/ptest.bbclass', lineno: 100, function: ptest_update_alternatives
>      0096:        for alt_name, alt_link, alt_target, _ in alternatives:
>      0097:            # Some alternatives are for man pages,
>      0098:            # check if the alternative is in PATH
>      0099:            if os.path.dirname(alt_link) in bin_paths:
>  *** 0100:                os.symlink(alt_target, os.path.join(ptest_bindir, alt_name))
>      0101:}
>      0102:
>      0103:do_configure_ptest_base[dirs] = "${B}"
>      0104:do_compile_ptest_base[dirs] = "${B}"
> Exception: FileExistsError: [Errno 17] File exists: '/bin/busybox.suid' -> '…/busybox/1.35.0-r0/package/usr/lib/busybox/ptest/bin/login'
> 
> This happens because ALTERNATIVE:busybox contains `/bin/login` twice,
> initially that's because `/bin/login` is present in both
> busybox.links.suid and busybox.links.nosuid. The reason for that is
> because of the altered autoconf.h.
> 
> Steps to reproduce above error:
> 
> <add ptest to distro configs>
> bitbake busybox -c clean
> bitbake busybox -c package -f
> bitbake busybox -c compile -f
> bitbake busybox -c package -f
> 
> This patch guards against potential bugs by:
> 
> - making a backup of .config and autoconf.h that have matching
>   timestamps.
> - make sure do_compile always starts with these files.
> - restore .config and autoconf.h at the end of do_compile.

Thanks for tweaking these, I think that should fix a few more possible
race issues. They passed testing and have merged.

Cheers,

Richard



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-09 14:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20230109090339.120569-1-antoningodard@pm.me>
2023-01-09 14:22 ` [PATCH v2 1/2] busybox: always start do_compile with orig config files Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.