[oi-dev] manually specifying dependencies between scripting language modules

Tim Mooney Tim.Mooney at ndsu.edu
Tue Jan 4 05:10:52 UTC 2022


All-

My basic question is what the best practice is for how packagers should be
specifying dependencies between language modules/libraries for scripting
languages?  Currently I'm specifically interested in perl modules, but
the same idea is relevant for python, ruby, etc.

As an example of one way to do it, there's
oi-userland/components/perl/libwww-perl/libwww-perl-PERLVER.p5m.
Alexander manually added all of the modules that are needed for
libwww-perl-###, using the most obvious, "friendly" syntax for depend:

 	depend fmri=library/perl-5/encode-locale-$(PLV) type=require
 	depend fmri=library/perl-5/file-listing-$(PLV) type=require
 	depend fmri=library/perl-5/html-parser-$(PLV) type=require

etc.

Doing it that way, though, those dependencies don't get added to Makefile
when you do "gmake REQUIRED_PACKAGES", and they don't appear to be added
to the "pkg5" metadata after a successful publish.

The same is true if you want to make a language module depend upon the
version of the perl interpreter it was built for.  I first tried using
this syntax:

 	depend fmri=runtime/perl-$(PLV) type=require

or variants of it as outlined in the pkg guide, like:

 	depend fmri=pkg:/runtime/perl-$(PLV) type=require

Dependencies specified that way aren't output by REQUIRED_PACKAGES.

However, if you change the syntax to a "less obvious" method:

 	depend fmri=__TBD pkg.debug.depend.file=perl \
 		pkg.debug.depend.path=usr/perl5/$(PERLVER)/bin type=require

then REQUIRED_PACKAGES *does* add the dependency to the Makefile and the
pkg5 metadata.  That's a trick that Aurélien has used in some places.

So what's the right thing to do here?  Use the simple syntax in the .p5m
file and don't care that the dependency isn't listed in the Makefile or
pkg5?  Use the more complicated syntax, with "fmri=__TBD" and a file and
path from the dependency?  Don't specify anything in the .p5m file and
instead manually add the dependency in the Makefile, as you might for
a build dependency?

I'm happy to fix up missing inter-module dependencies when I find them,
but I would like to follow whatever the best practice is for these types
of dependencies.

Thanks,

Tim
-- 
Tim Mooney                                             Tim.Mooney at ndsu.edu
Enterprise Computing & Infrastructure /
Division of Information Technology    /                701-231-1076 (Voice)
North Dakota State University, Fargo, ND 58105-5164


More information about the oi-dev mailing list