Project

General

Profile

Bug #8920

build should ask perl for help

Added by Norm Jacobs over 2 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
tools - gate/build tools
Start date:
2017-12-13
Due date:
% Done:

100%

Estimated time:
1.00 h
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:

Description

I tried to build the illumos-gate on OI hipster and OmniOSce r151023.
Building the PERL modules under usr/src/cmd/perl/... initially failed with errors like:

/usr/perl5/5.10.0/bin/xsubpp  Utils.xs >i386/Utils.c
sh: line 1: /usr/perl5/5.10.0/bin/xsubpp: not found *** Error code 127

This is because Makefile.master hardcodes values for PERL_* macros and they are set specific to an older version of PERL than available on these distros. Rather than hard coding the values in these macros, the build should interrogate the perl interpreter for the appropriate information.


Files

0001-8920-build-should-ask-perl-for-help.patch (9.08 KB) 0001-8920-build-should-ask-perl-for-help.patch a changeset that addresses the issue. Norm Jacobs, 2017-12-13 12:49 AM
0001-8920-build-should-ask-perl-for-help.patch (9.36 KB) 0001-8920-build-should-ask-perl-for-help.patch updated patch Norm Jacobs, 2017-12-19 05:55 AM

History

#1

Updated by Norm Jacobs over 2 years ago

The attached patch addresses the issue by using the "Config" modules to gather information from the perl interpreter.

PERL_VERSION_CMD= $(PERL) e 'use Config; print "$$Config{version}"'
+PERL_PKGVERS_CMD= $(PERL) -e 'use Config; \
print "$$Config{revision}$$Config{patchlevel}"'
PERL_PREFIX_CMD= $(PERL) -e 'use Config; print $$Config{prefix}'
+PERL_PRIVLIB_CMD= $(PERL) -e 'use Config; print $$Config{privlib}'
+PERL_ARCHLIB_CMD= $(PERL) -e 'use Config; print $$Config{archlib}'
#
# Using $(...:sh) will only cause the PERL interpreter to run in the Makefiles
# that actually use the PERL_* macros, which keeps the build overhead lower.
+#
+PERL_VERSION= $(PERL_VERSION_CMD:sh)
+PERL_PKGVERS= $(PERL_PKGVERS_CMD:sh)
+PERL_PREFIX= $(PERL_PREFIX_CMD:sh)
+PERL_PRIVLIB= $(PERL_PRIVLIB_CMD:sh)
+PERL_ARCHLIB= $(PERL_ARCHLIB_CMD:sh)

While I was in there, I changed the build to ask the perl interpreter for its configured path information (prefix, archlib, and privlib) directories rather than constructing values using PERL_VERSION, which may have not matched the perl configuration.
I adjusted the use of the macros in the affected Makefiles, package manifest, and the environment file.

The changeset seems to build on OI Hipster without issue.

#2

Updated by Andrew Stormont over 2 years ago

Make sure you are interrogating perl in ADJUNCT_PROTO and not the version in /usr/bin.

#3

Updated by Norm Jacobs over 2 years ago

I'm updating Makefile.perl to do some Makefile macro substitution to create a PERL_ADJUNCT_PROTO macro that will contain $(ADJUNCT_PROTO) if the PERL used in the build is inside of ADJUNCT_PROTO and empty if it is not. I will prepend this value instead of ADJUNCT_PROTO in setting PERLDIR and PERLLIBDIR so that they refer to the installed bits if they are being used during the build or the ADJUNCT_PROTO bits if they are being used during the build.

The updated patch is attached. It contains the following additional diffs.

diff --git a/usr/src/cmd/perl/Makefile.perl b/usr/src/cmd/perl/Makefile.perl
index 034bc02c68..f1c89c4580 100644
--- a/usr/src/cmd/perl/Makefile.perl
+++ b/usr/src/cmd/perl/Makefile.perl
@ -19,8 +19,14 @ include $(SRC)/lib/Makefile.lib # but as they were also needed in usr/src/pkg/Makefile, # the definition was moved to usr/src/Makefile.master

-PERLDIR = $(ADJUNCT_PROTO)$(PERL_PREFIX)
-PERLLIBDIR = $(ADJUNCT_PROTO)$(PERL_ARCHLIB)
# Do some macro substitution to figure out if PERL is inside the ADJUNCT_PROTO
# area so that the build uses includes and libraries from the ADJUNCT_PROTO if
# that is where PERL is located.
_PERL_ADJUNCT_PROTO=$(PERL:$(ADJUNCT_PROTO)%=$(ADJUNCT_PROTO))
PERL_ADJUNCT_PROTO=$(_PERL_ADJUNCT_PROTO:$(PERL)=)

+PERLDIR = $(PERL_ADJUNCT_PROTO)$(PERL_PREFIX)
+PERLLIBDIR = $(PERL_ADJUNCT_PROTO)$(PERL_ARCHLIB)
PERLINCDIR = $(PERLLIBDIR)/CORE

PERLMOD = $(MODULE).pm

Also available in: Atom PDF