git-2.47.0 requires perl5-5.36.3 -- but how do we know for sure?

My apologies .. the Makefile for ports continues to be (mostly) a black box for me.

I can see from the list of dependencies that git-2.47.0 requires perl5-5.36.3:

https://ports.freebsd.org/cgi/ports.cgi?query=git-2.47.0&stype=all&sektion=devel

However, when I run echo "=== build ===" && make build-depends-list && echo "=== run ===" && make run-depends-list it says perl5.40 is going to be used:

Code:
=== build ===
/usr/ports/ports-mgmt/pkg
/usr/ports/ftp/curl
/usr/ports/lang/p5-Error
/usr/ports/textproc/rubygem-asciidoctor
/usr/ports/textproc/xmlto
/usr/ports/devel/gmake
/usr/ports/converters/libiconv
/usr/ports/security/openssl
/usr/ports/devel/gettext-runtime
/usr/ports/devel/gettext-tools
/usr/ports/lang/python311
/usr/ports/devel/autoconf
/usr/ports/devel/automake
/usr/ports/lang/perl5.40
/usr/ports/textproc/expat2
/usr/ports/devel/pcre2
=== run ===
/usr/ports/textproc/expat2
/usr/ports/devel/pcre2
/usr/ports/devel/gettext-runtime
/usr/ports/ftp/curl
/usr/ports/www/p5-CGI
/usr/ports/lang/p5-Error
/usr/ports/security/p5-Authen-SASL
/usr/ports/security/p5-IO-Socket-SSL
/usr/ports/security/openssl
/usr/ports/lang/python311
/usr/ports/lang/perl5.40

Why the difference?

.. but if I check what is actually built ... 5.36 is in the list:

Code:
:/usr/ports/devel/git # pkg query --all '%o %n-%v %R' | grep perl5
lang/perl5.36 perl5-5.36.3_2 unknown-repository

Is it possible that make build-depends-list now says 5.40 and pkg query for git is 5.36.3 because ports was updated by git after git was built using the ports from the dvd iso?

Also, I dont understand how make knows what version of perl to use when there does not appear to be an explict DEPENDS statement in the Makefile:

Code:
:/usr/ports/devel/git # cat Makefile | grep perl5
PERL_USES=              perl5

.. whereas others do:

Code:
:/usr/ports/devel/git # cat Makefile | grep pcre2
PCRE2_LIB_DEPENDS=      libpcre2-8.so:devel/pcre2
:/usr/ports/devel/git # cat Makefile | grep expat2
CURL_LIB_DEPENDS=       libexpat.so:textproc/expat2

Thanks in advance for holding my hand .. *sigh*
 
Is your pkg repository up-to-date? Are you using quarterly or latest?

I think you are probably comparing apples and oranges - one will be older/not updated and show the older Perl dependancy, the other is looking at latest and showing the newer Perl dependancy.
 
I wouldn't worry about that too much - that's just automatic dependency resolution.

