diff mbox series

perl-ptest: copy xconfig data from perl source directory

Message ID 20250325155148.981445-1-rajendra.desai@emerson.com
State New
Headers show
Series perl-ptest: copy xconfig data from perl source directory | expand

Commit Message

Desai, Rajendra March 25, 2025, 3:51 p.m. UTC
The following perl ptests:

  - dist/ExtUtils-ParseXS/t/001-basic
  - dist/ExtUtils-ParseXS/t/002-more
  - dist/ExtUtils-ParseXS/t/003-usage
  - cpan/ExtUtils-Constant/t/Constant
  - cpan/ExtUtils-MakeMaker/t/02-xsdynamic

are erroring out with:
| /usr/lib/perl/ptest/perl_langinfo.h:8:10: fatal error:
xconfig.h: No such file or directory
|     8 | #include "xconfig.h"

xconfig.h contains references to the build host architecture and was
removed by commit 2e0f30c46802 ("perl: do not install files that contain
build host specific data")

However, it is still included from various other places including these
tests, and we are still depending on build host architecture data by
including the patches from perl-cross recipe, a dependency to perl recipe.

xconfig.h was added back as a copy step in the commit f90922cdeef5
("update 5.36.1 -> 5.38.0") but was not added back in perl-ptest include
file.

Borrowed the logic from the above commit to make a copy of config.h
that is specific to the target architecture. The changes in this commit
fixes the test failures.

Signed-off-by: Rajendra Desai <rajendra.desai@emerson.com>
---
 meta/recipes-devtools/perl/perl-ptest.inc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Richard Purdie March 26, 2025, 5:36 p.m. UTC | #1
On Tue, 2025-03-25 at 21:21 +0530, Rajendra Desai via lists.openembedded.org wrote:
> The following perl ptests:
> 
>   - dist/ExtUtils-ParseXS/t/001-basic
>   - dist/ExtUtils-ParseXS/t/002-more
>   - dist/ExtUtils-ParseXS/t/003-usage
>   - cpan/ExtUtils-Constant/t/Constant
>   - cpan/ExtUtils-MakeMaker/t/02-xsdynamic
> 
> are erroring out with:
> > /usr/lib/perl/ptest/perl_langinfo.h:8:10: fatal error:
> xconfig.h: No such file or directory
> >     8 | #include "xconfig.h"
> 
> xconfig.h contains references to the build host architecture and was
> removed by commit 2e0f30c46802 ("perl: do not install files that contain
> build host specific data")
> 
> However, it is still included from various other places including these
> tests, and we are still depending on build host architecture data by
> including the patches from perl-cross recipe, a dependency to perl recipe.
> 
> xconfig.h was added back as a copy step in the commit f90922cdeef5
> ("update 5.36.1 -> 5.38.0") but was not added back in perl-ptest include
> file.
> 
> Borrowed the logic from the above commit to make a copy of config.h
> that is specific to the target architecture. The changes in this commit
> fixes the test failures.
> 
> Signed-off-by: Rajendra Desai <rajendra.desai@emerson.com>
> ---
>  meta/recipes-devtools/perl/perl-ptest.inc | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

The patch sounds reasonable but which version of the project was this
patch against? It doesn't seem to apply against master.

Cheers,

Richard
diff mbox series

Patch

diff --git a/meta/recipes-devtools/perl/perl-ptest.inc b/meta/recipes-devtools/perl/perl-ptest.inc
index e07355d3f5..42d46dfd78 100644
--- a/meta/recipes-devtools/perl/perl-ptest.inc
+++ b/meta/recipes-devtools/perl/perl-ptest.inc
@@ -20,6 +20,11 @@  do_install_ptest () {
 
 	ln -sf ${bindir}/perl ${D}${PTEST_PATH}/t/perl
 
+	# xconfig.h contains references to build host architecture, and yet is included from various other places.
+	# To make it reproducible let's make it a copy of config.h patch that is specific to the target architecture.
+	# It is believed that the original header is the product of building miniperl (a helper executable built with host compiler).
+	cp ${D}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/config.h ${D}${PTEST_PATH}/xconfig.h
+
 	# Remove build host references from various scattered files...
 	find "${D}${PTEST_PATH}" \
 	     \( -name '*.PL' -o -name 'myconfig' -o -name 'cflags' -o -name '*.pl' -o -name '*.sh' -o -name '*.pm' \
@@ -44,7 +49,7 @@  do_install_ptest () {
 	 sed -i -e '/Autogenerated starting on/d' ${D}${PTEST_PATH}/lib/unicore/mktables.lst
 
 	 # Remove files with host-specific configuration for building native binaries
-	 rm ${D}${PTEST_PATH}/Makefile.config ${D}${PTEST_PATH}/xconfig.h ${D}${PTEST_PATH}/xconfig.sh
+	 rm ${D}${PTEST_PATH}/Makefile.config ${D}${PTEST_PATH}/xconfig.sh
 }
 
 python populate_packages:prepend() {