All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yu, Mingli" <mingli.yu@windriver.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>,
	openembedded-core@lists.openembedded.org, alex.kanavin@gmail.com
Subject: Re: [OE-core] [PATCH] perl: avoid the source file patched twice
Date: Thu, 24 Jun 2021 11:28:32 +0800	[thread overview]
Message-ID: <672be83a-6dde-ae8e-43ca-62ce95b99e79@windriver.com> (raw)
In-Reply-To: <5ad75eedd2ff8f0c414b9628617630774ff0e945.camel@linuxfoundation.org>



On 6/21/21 4:48 PM, Richard Purdie wrote:
> [Please note: This e-mail is from an EXTERNAL e-mail address]
> 
> On Fri, 2021-06-18 at 10:30 +0800, Yu, Mingli wrote:
>> From: Mingli Yu <mingli.yu@windriver.com>
>>
>> After the commit(60dcb230f6 perl: split perl-cross into its own recipe)
>> introduced, the source files mainly come from two parts, one is from
>> SRI_URI during do_fetch and the other with below means during do_configure.
>> do_configure_prepend() {
>>      cp -rfp ${STAGING_DATADIR_NATIVE}/perl-cross/* ${S}
>> }
>>
>> And the source files will be changed during do_compile with below
>> logic in Makefile.
>> $(CROSSPATCHED): %.applied: %.patch
>>          patch -p1 -i $< && touch $@
>>
>> And there comes build failure with below steps:
>>   $ 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]
>>
>> It's because the source files patched twice, so let do_fetch always
>> executed to make sure the source files which come from SRC_URI brand
>> new in each build to avoid the source files patched twice to fix the
>> build failure as above.
>>
>> Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
>> ---
>>   meta/recipes-devtools/perl/perl_5.34.0.bb | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/meta/recipes-devtools/perl/perl_5.34.0.bb b/meta/recipes-devtools/perl/perl_5.34.0.bb
>> index 7935a58723..2e48110d2b 100644
>> --- a/meta/recipes-devtools/perl/perl_5.34.0.bb
>> +++ b/meta/recipes-devtools/perl/perl_5.34.0.bb
>> @@ -382,3 +382,5 @@ EOF
>>          chmod 0755 ${SYSROOT_DESTDIR}${bindir}/nativeperl
>>          cat ${SYSROOT_DESTDIR}${bindir}/nativeperl
>>   }
>> +
>> +do_fetch[nostamp] = "1"
> 
> This patch is incorrect, it would cause tasks to rerun all the time and is not
> the correct way to solve this problem. We don't use nostamp tasks in mid tree
> tasks.

Hi RP,

Any suggestion to solve the issue? I'm also researching a better solution.

Thanks,

> 
> Cheers,
> 
> Richard
> 

      reply	other threads:[~2021-06-24  3:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18  2:30 [PATCH] perl: avoid the source file patched twice Yu, Mingli
2021-06-21  8:26 ` [OE-core] " Alexandre Belloni
2021-06-21  8:47   ` Yu, Mingli
2021-06-21  8:48 ` Richard Purdie
2021-06-24  3:28   ` Yu, Mingli [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=672be83a-6dde-ae8e-43ca-62ce95b99e79@windriver.com \
    --to=mingli.yu@windriver.com \
    --cc=alex.kanavin@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.