This is just an effect of using pkg (your use of pkg-query vs ports (compiling in /usr/ports).

pkg looks at pre-built packages that are available in a remote repo.

ports use whatever the Makefile specifies. Ports are what you build locally yourself using a set of Makefiles in /usr/ports.

Depending on how old your ports tree is - the Makefiles in there may specify a newer version of Perl than the one that was used for pre-built packages.
 
This is just an effect of using pkg (your use of pkg-query vs ports (compiling in /usr/ports).
hrm .. I am not tracking that. Everything installed on the test server was done from /usr/ports. The "unknown-repository" result from the pkg query attests to that.

Depending on how old your ports tree is - the Makefiles in there may specify a newer version of Perl than the one that was used for pre-built packages.
Did you look at the Makefile for git? I could not find where it specified what version of perl to use. Certainly could have missed it but it feels like to me that the code in Makefile is pulling what version of perl to use from somewhere else.

And how it is doing it is a bit of information that I would like to understand better.

:)
 
I don't know the answers, but grep around in /usr/ports and there's stuff like this:
Code:
Mk/bsd.default-versions.mk:PERL5_DEFAULT?=        5.36
So for any well-used component like Perl, Python, Apache, Tcl, Rust, Ruby, etc. there's "built-in" understanding of what default versions to use.
 
hrm .. I am not tracking that. Everything installed on the test server was done from /usr/ports. The "unknown-repository" result from the pkg query attests to that.
It is kind of important to know the difference between ports and packages. It sounds like you're using ports (compiling your stuff locally).

pkg-query(7) resolves the repo using rules specified by /usr/local/etc/pkg.conf... and it sounds like the package repo (for pre-made stuff) is not specified on your host. Which is actually OK if you're using ports.

Well, here's Perl mentions from my copy of the ports tree:
Code:
root@thinkpad:/usr/ports # cat devel/git/Makefile | grep perl
SHEBANG_FILES= *.perl */*.perl */*/*.perl */*.pl */*/*.pl */*/*/*.pl \
                contrib/credential/netrc/git-credential-netrc.perl \
PERL_USES=              perl5
PERL_CONFIGURE_WITH=    perl=${PERL}
        @${REINPLACE_CMD} -e '/git-cvsexportcommit.perl/d; \
                /git-cvsimport.perl/d; \
                /git-cvsserver.perl/d; \
        @${REINPLACE_CMD} -e '/git-svn.perl/d' ${WRKSRC}/Makefile
        @${REINPLACE_CMD} -e "s,/usr/bin/perl,${PERL}," \
        @${REINPLACE_CMD} -e "s,/usr/bin/perl,${PERL}," \
${RM} ${WRKSRC}/contrib/diff-highlight/shebang.perl

The important part is PERL_USES= perl5 ... The rest is for the system to figure out and resolve the dependencies. And it does a pretty good job.
 
My apologies .. the Makefile for ports continues to be (mostly) a black box for me.

I can see from the list of dependencies that git-2.47.0 requires perl5-5.36.3:

https://ports.freebsd.org/cgi/ports.cgi?query=git-2.47.0&stype=all&sektion=devel

However, when I run echo "=== build ===" && make build-depends-list && echo "=== run ===" && make run-depends-list it says perl5.40 is going to be used:

A lot going on here. Firstly, git doesn't have a dependency on perl directly (if enabled, it does enable the configure script to enable perl, but it's actually dependency is on lang/p5-error):

Code:
PERL_BUILD_DEPENDS=     p5-Error>=0:lang/p5-Error

p5-error has the dependency on perl, so that is where you need to look to see what's going on.

The following line does nothing. Presumably an artefact from before the more general "USES" infrastructure was added:

Code:
PERL_USES= perl5

If you look into the makefile for p5-Error, you'll see a line:

Code:
USES= perl5

The "USES" framework is a way to have many related commands common to a particular functionality in one place, namely /usr/ports/Mk/Uses/<USE>.mk

So the above includes the file /usr/ports/Mk/Uses/perl5.mk

*THAT* is the file you want to check for perl dependencies, but in this case, it will use whatever version of perl you have installed (if still valid) - if not installed, it reads the value "PERL5_DEFAULT" from file /usr/ports/Mk/bsd.default-versions.mk, (currently 5.36) unless that too is overriden (see the comments at the beginning of that file for info on how to do that!)

So in other words, it seems that you already have perl 5.40 installed, so it will use that, only defaulting to perl 5.36 only if you don't previously have perl installed.

By the way, a good place to start looking for clues is the comments in file /usr/ports/Mk/bsd.ports.mk
 
A lot going on here. Firstly, git doesn't have a dependency on perl directly (if enabled, it does enable the configure script to enable perl, but it's actually dependency is on lang/p5-error):

Code:
PERL_BUILD_DEPENDS=     p5-Error>=0:lang/p5-Error
Okay. Alright. Cool. This is light blub switched on material here. heh. So I definitely had tunnel vision when choosing to only grep for the port name in Makefile's.

When I grep'd for "DEPENDS" in the git Makefile the BUILD and RUN entries now seem so obvious:
Code:
:/usr/ports/devel/git # cat Makefile | grep DEPENDS
PERL_BUILD_DEPENDS=     p5-Error>=0:lang/p5-Error
PERL_RUN_DEPENDS=       p5-Error>=0:lang/p5-Error
GITWEB_RUN_DEPENDS=     p5-CGI>=0:www/p5-CGI
PCRE2_LIB_DEPENDS=      libpcre2-8.so:devel/pcre2
SEND_EMAIL_RUN_DEPENDS= p5-Authen-SASL>=0:security/p5-Authen-SASL \
CURL_BUILD_DEPENDS=     curl:ftp/curl
CURL_RUN_DEPENDS=       curl:ftp/curl
CURL_LIB_DEPENDS=       libexpat.so:textproc/expat2
SUBTREE_BUILD_DEPENDS=  asciidoctor:textproc/rubygem-asciidoctor\
RUN_DEPENDS+=   git=${PKGVERSION}:devel/git
RUN_DEPENDS+=   cvsps:devel/cvsps
RUN_DEPENDS+=   p5-Term-ReadKey>=0:devel/p5-Term-ReadKey
RUN_DEPENDS+=   p5-subversion-lts>=0:devel/p5-subversion
RUN_DEPENDS+=   p5-subversion>=0:devel/p5-subversion

If you look into the makefile for p5-Error, you'll see a line:

Code:
USES= perl5

The "USES" framework is a way to have many related commands common to a particular functionality in one place, namely /usr/ports/Mk/Uses/<USE>.mk

So the above includes the file /usr/ports/Mk/Uses/perl5.mk

*THAT* is the file you want to check for perl dependencies, but in this case, it will use whatever version of perl you have installed (if still valid) - if not installed, it reads the value "PERL5_DEFAULT" from file /usr/ports/Mk/bsd.default-versions.mk, (currently 5.36) unless that too is overriden (see the comments at the beginning of that file for info on how to do that!)
Thanks for explaining how /usr/ports/Mk/Uses/perl5.mk will use /usr/ports/Mk/bsd.default-versions.mk to populate "PERL5_DEFAULT" to pass back up to p5-Error. That scenario makes sense.

I am going to start over and build git with just the dvd iso ports and see what it says afterwards.

Appericate the help from all!
 
Back
Top