Bug 238320 - Mk/bsd.default-versions.mk: perl5 default detection warning with perl only installed in user-defined LOCALBASE
Summary: Mk/bsd.default-versions.mk: perl5 default detection warning with perl only in...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Port Management Team
Keywords: needs-qa
Depends on:
Reported: 2019-06-04 10:49 UTC by Jeroen Pulles
Modified: 2019-06-05 14:38 UTC (History)
2 users (show)

See Also:
koobs: maintainer-feedback? (perl)

patch path to perl (1.10 KB, patch)
2019-06-04 10:49 UTC, Jeroen Pulles
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeroen Pulles 2019-06-04 10:49:42 UTC
Created attachment 204817 [details]
patch path to perl

I'm running a ports tree in my home directory for writing my own port. I've set LOCALBASE to $HOME/local. I haven't updated PATH, and perl is not installed on my system. One of my port dependencies installed perl in $LOCALBASE. This seems to cause some sort of issue for the perl5 default detection mechanism:

sh: perl: not found
make: "/home/jeroenp/ports/Mk/bsd.default-versions.mk" line 78: warning: "perl -e 'printf "%vd\n", $^V;'" returned non-zero status

From the preceding if statement I'm guessing this default detection should have been based on the installed perl binary, which can be found in $LOCALBASE/bin/perl. I'm thinking, why do a exist test and then proceed to work with any perl on $PATH... Attached is a patch that uses the perl in $LOCALBASE. 

kind regards,
Comment 1 Mathieu Arnold freebsd_committer 2019-06-04 22:13:09 UTC
While your fix is theorically correct, not having ${LOCALBASE}/bin in your PATH will break ports dependencies, so the correct fix would be to add $HOME/local/bin to your PATH.
Comment 2 Jeroen Pulles 2019-06-05 07:39:18 UTC
Yes, but I got very far before I ran into issues with BUILD_DEPENDS not being found. And I'd have to put the $LOCALBASE/local/bin in front of the existing $PATH, otherwise this could still sting. But I don't want to quibble too much ;-)
Comment 3 commit-hook freebsd_committer 2019-06-05 14:38:27 UTC
A commit references this bug:

Author: mat
Date: Wed Jun  5 14:37:47 UTC 2019
New revision: 503508
URL: https://svnweb.freebsd.org/changeset/ports/503508

  Make sure we use perl installed by ports and not some other perl in PATH.

  PR:		238320
  Submitted by:	Jeroen Pulles

Comment 4 Mathieu Arnold freebsd_committer 2019-06-05 14:38:44 UTC
Though I don't see any real bad things that can happen with this patch, and it is better to be consistent in what we do.