Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 604072 - dev-lang/perl-5.24 would fail cross compilation with -j option: "Can't locate DynaLoader.pm"
Summary: dev-lang/perl-5.24 would fail cross compilation with -j option: "Can't locate...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Perl team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2016-12-29 20:09 UTC by gwendal grignou
Modified: 2019-02-15 01:14 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge log when perl compilation fails. (dev-lang:perl-5.24.0-r2:20161229-183229.log,248.53 KB, text/x-log)
2016-12-29 20:09 UTC, gwendal grignou
Details
Log when using make -j1 instead of -j40. (dev-lang:perl-5.24.0-r2:20161229-195801.log,464.72 KB, text/x-log)
2016-12-29 21:46 UTC, gwendal grignou
Details
Working fix for dependency (Makefile.patch,686 bytes, patch)
2016-12-29 23:47 UTC, gwendal grignou
Details | Diff
Successful emerge with patch attached in 457898. (dev-lang:perl-5.24.0-r2:20161229-232545.log,465.40 KB, text/x-log)
2016-12-29 23:48 UTC, gwendal grignou
Details
Another failure (dev-lang:perl-5.24.0-r2:20161229-235921.log,231.41 KB, text/x-log)
2016-12-30 00:36 UTC, gwendal grignou
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gwendal grignou 2016-12-29 20:09:14 UTC
Created attachment 457856 [details]
emerge log when perl compilation fails.

When cross compiling perl just after emerge -C perl, the dependency DynaLoader.pm may not be present.

Emerging with option MAKEOPTS+=" -j1" works around the problem.
Comment 1 gwendal grignou 2016-12-29 21:46:53 UTC
Created attachment 457860 [details]
Log when using make -j1 instead of -j40.

Comparing the 2 logs, when compiling simultaneously, the first failure is Mkbootstrap, at line 3525.

The makefile for DynaLoader has been prepared at line 3415, compilation starts at line 3424, but finishing the compilation, with command 
"cp DynaLoader.pm ../../lib/DynaLoader.pm" would only happen line 3556, after the file is needed.

Although there are rules in Makefile to compile DynaLoader early, it looks like the extensions are not bound by that requirement.
Comment 2 gwendal grignou 2016-12-29 23:47:02 UTC
Created attachment 457898 [details, diff]
Working fix for dependency

This fix addresses the problem.
Comparing the emerge log with a failed one, DynaLoader.pm is build at the same time as the Makefiles for the extensions are generated.
Comment 3 gwendal grignou 2016-12-29 23:48:45 UTC
Created attachment 457900 [details]
Successful emerge with patch attached in 457898.
Comment 4 gwendal grignou 2016-12-30 00:36:59 UTC
Created attachment 457902 [details]
Another failure

The patch is not good, it did not prevent this error: Dynaloader was not completed when needed by I18N::Langinfo and Fcntl. It completed few lines later...
Comment 5 gwendal grignou 2017-01-04 17:01:51 UTC
+ Only happen on cross compilation (using a makefile generated from perl-cross.
+ Not always reproducible: sometimes, we are luck DynaLoader.pm is built before the first extension compilation needs it.
Comment 6 Andreas K. Hüttel gentoo-dev 2017-03-24 20:59:49 UTC
I've added the MAKEOPTS+=" -j1" workaround in 5.24.1-r1 (only for cross-compiling). 

Let's keep the bug open though.
Comment 7 Kent Fredric (IRC: kent\n) gentoo-dev 2017-03-25 05:20:25 UTC
I happened to overlook this myself when I stumbled into CC problems, and fixed one, particularly, I added this fix to 5.24 and 5.22:


	sed -i \
		-e 's|^lib/unicore/CombiningClass.pl pod/perluniprops.pod:|lib/unicore/CombiningClass.pl pod/perluniprops.pod: $(CONFIGPM)|' \
		Makefile || die

Which extends the make rule to fix make ordering.

And we've bumped perl-cross since this bug was filed too, which could have an impact on things. ( As well as bumping perl itself )

I'd be interested if you can still reproduce this failure without dilfridges added MAKEOPTS hack.
Comment 8 tt_1 2019-01-15 13:28:58 UTC
Recently I noticed that dev-lang/perl was built with -j1 -j12 when using cross-emerge. Reading #6 makes me think that this was not an accident, but that it is a desired behavior? 

It's been =dev-lang/perl-5.26.2 

How can I disable the hack from #6 to test if this still is a problem?
Comment 9 gwendal grignou 2019-02-15 01:14:20 UTC
Reverting https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d44a65185d2c8835d18dafefedf8ef5c02b491e2
Does not break cros emerge. 

I try over multiple days and the error originally reported did not show up.