Ports dependencies

Yeah, I've looked at that several times. Those don't answer the question I have most often which is "what is pulling in {some-port}?"
Yes, I asked this many times. Now I have some scripting that builds my ports, and it creates the dependency tree on the way, so there is an output file with that information.
Basically you go into the port's dir under /usr/ports (which is shown in pkg info [I]portname[/I]), and there do
Code:
# for i in PKG EXTRACT PATCH FETCH BUILD LIB RUN; do
> make -V ${i}_DEPENDS
> done
This gives a bunch of required ports; do the same for each of them, and make a dependency graph from that.

I do it with awk. That one invokes make config-conditional on the way (because dependencies vary with different port options).
Further down it builds the whole crap. It does NOT trust in a downloaded Index file, it does NOT trust in make automatically invoking builds of prerequisites, it does NOT build a port with other things installed that are not needed by this specific port. Which means, it runs a stack of ZFS snapshots up and down and re-installs the already built packages as required.

One thing I have not yet figured out is: if something with a port changes, which and how many of the dependent ports should be recreated? Because, there are often small changes on some widespread libs, or an option is changed - and then usually the whole gang of llvm13 and rust and all the graphics stuff gets recreated. That is not a real problem, but my server gets noisy when running full load.
 
Last edited:
Please share the output you get when trying to make a port.
Excuse me, this happens to me which around the majority of ports. In previous installations also. Now I won't leave pkg for nothing! Even if the ports are fine, I prefer pkg. Or, if it is a program that I want exclusively from ports, after doing pkg ins portmaster && portsnap fetch auto && portsnap fetch update, well, the case is different. Sorry if this appears from a quote inside a quote. I have no experience in the system right now... In fact, I am installing something for programming. Who knows what monster I make :-/
 
Portgraph depends on what you set the configuration options to, no matter if it's from ports or packages. …

I assume that portgraph can not take account of files written by poudriere-options(8), true?

<https://github.com/freebsd/poudriere/wiki/poudriere-options.8>

Code:
% ls -hl /usr/local/etc/poudriere.d/options/
total 1
drwxr-xr-x  2 root  wheel     3B 24 Jan 01:06 devel_libvirt
drwxr-xr-x  2 root  wheel     3B  1 Apr 02:22 editors_libreoffice
drwxr-xr-x  2 root  wheel     3B 10 Nov 03:01 emulators_wine
drwxr-xr-x  2 root  wheel     3B 23 Dec 15:03 multimedia_webcamd
drwxr-xr-x  2 root  wheel     2B 25 Jan 10:16 net_samba413
drwxr-xr-x  2 root  wheel     3B  4 Mar 04:59 www_chromium
drwxr-xr-x  2 root  wheel     3B 23 Dec 23:28 www_falkon
% cat /usr/local/etc/poudriere.d/options/multimedia_webcamd/options
# This file is auto-generated by 'make config'.
# Options for webcamd-5.13.2.8
_OPTIONS_READ=webcamd-5.13.2.8
_FILE_COMPLETE_OPTIONS_LIST=COMPAT32 DEBUG DVB INPUT KEYBOARD MOUSE RADIO V4L2LOOPBACK VT_CLIENT VT_SERVER WEBCAM
OPTIONS_FILE_SET+=COMPAT32
OPTIONS_FILE_SET+=DEBUG
OPTIONS_FILE_SET+=DVB
OPTIONS_FILE_SET+=INPUT
OPTIONS_FILE_UNSET+=KEYBOARD
OPTIONS_FILE_UNSET+=MOUSE
OPTIONS_FILE_SET+=RADIO
OPTIONS_FILE_SET+=V4L2LOOPBACK
OPTIONS_FILE_UNSET+=VT_CLIENT
OPTIONS_FILE_UNSET+=VT_SERVER
OPTIONS_FILE_SET+=WEBCAM
%
 
Regular ports options might be in /var/db/pkgs/ or /var/db/ports/. Does Poudriere have its own? If portgraph can use a custom directory for displaying.

It should be doable in the console of a Bastille jail. I don't believe I've tried this, bc I would have remembered it shown in a nested display. Can't try it right now, bc my harddrive went bad or something.
 
