hey!

On Thu, Jul 15, 2021 at 3:56 PM Richard Purdie <
[email protected]> wrote:

> Breaking things down a bit, one thing I keep running into with our current
> codebase and metadata is that overrides are not clear. In my previous
> email,
> the example was:
>
> do_configure_class-native
>
> A human can usually spot "class-native" is and "configure" or
> "configure_class-native" is not. Bitbake's parser struggles. It has huge
> internal lists including variables like x86_64 where it has to track
> whether "64" in an override.
>
> One way of fixing this is to be explicit about overrides and use a
> different
> separator. See an example patch below I made to the quilt recipe using ":"
> instead to see how it looks. Personally, I think this looks like an
> improvement.
>
> There are two challenges:
>
> a) The work of migration. Do we migrate piecemeal or with a flag day? I'm
> not
>    sure piecemeal is even possible unfortunately.
>
> b) Some of the packaging code (at the very least) needs rewriting as it
> accesses
>    both RDEPENDS_${PN} and puts ${PN} in OVERRIDES and accesses RDEPENDS.
> I'm not
>    sure what else may be assuming this works.
>

Ouch.. I never realized that! I like Mark's suggestion to convert that to
variables. RDEPENDS is typically used in users' layers, so that  way they
wouldn't be impacted by an override syntax change.


> This change does buy us cleaner looking metadata and ultimately, a faster
> and cleaner internal bitbake that at least would use less memory. It could
> set
> the stage to allow the defval idea I mentioned in a previous mail to
> happen.
>
> It is a huge change and would need a lot of work to make it happen. Is it
> worth
> doing? Not sure. I'm putting it out there for discussion.
>

There is no doubt that the change is a good change and the project would
benefit from it. However I think we must worry about our users, and even
look beyond the layer maintainers that we know (e.g. the one on this list).
There are *way* more layer maintainers that we don't know about in all the
many companies who are successfully using YP to build their products. I am
not worried about all the main layers at all, since we know all their
maintainers, and we know they will understand why we make this change, and
will make the effort to support it. But I am very worried about the
hundreds (thousands??) of layer maintainers in all the companies using
Yocto.

So if we do anything, I would really prefer if we find a way to do it in a
good way *for them* , not *for us*. which means finding a way to support a
soft transition. And of course we need to align this change with our LTS
release cycle. So perhaps we can figure out how to support both syntaxes
for some time (from one LTS to the next?), even if supporting both is
impacting the performance. Or we can have a layer flag that indicates if it
uses the old or the new syntax?


> It is also going to be tempting that "if we're breaking things, lets break
> lots".
> I want to be mindful that tempting as that may be, if users can't convert
> clearly,
> it will be worlds of pain. The benefit of this change is that at least in
> the
> general case, the transition should be clear. Taking steps rather than
> changing the
> world may therefore be a better idea...
>
> Cheers,
>
> Richard
>
>
> diff --git a/meta/recipes-devtools/quilt/quilt.inc
> b/meta/recipes-devtools/quilt/quilt.inc
> index d7ecda7aaa6..f85de384d26 100644
> --- a/meta/recipes-devtools/quilt/quilt.inc
> +++ b/meta/recipes-devtools/quilt/quilt.inc
> @@ -14,36 +14,36 @@ SRC_URI =
> "${SAVANNAH_GNU_MIRROR}/quilt/quilt-${PV}.tar.gz \
>          file://0001-tests-Allow-different-output-from-mv.patch \
>  "
>
> -SRC_URI_append_class-target = " file://gnu_patch_test_fix_target.patch"
> +SRC_URI:append:class-target = " file://gnu_patch_test_fix_target.patch"
>
>  SRC_URI[md5sum] = "6800c2404a2c0598ab2eff92a636ba70"
>  SRC_URI[sha256sum] =
> "314b319a6feb13bf9d0f9ffa7ce6683b06919e734a41275087ea457cc9dc6e07"
>
>  inherit autotools-brokensep ptest
>
> -INHIBIT_AUTOTOOLS_DEPS_class-native = "1"
> -PATCHTOOL_class-native = "patch"
> +INHIBIT_AUTOTOOLS_DEPS:class-native = "1"
> +PATCHTOOL:class-native = "patch"
>
>  CLEANBROKEN = "1"
>
>  EXTRA_OECONF = "--with-perl='${USRBINPATH}/env perl' --with-patch=patch"
> -EXTRA_OECONF_append_class-native = " --disable-nls"
> +EXTRA_OECONF:append:class-native = " --disable-nls"
>  EXTRA_AUTORECONF += "--exclude=aclocal"
>
>  CACHED_CONFIGUREVARS += "ac_cv_path_BASH=/bin/bash
> ac_cv_path_COLUMN=column"
>
>  # Make sure we don't have "-w" in shebang lines: it breaks using
>  # "/usr/bin/env perl" as parser
> -do_configure_prepend () {
> +do_configure:prepend () {
>         find ${S} -name "*.in" -exec sed -i -e "1s,^#\!.*@PERL@ -w$,#\!
> @PERL@\nuse warnings;," {} \;
>  }
>
>  # Don't setup symlinks to host utilities, we don't need them
> -do_configure_append () {
> +do_configure:append () {
>         sed -e 's,^COMPAT_SYMLINKS.*:=.*,COMPAT_SYMLINKS        :=,' -i
> ${S}/Makefile
>  }
>
> -do_configure_class-native () {
> +do_configure:class-native () {
>      oe_runconf
>  }
>
> @@ -54,7 +54,7 @@ do_install () {
>         rm -rf ${D}/${datadir}/emacs
>  }
>
> -do_install_append_class-native () {
> +do_install:append:class-native () {
>      # Dummy quiltrc file for patch.bbclass
>      install -d ${D}${sysconfdir}/
>      touch ${D}${sysconfdir}/quiltrc
> @@ -75,16 +75,16 @@ do_install_ptest() {
>
>  PACKAGES += "guards guards-doc"
>
> -FILES_${PN} = "${sysconfdir} ${datadir}/quilt \
> +FILES:${PN} = "${sysconfdir} ${datadir}/quilt \
>                 ${bindir}/quilt ${libdir}/quilt"
> -FILES_guards = "${bindir}/guards"
> -FILES_${PN}-doc = "${mandir}/man1/quilt.1 ${docdir}/${BPN}"
> -FILES_guards-doc = "${mandir}/man1/guards.1"
> +FILES:guards = "${bindir}/guards"
> +FILES:${PN}-doc = "${mandir}/man1/quilt.1 ${docdir}/${BPN}"
> +FILES:guards-doc = "${mandir}/man1/guards.1"
>
> -RDEPENDS_${PN} = "bash patch diffstat bzip2 util-linux less"
> -RDEPENDS_${PN}_class-native = "diffstat-native patch-native bzip2-native"
> +RDEPENDS:${PN} = "bash patch diffstat bzip2 util-linux less"
> +RDEPENDS:${PN}:class-native = "diffstat-native patch-native bzip2-native"
>
> -RDEPENDS_${PN}-ptest = "make file sed gawk diffutils findutils ed perl \
> +RDEPENDS:${PN}-ptest = "make file sed gawk diffutils findutils ed perl \
>                          perl-module-filehandle perl-module-getopt-std \
>                          perl-module-posix perl-module-file-temp \
>                          perl-module-text-parsewords
> perl-module-overloading \
>
>
>
> 
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#1264): 
https://lists.openembedded.org/g/openembedded-architecture/message/1264
Mute This Topic: https://lists.openembedded.org/mt/84225642/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-architecture/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to