bin: dependencies not working at all?
Joshua Root
jmr at macports.org
Fri Jan 31 01:38:54 UTC 2020
On 2020-1-31 11:32 , Ken Cunningham wrote:
> Either I’m having a problem understanding bin: deps, or something is not working correctly with them.
>
> I’ve tried the same thing on several different machines, and always seem to get the same result.
>
>
>
> Specifically, I’m trying to trim down unrequired dependencies on some of the bootstrap ports to minimize headaches and heartburn maintaining them.
>
> llvm-3.4 for example does not need any special perl.
>
> In the portfile, it has
>
> depends_run bin:perl:perl5 port:llvm_select
>
> This means (to me) look for a binary named perl somewhere in the path, and install perl5 if there isn’t one.
>
> Of course, there always is a binary named “perl” in the path, so the depends itself is a bit redundant, but at any rate, with all ports uninstalled, the system perl is active:
>
> $ port -v installed | grep active
> $ which perl
> /usr/bin/perl
>
> $ printenv
> PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
>
> however, port still wants to install perl5 and all it’s supporting deps:
>
> $ port info llvm-3.4
> llvm-3.4 @3.4.2_12 (lang)
> Sub-ports: clang-3.4
> Variants: assertions, ocaml, universal
>
> Description: The LLVM Core libraries provide a modern source- and target-independent optimizer, along with code generation support for many popular CPUs (as well as some less common ones!) These
> libraries are built around a well specified code representation known as the LLVM intermediate representation ("LLVM IR").
> Homepage: https://llvm.org/
>
> Library Dependencies: libffi, ncurses-bootstrap, zlib
> Runtime Dependencies: perl5, llvm_select
> Platforms: darwin
> License: NCSA
> Maintainers: Email: jeremyhu at macports.org, GitHub: jeremyhu
> Email: larryv at macports.org, GitHub: larryv
> Email: kencu at macports.org, GitHub: kencu
try 'port -v info' or 'port -v deps'
> $ port rdeps llvm-3.4
> The following ports are dependencies of llvm-3.4 @3.4.2_12:
> libffi
> ncurses-bootstrap
> zlib
> xz-bootstrap
> libiconv-bootstrap
> gperf-bootstrap
> gettext-bootstrap
> perl5
> perl5.28
> xz
> clang-3.4
> cctools
> libunwind-headers
> llvm-3.4
> llvm_select
> python27-bootstrap
> pkgconfig-bootstrap
> bzip2
> expat
> openssl
> clang_select
> ld64
> ld64-127
> libmacho-headers
> libiconv
> gperf
> libcxx
> gettext
> ncurses
> db48
> gdbm
> readline
rdeps follows all dependencies and doesn't check whether they're
satisfied by something other than the named port. This is arguably a
good thing since it keeps the output consistent regardless of which
ports you have installed. An option to calculate deps like mportdepends
could be a useful feature to add.
> changing it to a path dependency doesn’t help:
>
> depends_run path:bin/perl:perl5
That's a relative path and so looks for bin/perl under ${prefix}
specifically. There's only one port that provides that file.
> $ port info llvm-3.4
> llvm-3.4 @3.4.2_12 (lang)
> ...
> Runtime Dependencies: perl5, llvm_select
>
>
> Even sticking a symlink in ${prefix}/bin doesn’t work:
>
> $ sudo ln -s /usr/bin/perl /opt/local/bin/perl
>
> $ which perl
> /opt/local/bin/perl
>
> $ port info llvm-3.4
> llvm-3.4 @3.4.2_12 (lang)
> …
> Runtime Dependencies: perl5, llvm_select
>
>
> What stupid assumption am I making, or what am I doing wrong?
When you actually install, the bin: dependency will be considered
satisfied by /usr/bin/perl.
- Josh
More information about the macports-dev
mailing list