Does Poudriere have its own?
It does.
Code:
root@molly:/usr/local/etc/poudriere.d # ls -ld *-options
drwxr-xr-x  316 root  wheel  316 Jan  3  2021 122-release-server-options
drwxr-xr-x  269 root  wheel  269 Nov 20 23:01 13-stable-desktop-options
drwxr-xr-x  184 root  wheel  184 Oct 16 14:20 13-stable-server-options
drwxr-xr-x  422 root  wheel  422 Dec 26 18:54 130-release-desktop-options
drwxr-xr-x  375 root  wheel  375 Feb 23 11:23 130-release-server-options
 
ports-mgmt/portgraph --> https://gitlab.com/lbartoletti/portgraph
-h or --help: Show this help
-l my_dir or --localbase my_dir: Sets my_dir as the directory where ports are located (/usr/ports by default)
So, portgraph can be used with Poudriere and any other jail that has directory. Maybe, making a softlink to /usr/local/etc/poudriere.d/options/, then referencing the specific directory under it would make it more convenient. I missed the directory in the previous post for poudriere's options. I was thinking about it being within the jail, but that is meant to work while being outside of it.

More specifically from portgraph's webpage:
Using a specific local ports, like poudriere:
portgraph -l /usr/local/poudriere/ports/default

Rest of help display from portgraph:
-p my_port or --port my_port: Sets my_port as the port to produce the graph (ports-mgmt/py-portgraph by default).
-b or --build: build-depends-list (if -b or -r is not present, -b is actived by default).
-r or --run: run-depends-list (if -b or -r is not present, -b is actived by default).
-f my_flavor or --flavor my_flavor: Sets the flavor for the port.
-c or --recursion: Sets the maximum recursion.
-u or --url: Adds a link to freshports.
-w or --with-pkg: Since pkg is always required, this is disabled by default. You can enable it with this option.
-a or --all: Build a graph for each port
-v or --verbose: Print the port being traversed
I couldn't find a manpage, so the website and the --help display are where the information about it is at.
 
That directory is a quote from the Portgraph webpage. I also had the correct directory written above as noted in two previous posts. The one from the website was probably symbolic. I don't have my system up and I don't use Poudriere, there could be symbolic links or multiple locations as well. It's nice to know how the options directory could be referenced for different jails, so I had interest in commenting and showing the Portgraph page.

The point was, that Portgraph can be used with Poudriere options by using a custom directory:
-l my_dir or --localbase my_dir: Sets my_dir as the directory where ports are located (/usr/ports by default)
Also, that that a softlink can be made to simply calls to the correct directory and subsequent subdirectories, and that Portgraph had consideration for use with Poudriere.
 
I mean, I assume that Portgraph can not take account of the contents of the directory that's used by poudriere-options(8), which is (by design) separate from the directory where ports are located.
 
