diff mbox series

[scarthgap] perl-ptest: copy xconfig data from perl source directory

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

Commit Message

Rajendra Desai March 18, 2025, 6:15 a.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

Alexander Kanavin March 18, 2025, 9:53 a.m. UTC | #1
Is the issue occurring on master as well? If so, you need to explain
why perl ptest is passing there in yocto CI pipelines, and send a fix
to master first before it can be backported.

Alex

On Tue, 18 Mar 2025 at 07:15, Rajendra Desai via
lists.openembedded.org
<rajendra.desai=emerson.com@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(-)
>
> 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() {
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#213165): https://lists.openembedded.org/g/openembedded-core/message/213165
> Mute This Topic: https://lists.openembedded.org/mt/111765365/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
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() {