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, Jeroen
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.
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 ;-)
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 Log: Make sure we use perl installed by ports and not some other perl in PATH. PR: 238320 Submitted by: Jeroen Pulles Changes: head/Mk/bsd.default-versions.mk
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.