I'm not sure you read my last two responses.
portgraph -l [location to poudriere's options directory]
This is to use Portgraph on a custom directory, in this case Poudriere's. Portgraph is made for Poudriere's use of options as well as regular ports, even if they listed the wrong directory on their website.

Unless, poudriere-options(8) doesn't set up options in a Poudriere directory anywhere.

Type: portgraph -h
 
-l my_dir or --localbase my_dir: Sets my_dir as the directory where ports are located (/usr/ports by default)

The directory where ports are located (by poudriere) is not the directory where options files are located (by poudriere); see the /usr/local/etc/poudriere.d/options/multimedia_webcamd/options example above.
 
Maybe they put the wrong directory, or maybe it goes to Poudriere's ports, then selects a different directory where options are based on that.

Try the -l option on portgraph with the Poudriere options directories, then, try it where Poudriere's actual ports are.

If it's supposed to be the options directory, which everyone here understands above, then, confirm it, so someone can look it up, or let them know.
 
Code:
root@mowa219-gjp4-8570p-freebsd:/tmp # portgraph -p editors/nano
root@mowa219-gjp4-8570p-freebsd:/tmp # file ./nano && rm ./nano*
./nano: ASCII text
root@mowa219-gjp4-8570p-freebsd:/tmp # portgraph -p editors/nano -l /usr/local/etc/poudriere.d/options
make: chdir /usr/local/etc/poudriere.d/options/editors/nano: No such file or directory
root@mowa219-gjp4-8570p-freebsd:/tmp # portgraph -p editors/nano -l /usr/local/poudriere/ports/default
root@mowa219-gjp4-8570p-freebsd:/tmp # file ./nano && rm ./nano*
./nano: ASCII text
root@mowa219-gjp4-8570p-freebsd:/tmp #

Telling dependencies, without a graph, with DEBUG=on set for multimedia/webcamd:

Code:
root@mowa219-gjp4-8570p-freebsd:~ # poudriere options -n -s multimedia/webcamd
[00:00:00] Working on options directory /usr/local/etc/poudriere.d/options
===> The following configuration options are available for webcamd-5.17.1.0:
     COMPAT32=on: Enable 32-bit compatibility support
     DEBUG=on: Build with debugging support
     DVB=on: Build with USB DVB support (DVB-X, analog TV, ...)
     INPUT=on: Build with USB input support (tablet, joystick, HID, IR, ...)
     KEYBOARD=off: Build with USB keyboard support
     MOUSE=off: Build with USB mouse support
     RADIO=on: Build with USB radio support
     V4L2LOOPBACK=on: Build with V4L2 loopback support
     VT_CLIENT=off: Build with vTuner client support
     VT_SERVER=off: Build with vTuner server support
     WEBCAM=on: Build with USB webcam support (UVC, gspca, ...)
===> Use 'make config' to modify these settings
root@mowa219-gjp4-8570p-freebsd:~ # time poudriere ports -u
[00:00:00] Updating portstree "default" with git+https... done
0.951u 4.890s 0:30.95 18.8%     3254+450k 25360+660io 1652pf+0w
root@mowa219-gjp4-8570p-freebsd:~ # poudriere bulk -j main -b latest -nv multimedia/webcamd
[00:00:00] [Dry Run] Creating the reference jail... done
[00:01:30] [Dry Run] Mounting system devices for main-default
[00:01:31] [Dry Run] Stashing existing package repository
[00:01:31] [Dry Run] Mounting ccache from: /var/cache/ccache
[00:01:31] [Dry Run] Mounting ports from: /usr/local/poudriere/ports/default
[00:01:31] [Dry Run] Mounting packages from: /usr/local/poudriere/data/packages/main-default
[00:01:31] [Dry Run] Mounting distfiles from: /usr/ports/distfiles
[00:01:31] [Dry Run] Copying /var/db/ports from: /usr/local/etc/poudriere.d/options
/etc/resolv.conf -> /usr/local/poudriere/data/.m/main-default/ref/etc/resolv.conf
[00:01:31] [Dry Run] Starting jail main-default
[00:01:31] [Dry Run] Will build as nobody:nobody (65534:65534)
[00:01:33] [Dry Run] Logs: /usr/local/poudriere/data/logs/bulk/main-default/2022-04-13_07h43m01s
[00:01:33] [Dry Run] Loading MOVED for /usr/local/poudriere/data/.m/main-default/ref/usr/ports
[00:01:34] [Dry Run] Ports supports: FLAVORS SELECTED_OPTIONS
[00:01:34] [Dry Run] Inspecting ports tree for modifications to git checkout... yes
[00:01:59] [Dry Run] Ports top-level git hash: 101d4e1e39 (dirty)
[00:01:59] [Dry Run] Gathering ports metadata
[00:01:59] [Dry Run] multimedia/webcamd depends on devel/ccache
[00:01:59] [Dry Run] multimedia/webcamd depends on devel/pkgconf
[00:01:59] [Dry Run] multimedia/webcamd depends on multimedia/v4l_compat
[00:01:59] [Dry Run] multimedia/webcamd depends on ports-mgmt/pkg
[00:01:59] [Dry Run] devel/pkgconf depends on devel/ccache
[00:01:59] [Dry Run] devel/pkgconf depends on ports-mgmt/pkg
[00:01:59] [Dry Run] devel/ccache depends on ports-mgmt/pkg
[00:01:59] [Dry Run] multimedia/v4l_compat depends on devel/evdev-proto
[00:01:59] [Dry Run] multimedia/v4l_compat depends on ports-mgmt/pkg
[00:01:59] [Dry Run] devel/evdev-proto depends on ports-mgmt/pkg
[00:01:59] [Dry Run] Calculating ports order and dependencies
[00:01:59] [Dry Run] Trimming IGNORED and blacklisted ports
[00:01:59] [Dry Run] Package fetch: Looking for missing packages to fetch from pkg+http://pkg.FreeBSD.org/${ABI}/latest
Updating FreeBSD repository catalogue...
[main-default] Fetching meta.conf: 100%    163 B   0.2kB/s    00:01  
[main-default] Fetching packagesite.pkg: 100%    6 MiB   2.2MB/s    00:03  
Processing entries: 100%
FreeBSD repository update completed. 30988 packages processed.
All repositories are up to date.
[00:02:14] [Dry Run] Package fetch: Skipping webcamd-5.17.1.0: options wanted: +COMPAT32 +DEBUG +DVB +INPUT -KEYBOARD -MOUSE +RADIO +V4L2LOOPBACK -VT_CLIENT -VT_SERVER +WEBCAM
[00:02:14] [Dry Run] Package fetch: Skipping webcamd-5.17.1.0: options remote: +COMPAT32 -DEBUG +DVB +INPUT -KEYBOARD -MOUSE +RADIO +V4L2LOOPBACK -VT_CLIENT -VT_SERVER +WEBCAM
[00:02:14] [Dry Run] Package fetch: Will fetch evdev-proto-5.8
[00:02:14] [Dry Run] Package fetch: Will fetch v4l_compat-1.23.0
[00:02:14] [Dry Run] Package fetch: Will fetch 2 packages from remote or local pkg cache
The following packages will be fetched:

New packages to be FETCHED:
        evdev-proto: 5.8 (22 KiB: 19.80% of the 109 KiB to download)
        v4l_compat: 1.23.0 (88 KiB: 80.20% of the 109 KiB to download)

Number of packages to be fetched: 2

109 KiB to be downloaded.
[main-default] Fetching evdev-proto-5.8.pkg: 100%   22 KiB  22.2kB/s    00:01  
[main-default] Fetching v4l_compat-1.23.0.pkg: 100%   88 KiB  89.9kB/s    00:01  
[00:02:14] [Dry Run] Package fetch: Using cached copy of evdev-proto-5.8
[00:02:14] [Dry Run] Package fetch: Using cached copy of v4l_compat-1.23.0
[00:02:14] [Dry Run] Sanity checking the repository
[00:02:14] [Dry Run] Checking for stale cache files
[00:02:14] [Dry Run] Checking packages for incremental rebuild needs
[00:02:14] [Dry Run] Checking packages for missing dependencies
[00:02:14] [Dry Run] Deleting stale symlinks... done
[00:02:15] [Dry Run] Deleting empty directories... done
[00:02:15] [Dry Run] Package fetch: Generating logs for fetched packages
[00:02:21] [Dry Run] Unqueueing existing packages
[00:02:21] [Dry Run] Unqueueing orphaned build dependencies
[00:02:21] [Dry Run] Sanity checking build queue
[00:02:21] [Dry Run] Processing PRIORITY_BOOST
[main-default] [2022-04-13_07h43m01s] [load_priorities:] Queued: 3  Built: 0  Failed: 0  Skipped: 0  Ignored: 0  Fetched: 2  Tobuild: 1   Time: 00:00:48
[00:02:21] [Dry Run] Dry run mode, cleaning up and exiting
[00:02:21] [Dry Run] Would build 1 packages using 1 builders
[00:02:21] [Dry Run] Ports to build: multimedia/webcamd
[00:02:21] [Dry Run] Logs: /usr/local/poudriere/data/logs/bulk/main-default/2022-04-13_07h43m01s
[00:02:21] [Dry Run] Cleaning up
main-default: removed
main-default-n: removed
[00:02:21] [Dry Run] Unmounting file systems
root@mowa219-gjp4-8570p-freebsd:~ #

Condensed:

[00:01:59] [Dry Run] multimedia/webcamd depends on devel/ccache [00:01:59] [Dry Run] multimedia/webcamd depends on devel/pkgconf [00:01:59] [Dry Run] multimedia/webcamd depends on multimedia/v4l_compat [00:01:59] [Dry Run] multimedia/webcamd depends on ports-mgmt/pkg [00:01:59] [Dry Run] devel/pkgconf depends on devel/ccache [00:01:59] [Dry Run] devel/pkgconf depends on ports-mgmt/pkg [00:01:59] [Dry Run] devel/ccache depends on ports-mgmt/pkg [00:01:59] [Dry Run] multimedia/v4l_compat depends on devel/evdev-proto [00:01:59] [Dry Run] multimedia/v4l_compat depends on ports-mgmt/pkg [00:01:59] [Dry Run] devel/evdev-proto depends on ports-mgmt/pkg
 
Thanks you all. The info, born in a simple question, gets into a debate between high status guys. I've learned so much... Well, I only thanks. Weeks had passed since I wrote this post, and... Well, just thanks :)
 
Back
Top