Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Markus Volk" <f_l_k@t-online.de>
To: Paul Barker <paul@pbarker.dev>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [oe-core][PATCH 2/5] cpan: survive the Makefile that MakeMaker rebuilds under us
Date: Sat, 26 Sep 2026 21:03:02 +0200	[thread overview]
Message-ID: <3LJZLT.G4KW3H0GTOVM3@t-online> (raw)
In-Reply-To: <d090889df2d7b67661ba42e1ab91de9f9c22dd73.camel@pbarker.dev>

[-- Attachment #1: Type: text/plain, Size: 5124 bytes --]

Hi Paul,


> 
> The commit summary here is an excellent example of Claudish. I'm not
> really sure what it means... It could do with re-writing.

Thats true. I think I only could follow it because I knew which real 
issue this fixes for me.
The problem is, that I'm following more or less regulary the current 
master branch of
oe-core and whenever there have been changes to perl the following 
build breaks a few
perl recipes. that then required a '-c cleansstate' to become buildable 
again.

> I'm not really familiar with cpan packages - are we sure that none
> include a Makefile?

I wasn't sure about this either, but since ā€œdo_configureā€ generates 
a new Makefile, I left it in. However,
that isn't necessary to fix the actual problem.

> 
> We don't want surprise rebuilds during do_install.

I'll send a v2 that just ignores the different timestamp

On Sat, Sep 26 2026 at 15:05:24 +01:00:00, Paul Barker 
<paul@pbarker.dev> wrote:
> On Tue, 2026-09-22 at 11:23 +0200, Markus Volk wrote:
>>  ExtUtils::MakeMaker makes the generated Makefile depend on 
>> Config.pm and
>>  config.h from the perl it was configured against. 
>> do_prepare_recipe_sysroot
>>  stages those files fresh on every run, so their mtime can end up 
>> newer than
>>  a Makefile written by a do_configure that is still valid. make then
>>  regenerates the Makefile, prints "Please rerun the make command" 
>> and exits
>>  non-zero, which fails do_compile or do_install. Run make a second 
>> time in
>>  that case, which is what MakeMaker asks for; a run that fails for 
>> any other
>>  reason fails again. Also drop a stale Makefile before Makefile.PL 
>> runs, so
>>  a configure in a used work directory does not start from old 
>> settings.
>> 
>>  Reproduced with liburi-perl by touching Config.pm and config.h in 
>> the
>>  recipe sysroot and forcing do_install: it failed before the change 
>> and
>>  succeeds after it.
>> 
>>  AI-Generated: Uses Claude Code (Claude Opus 5)
>>  Signed-off-by: Markus Volk <f_l_k@t-online.de 
>> <mailto:f_l_k@t-online.de>>
> 
> Hi Markus,
> 
> The commit summary here is an excellent example of Claudish. I'm not
> really sure what it means... It could do with re-writing.
> 
>>  ---
>>   meta/classes-recipe/cpan.bbclass | 13 +++++++++++--
>>   1 file changed, 11 insertions(+), 2 deletions(-)
>> 
>>  diff --git a/meta/classes-recipe/cpan.bbclass 
>> b/meta/classes-recipe/cpan.bbclass
>>  index dbf44da9d2..0f7384786f 100644
>>  --- a/meta/classes-recipe/cpan.bbclass
>>  +++ b/meta/classes-recipe/cpan.bbclass
>>  @@ -23,6 +23,10 @@ export PERLHOSTLIB = 
>> "${STAGING_LIBDIR_NATIVE}/perl5/${@get_perl_version(d)}/"
>>   export PERLHOSTARCHLIB = 
>> "${STAGING_LIBDIR_NATIVE}/perl5/${@get_perl_version(d)}/${@get_perl_hostarch(d)}/"
>> 
>>   cpan_do_configure () {
>>  +	# A Makefile left behind by an earlier configure run would be 
>> used with the
>>  +	# settings it was generated with, so start from the Makefile.PL 
>> every time.
>>  +	rm -f Makefile
> 
> I'm not really familiar with cpan packages - are we sure that none
> include a Makefile?
> 
>>  +
>>   	yes '' | perl ${EXTRA_PERLFLAGS} Makefile.PL INSTALLDIRS=vendor 
>> NO_PERLLOCAL=1 NO_PACKLIST=1 PERL=$(which perl) ${EXTRA_CPANFLAGS}
>> 
>>   	# Makefile.PLs can exit with success without generating a
>>  @@ -57,12 +61,17 @@ do_configure:append:class-nativesdk() {
>>              -e 's:LD_RUN_PATH ?= ?"?[^"]*"?::g'
>>   }
>> 
>>  +# ExtUtils::MakeMaker regenerates the Makefile when the staged 
>> perl has become
>>  +# newer than it, and then exits asking for make to be rerun. Do 
>> that instead of
>>  +# failing the task; a run that fails for any other reason fails 
>> again.
>>   cpan_do_compile () {
>>  -	oe_runmake PASTHRU_INC="${CFLAGS}" LD="${CCLD}"
>>  +	oe_runmake_call PASTHRU_INC="${CFLAGS}" LD="${CCLD}" || \
>>  +		oe_runmake PASTHRU_INC="${CFLAGS}" LD="${CCLD}"
> 
> Are we sure this won't mask other issues? The staged perl becoming 
> newer
> than the generated Makefile should be a rare occurance, perhaps we can
> check for that before calling make and handle it explicitly?
> 
>>   }
>> 
>>   cpan_do_install () {
>>  -	oe_runmake DESTDIR="${D}" install_vendor
>>  +	oe_runmake_call DESTDIR="${D}" install_vendor || \
>>  +		oe_runmake DESTDIR="${D}" install_vendor
> 
> We don't want surprise rebuilds during do_install.
> 
>>   	for PERLSCRIPT in `grep -rIEl '#! *${bindir}/perl-native.*/perl' 
>> ${D}`; do
>>   		sed -i -e 's|${bindir}/perl-native.*/perl|/usr/bin/env 
>> nativeperl|' $PERLSCRIPT
>>   	done
> 
> Best regards,
> 
> --
> Paul Barker
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#246637): 
> <https://lists.openembedded.org/g/openembedded-core/message/246637>
> Mute This Topic: <https://lists.openembedded.org/mt/121371712/3618223>
> Group Owner: openembedded-core+owner@lists.openembedded.org 
> <mailto:openembedded-core+owner@lists.openembedded.org>
> Unsubscribe: 
> <https://lists.openembedded.org/g/openembedded-core/unsub> 
> [f_l_k@t-online.de <mailto:f_l_k@t-online.de>]
> -=-=-=-=-=-=-=-=-=-=-=-
> 


[-- Attachment #2: Type: text/html, Size: 6552 bytes --]

  reply	other threads:[~2026-09-26 19:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22  9:23 [oe-core][PATCH 1/5] gcr: initialize libgcrypt from the secret exchange Markus Volk
2026-09-22  9:23 ` [oe-core][PATCH 2/5] cpan: survive the Makefile that MakeMaker rebuilds under us Markus Volk
2026-09-26 14:05   ` Paul Barker
2026-09-26 19:03     ` Markus Volk [this message]
2026-09-22  9:23 ` [oe-core][PATCH 3/5] spdx_license: give UnknownId a name Markus Volk
2026-09-22  9:23 ` [oe-core][PATCH 4/5] license_finder: normalise license texts before hashing Markus Volk
2026-09-22  9:23 ` [oe-core][PATCH 5/5] go-mod-update-modules: include the generated files from the class Markus Volk
2026-09-22 14:14   ` Antonin Godard
2026-09-23 17:23     ` mrksvolk
2026-09-23 18:03     ` Khem Raj
2026-09-25 11:18   ` Ross Burton
2026-09-25 16:27     ` Markus Volk
2026-09-22  9:33 ` Patchtest results for [oe-core][PATCH 1/5] gcr: initialize libgcrypt from the secret exchange patchtest
2026-09-26 13:53 ` Paul Barker

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=3LJZLT.G4KW3H0GTOVM3@t-online \
    --to=f_l_k@t-online.de \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=paul@pbarker.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox