You need to bitbake clean the perl directory, so that perl isn't patched
twice. There might be ways to fix this, but it's not really a pressing
issue.

Alex

On Thu, 17 Jun 2021 at 11:15, Yu, Mingli <mingli...@windriver.com> wrote:

> Hi Alex,
>
> After this change, there comes below failure such as below:
> $ bitbake perl-native
>
> Make a change as below
> $ git diff
> diff --git a/meta/recipes-devtools/perl-cross/perlcross_1.3.6.bb
> b/meta/recipes-devtools/perl-cross/perlcross_1.3.6.bb
> index b77bbd1fd4..4c5e35ab80 100644
> --- a/meta/recipes-devtools/perl-cross/perlcross_1.3.6.bb
> +++ b/meta/recipes-devtools/perl-cross/perlcross_1.3.6.bb
> @@ -33,6 +33,7 @@ do_compile () {
>   do_install_class-native() {
>       mkdir -p ${D}/${datadir}/perl-cross/
>       cp -rf ${S}/* ${D}/${datadir}/perl-cross/
> +    echo "test" > ${D}/${datadir}/perl-cross/testfile
>   }
>
> $ bitbake perl-native
> | NOTE: make -j 48
> | make crosspatch
> | make[1]: Entering directory
>
> '/buildarea1/myu2/wr_build/wr1021_20210616_perl/build/tmp-glibc/work/x86_64-linux/perl-native/5.34.0-r0/perl-5.34.0'
> | patch -p1 -i cnf/diffs/perl5-5.34.0/time-hires.patch && touch
> cnf/diffs/perl5-5.34.0/time-hires.applied
> | patch -p1 -i cnf/diffs/perl5-5.34.0/xconfig.patch && touch
> cnf/diffs/perl5-5.34.0/xconfig.applied
> | patch -p1 -i cnf/diffs/perl5-5.34.0/posix-makefile.patch && touch
> cnf/diffs/perl5-5.34.0/posix-makefile.applied
> | File dist/Time-HiRes/Makefile.PL is read-only; trying to patch anyway
> | patching file dist/Time-HiRes/Makefile.PL
> | Reversed (or previously applied) patch detected!  Assume -R? [n]
> | Apply anyway? [n]
> | Skipping patch.
> | 4 out of 4 hunks ignored -- saving rejects to file
> dist/Time-HiRes/Makefile.PL.rej
> | patch -p1 -i cnf/diffs/perl5-5.34.0/test-commonsense.patch && touch
> cnf/diffs/perl5-5.34.0/test-commonsense.applied
> | File perl.h is read-only; trying to patch anyway
> | patching file perl.h
> | Reversed (or previously applied) patch detected!  Assume -R? [n]
> | Apply anyway? [n]
> | Skipping patch.
> | 1 out of 1 hunk ignored -- saving rejects to file perl.h.rej
> | make[1]: *** [Makefile:64: cnf/diffs/perl5-5.34.0/time-hires.applied]
> Error 1
> [snip]
>
> Thanks,
>
> On 6/4/21 5:10 PM, Alexander Kanavin wrote:
> > [Please note: This e-mail is from an EXTERNAL e-mail address]
> >
> > As perl and perl-cross need to be updated (and patches rebased)
> > in lockstep, devtool upgrade (and therefore AUH) can't cope with it.
> > Manually updating is still possible, but painful.
> >
> > Split determinism.patch into perl and perl-cross parts, move the
> > rest of the perl-cross patches.
> >
> > Signed-off-by: Alexander Kanavin <alex.kana...@gmail.com>
> > ---
> >   meta/conf/distro/include/maintainers.inc      |  1 +
> >   ...h-do-not-hardcode-prefix-lib-as-libr.patch |  0
> >   ...h-do-not-quote-the-argument-to-comma.patch |  0
> >   ...oss-add-LDFLAGS-when-linking-libperl.patch |  0
> >   .../perl-cross/files/README.md                | 29 ++++++++++++
> >   .../perl-cross/files/determinism.patch        | 46 +++++++++++++++++++
> >   .../perl-cross/perlcross_1.3.5.bb             | 36 +++++++++++++++
> >   .../perl/files/determinism.patch              | 23 ----------
> >   meta/recipes-devtools/perl/perl_5.32.1.bb     | 17 ++-----
> >   9 files changed, 116 insertions(+), 36 deletions(-)
> >   rename meta/recipes-devtools/{perl =>
> perl-cross}/files/0001-configure_path.sh-do-not-hardcode-prefix-lib-as-libr.patch
> (100%)
> >   rename meta/recipes-devtools/{perl =>
> perl-cross}/files/0001-configure_tool.sh-do-not-quote-the-argument-to-comma.patch
> (100%)
> >   rename meta/recipes-devtools/{perl =>
> perl-cross}/files/0001-perl-cross-add-LDFLAGS-when-linking-libperl.patch
> (100%)
> >   create mode 100644 meta/recipes-devtools/perl-cross/files/README.md
> >   create mode 100644
> meta/recipes-devtools/perl-cross/files/determinism.patch
> >   create mode 100644 meta/recipes-devtools/perl-cross/perlcross_1.3.5.bb
> >
> > diff --git a/meta/conf/distro/include/maintainers.inc
> b/meta/conf/distro/include/maintainers.inc
> > index ee118209db..6024d57717 100644
> > --- a/meta/conf/distro/include/maintainers.inc
> > +++ b/meta/conf/distro/include/maintainers.inc
> > @@ -558,6 +558,7 @@ RECIPE_MAINTAINER_pn-pciutils = "Chen Qi <
> qi.c...@windriver.com>"
> >   RECIPE_MAINTAINER_pn-pcmanfm = "Alexander Kanavin <
> alex.kana...@gmail.com>"
> >   RECIPE_MAINTAINER_pn-perf = "Bruce Ashfield <bruce.ashfi...@gmail.com
> >"
> >   RECIPE_MAINTAINER_pn-perl = "Alexander Kanavin <alex.kana...@gmail.com
> >"
> > +RECIPE_MAINTAINER_pn-perl-cross = "Alexander Kanavin <
> alex.kana...@gmail.com>"
> >   RECIPE_MAINTAINER_pn-piglit = "Ross Burton <ross.bur...@arm.com>"
> >   RECIPE_MAINTAINER_pn-pigz = "Hongxu Jia <hongxu....@windriver.com>"
> >   RECIPE_MAINTAINER_pn-pinentry = "Armin Kuster <akuster...@gmail.com>"
> > diff --git
> a/meta/recipes-devtools/perl/files/0001-configure_path.sh-do-not-hardcode-prefix-lib-as-libr.patch
> b/meta/recipes-devtools/perl-cross/files/0001-configure_path.sh-do-not-hardcode-prefix-lib-as-libr.patch
> > similarity index 100%
> > rename from
> meta/recipes-devtools/perl/files/0001-configure_path.sh-do-not-hardcode-prefix-lib-as-libr.patch
> > rename to
> meta/recipes-devtools/perl-cross/files/0001-configure_path.sh-do-not-hardcode-prefix-lib-as-libr.patch
> > diff --git
> a/meta/recipes-devtools/perl/files/0001-configure_tool.sh-do-not-quote-the-argument-to-comma.patch
> b/meta/recipes-devtools/perl-cross/files/0001-configure_tool.sh-do-not-quote-the-argument-to-comma.patch
> > similarity index 100%
> > rename from
> meta/recipes-devtools/perl/files/0001-configure_tool.sh-do-not-quote-the-argument-to-comma.patch
> > rename to
> meta/recipes-devtools/perl-cross/files/0001-configure_tool.sh-do-not-quote-the-argument-to-comma.patch
> > diff --git
> a/meta/recipes-devtools/perl/files/0001-perl-cross-add-LDFLAGS-when-linking-libperl.patch
> b/meta/recipes-devtools/perl-cross/files/0001-perl-cross-add-LDFLAGS-when-linking-libperl.patch
> > similarity index 100%
> > rename from
> meta/recipes-devtools/perl/files/0001-perl-cross-add-LDFLAGS-when-linking-libperl.patch
> > rename to
> meta/recipes-devtools/perl-cross/files/0001-perl-cross-add-LDFLAGS-when-linking-libperl.patch
> > diff --git a/meta/recipes-devtools/perl-cross/files/README.md
> b/meta/recipes-devtools/perl-cross/files/README.md
> > new file mode 100644
> > index 0000000000..93217245c8
> > --- /dev/null
> > +++ b/meta/recipes-devtools/perl-cross/files/README.md
> > @@ -0,0 +1,29 @@
> > +**perl-cross** provides configure script, top-level Makefile
> > +and some auxiliary files for [perl](http://www.perl.org),
> > +with the primary emphasis on cross-compiling the source.
> > +
> > +    # Get perl and perl-cross sources
> > +    curl -L -O http://www.cpan.org/src/5.0/perl-5.24.1.tar.gz
> > +    curl -L -O
> https://github.com/arsv/perl-cross/releases/download/1.1.3/perl-cross-1.1.3.tar.gz
> > +
> > +    # Unpack perl-cross over perl, overwriting Makefile
> > +    tar -zxf perl-5.24.1.tar.gz
> > +    cd perl-5.24.1
> > +    tar --strip-components=1 -zxf ../perl-cross-1.1.3.tar.gz
> > +
> > +    # Proceed as usual with most autoconfed packages
> > +    ./configure --target=arm-linux-gnueabi --prefix=/usr -Duseshrplib
> > +    make -j4
> > +    make DESTDIR=/path/to/staging/dir install
> > +
> > +Unlike mainline Perl, this configure never runs any target executables,
> > +relying solely on compile/link tests and pre-defined hints.
> > +On the flip side, it is only meant to run on resonably sane modern unix
> systems.
> > +
> > +Check [project pages](http://arsv.github.io/perl-cross/) for more info.
> > +In particular, [configure usage](
> http://arsv.github.io/perl-cross/usage.html)
> > +lists available configure options.
> > +
> > +Perl-cross is a free software licensed under the same terms
> > +as the original perl source.
> > +See LICENSE, Copying and Artistic files.
> > diff --git a/meta/recipes-devtools/perl-cross/files/determinism.patch
> b/meta/recipes-devtools/perl-cross/files/determinism.patch
> > new file mode 100644
> > index 0000000000..e9bf752bcb
> > --- /dev/null
> > +++ b/meta/recipes-devtools/perl-cross/files/determinism.patch
> > @@ -0,0 +1,46 @@
> > +Fixes to make the perl build reproducible:
> > +
> > +a) Remove the \n from configure_attr.sh since it gets quoted
> differently depending on
> > +   whether the shell is bash or dash which can cause the test result to
> be incorrect.
> > +   Reported upstream: https://github.com/arsv/perl-cross/issues/87
> > +
> > +b) Sort the order of the module lists from configure_mods.sh since
> otherwise
> > +   the result isn't the same leading to makefile differences.
> > +   Reported upstream: https://github.com/arsv/perl-cross/issues/88
> > +
> > +c) Sort the Encode::Byte byte_t.fnm file output (and the makefile
> depends whilst
> > +   there for good measure)
> > +   This needs to go to upstream perl (not done)
> > +
> > +d) Use bash for perl-cross configure since otherwise trnl gets set to
> "\n" with bash
> > +   and "" with dash
> > +   Reported upstream: https://github.com/arsv/perl-cross/issues/87
> > +
> > +RP 2020/2/7
> > +
> > +Upstream-Status: Pending [75% submitted]
> > +Signed-off-by: Richard Purdie <richard.pur...@linuxfoundation.org
> > +
> > +Index: perl-5.30.1/cnf/configure_mods.sh
> > +===================================================================
> > +--- perl-5.30.1.orig/cnf/configure_mods.sh
> > ++++ perl-5.30.1/cnf/configure_mods.sh
> > +@@ -82,7 +82,7 @@ extonlyif() {
> > + }
> > +
> > + definetrimspaces() {
> > +-      v=`echo "$2" | sed -r -e 's/\s+/ /g' -e 's/^\s+//' -e 's/\s+$//'`
> > ++      v=`echo "$2" | sed -r -e 's/\s+/ /g' -e 's/^\s+//' -e 's/\s+$//'
> | xargs -n1 | LANG=C sort | xargs`
> > +       define $1 "$v"
> > + }
> > +
> > +Index: perl-5.30.1/cnf/configure
> > +===================================================================
> > +--- perl-5.30.1.orig/cnf/configure
> > ++++ perl-5.30.1/cnf/configure
> > +@@ -1,4 +1,4 @@
> > +-#!/bin/sh
> > ++#!/bin/bash
> > +
> > + base=${0%/*}; test -z "$base" && base=.
> > +
> > diff --git a/meta/recipes-devtools/perl-cross/perlcross_1.3.5.bb
> b/meta/recipes-devtools/perl-cross/perlcross_1.3.5.bb
> > new file mode 100644
> > index 0000000000..9509313b86
> > --- /dev/null
> > +++ b/meta/recipes-devtools/perl-cross/perlcross_1.3.5.bb
> > @@ -0,0 +1,36 @@
> > +SUMMARY = "Perl-cross build system"
> > +HOMEPAGE = "https://github.com/arsv/perl-cross";
> > +DESCRIPTION = "perl-cross provides configure script, top-level Makefile
> and some auxiliary files for perl, \
> > +with the primary emphasis on cross-compiling the source."
> > +SECTION = "devel"
> > +LICENSE = "Artistic-1.0 | GPL-1.0+"
> > +# README.md is taken from
> https://github.com/arsv/perl-cross/blob/master/README.md
> > +# but is not provided inside the release tarballs
> > +LIC_FILES_CHKSUM =
> "file://${WORKDIR}/README.md;md5=252fcce2026b765fee1ad74d2fb07a3b"
> > +
> > +SRC_URI = "
> https://github.com/arsv/perl-cross/releases/download/${PV}/perl-cross-${PV}.tar.gz;name=perl-cross
> \
> > +           file://README.md \
> > +
>  file://0001-configure_tool.sh-do-not-quote-the-argument-to-comma.patch \
> > +
>  file://0001-perl-cross-add-LDFLAGS-when-linking-libperl.patch \
> > +
>  file://0001-configure_path.sh-do-not-hardcode-prefix-lib-as-libr.patch \
> > +           file://determinism.patch \
> > +"
> > +UPSTREAM_CHECK_URI = "https://github.com/arsv/perl-cross/releases/";
> > +
> > +SRC_URI[perl-cross.sha256sum] =
> "91c66f6b2b99fccfd4fee14660b677380b0c98f9456359e91449798c2ad2ef25"
> > +
> > +S = "${WORKDIR}/perl-cross-${PV}"
> > +
> > +do_configure () {
> > +}
> > +
> > +do_compile () {
> > +}
> > +
> > +do_install() {
> > +    mkdir -p ${D}/${datadir}/perl-cross/
> > +    cp -rfp ${S}/* ${D}/${datadir}/perl-cross/
> > +}
> > +
> > +BBCLASSEXTEND = "native"
> > +
> > diff --git a/meta/recipes-devtools/perl/files/determinism.patch
> b/meta/recipes-devtools/perl/files/determinism.patch
> > index ccdd52a0d0..aa85ccef10 100644
> > --- a/meta/recipes-devtools/perl/files/determinism.patch
> > +++ b/meta/recipes-devtools/perl/files/determinism.patch
> > @@ -21,19 +21,6 @@ RP 2020/2/7
> >   Upstream-Status: Pending [75% submitted]
> >   Signed-off-by: Richard Purdie <richard.pur...@linuxfoundation.org
> >
> > -Index: perl-5.30.1/cnf/configure_mods.sh
> > -===================================================================
> > ---- perl-5.30.1.orig/cnf/configure_mods.sh
> > -+++ perl-5.30.1/cnf/configure_mods.sh
> > -@@ -82,7 +82,7 @@ extonlyif() {
> > - }
> > -
> > - definetrimspaces() {
> > --      v=`echo "$2" | sed -r -e 's/\s+/ /g' -e 's/^\s+//' -e 's/\s+$//'`
> > -+      v=`echo "$2" | sed -r -e 's/\s+/ /g' -e 's/^\s+//' -e 's/\s+$//'
> | xargs -n1 | LANG=C sort | xargs`
> > -       define $1 "$v"
> > - }
> > -
> >   Index: perl-5.30.1/cpan/Encode/Byte/Makefile.PL
> >   ===================================================================
> >   --- perl-5.30.1.orig/cpan/Encode/Byte/Makefile.PL
> > @@ -56,13 +43,3 @@ Index: perl-5.30.1/cpan/Encode/Byte/Makefile.PL
> >        {
> >            print FILELIST $self->catfile($dir,$file) . "\n";
> >        }
> > -Index: perl-5.30.1/cnf/configure
> > -===================================================================
> > ---- perl-5.30.1.orig/cnf/configure
> > -+++ perl-5.30.1/cnf/configure
> > -@@ -1,4 +1,4 @@
> > --#!/bin/sh
> > -+#!/bin/bash
> > -
> > - base=${0%/*}; test -z "$base" && base=.
> > -
> > diff --git a/meta/recipes-devtools/perl/perl_5.32.1.bb
> b/meta/recipes-devtools/perl/perl_5.32.1.bb
> > index b28040c7fb..01db924a73 100644
> > --- a/meta/recipes-devtools/perl/perl_5.32.1.bb
> > +++ b/meta/recipes-devtools/perl/perl_5.32.1.bb
> > @@ -9,18 +9,14 @@ LIC_FILES_CHKSUM =
> "file://Copying;md5=5b122a36d0f6dc55279a0ebc69f3c60b \
> >
> >
> >   SRC_URI = "https://www.cpan.org/src/5.0/perl-${PV}.tar.gz;name=perl \
> > -
> https://github.com/arsv/perl-cross/releases/download/1.3.5/perl-cross-1.3.5.tar.gz;name=perl-cross
> \
> >              file://perl-rdepends.txt \
> > -
>  file://0001-configure_tool.sh-do-not-quote-the-argument-to-comma.patch \
> >
> file://0001-ExtUtils-MakeMaker-add-LDFLAGS-when-linking-binary-m.patch \
> >
> file://0001-Somehow-this-module-breaks-through-the-perl-wrapper-.patch \
> >              file://errno_ver.diff \
> >              file://native-perlinc.patch \
> > -
>  file://0001-perl-cross-add-LDFLAGS-when-linking-libperl.patch \
> >              file://perl-dynloader.patch \
> > -
>  file://0001-configure_path.sh-do-not-hardcode-prefix-lib-as-libr.patch \
> >              file://0002-Constant-Fix-up-shebang.patch \
> > -           file://determinism.patch  \
> > +           file://determinism.patch \
> >              "
> >   SRC_URI_append_class-native = " \
> >              file://perl-configpm-switch.patch \
> > @@ -30,13 +26,12 @@ SRC_URI_append_class-target = " \
> >   "
> >
> >   SRC_URI[perl.sha256sum] =
> "03b693901cd8ae807231b1787798cf1f2e0b8a56218d07b7da44f784a7caeb2c"
> > -SRC_URI[perl-cross.sha256sum] =
> "91c66f6b2b99fccfd4fee14660b677380b0c98f9456359e91449798c2ad2ef25"
> >
> >   S = "${WORKDIR}/perl-${PV}"
> >
> >   inherit upstream-version-is-even update-alternatives
> >
> > -DEPENDS += "zlib virtual/crypt"
> > +DEPENDS += "perlcross-native zlib virtual/crypt"
> >
> >   PERL_LIB_VER = "${@'.'.join(d.getVar('PV').split('.')[0:2])}.0"
> >
> > @@ -47,12 +42,8 @@ PACKAGECONFIG[gdbm] = ",-Ui_gdbm,gdbm"
> >   # Don't generate comments in enc2xs output files. They are not
> reproducible
> >   export ENC2XS_NO_COMMENTS = "1"
> >
> > -do_unpack_append() {
> > -    bb.build.exec_func('do_copy_perlcross', d)
> > -}
> > -
> > -do_copy_perlcross() {
> > -    cp -rfp ${WORKDIR}/perl-cross*/* ${S}
> > +do_configure_prepend() {
> > +    cp -rfp ${STAGING_DATADIR_NATIVE}/perl-cross/* ${S}
> >   }
> >
> >   do_configure_class-target() {
> > --
> > 2.31.1
> >
> >
> >
> > 
> >
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#153065): 
https://lists.openembedded.org/g/openembedded-core/message/153065
Mute This Topic: https://lists.openembedded.org/mt/83304579/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to