# dependencies and OPTIONS



## tommyhp2 (Apr 13, 2021)

Hello everyone,

I'm looking to improve the manageability, IMO, of ports.  However, I'm in need of advises to overcome some challenges I'm encountering.

This tool gives a very nice tree view.  Since you could have different (poudriere) 'sets' and make.conf file(s), this manual usage becomes troublesome and tedious:

setting the appropriate config to match poudriere
make.conf file(s)
OPTIONS

reverting to desired main default state
prone to errors or incorrect information when you have more than 20 (main) ports to build with different sets (options)
`poudriere jail` command doesn't support make.conf and sets like `poudriere bulk`.  Thus, I'm unable to leverage `jexec`.

Is it possible to specify the 'make.conf' file similar KERNCONF and options location instead of default /var/db/ports?
In short, I'm looking for a way to spot the issue before it's reported during compilation like this.

Thanks.

[edit]  Looks like that tree tool only provides view of the installed ports.  So it seems that I'll need to parse the recursion of `make all-depends-list`.


----------



## sidetone (Apr 13, 2021)

As for KERNCONF, the jails use the same kernel as the host uses. In other words, KERNCONF and other specific kernel settings are irrelevant to jails. Parameters that don't apply to the Kernel can be set here for the jail's make.conf. Look in the directories related to your jail for this file.

For the makefiles, focus on the SET and UNSET options for overall ports and specific ports.

Something like:

```
OPTIONS_SET= SNDIO OGG \
JABBER IRC CUPS

OPTIONS_SET+= PORTAUDIO XAW3DXFT XVIDEO

OPTIONS_UNSET= PULSEAUDIO PULSE ALSA NAS JACK \
WGET GCC COLORD AVAHI \
TWM XAUTH XBACKLIGHT XGC ICEAUTH \
GDBM BASH GNUTLS NLS \
CANBERRA DOXYGEN PANGO \
VV BONJOUR GG SAMETIME SILC SIMPLE NOVELL OSCAR QQ ZEPHYR \
GNOME GNOMEVFS GCONF HTTPD LIVEMEDIA \
DBUS ATK_BRIDGE AVAHI

audio_sox_UNSET=PNG
audio_sox_SET=WAVPACK
```


----------



## PMc (Apr 13, 2021)

tommyhp2 said:


> Is it possible to specify the 'make.conf' file similar KERNCONF and options location instead of default /var/db/ports?


Those can go anywhere. Most simple is to symlink it to s/w else, but from make.conf it should be PORT_DBDIR.
(Not sure what you want to achieve - I am not using poudriere, but my own shellscripts evaluating the makefiles and building the dependency tree.)


----------



## tommyhp2 (Apr 14, 2021)

sidetone said:


> As for KERNCONF, the jails use the same kernel as the host uses. In other words, KERNCONF and other specific kernel settings are irrelevant to jails. Parameters that don't apply to the Kernel can be set here for the jail's make.conf. Look in the directories related to your jail for this file.


I think you've misunderstood my reference to KERNCONF.  In `/usr/src`, you can specify different kernel configurations for the `make buildkernel` on demand.  So, for ports, ie: `/usr/ports/www/tomcat10: # make MAKECONF=~/my_make.conf` would use that file instead of the global `/etc/make.conf` similarly to how poudriere use the `make.conf` in section 10.5.10.



PMc said:


> Those can go anywhere. Most simple is to symlink it to s/w else, but from make.conf it should be PORT_DBDIR.
> (Not sure what you want to achieve - I am not using poudriere, but my own shellscripts evaluating the makefiles and building the dependency tree.)


I got this so far to list the dependencies based upon the my desired make.conf:


```
./dependencies.sh sysutils/py-salt 1
sysutils/py-salt                3002.6
---------------------------------------------
archivers/libarchive            3.5.1
archivers/liblz4
converters/libiconv             1.16
converters/p5-Encode-Locale             1.05
converters/p5-Text-Unidecode            1.30
databases/db5           5.3.28
databases/gdbm          1.19
databases/py-sqlite3            ${PYTHON_PORTVERSION}
databases/sqlite3
devel/apr1              ${APR_VERSION}.${APU_VERSION}
devel/autoconf          2.69
devel/autoconf-wrapper          20131203
devel/automake          1.16.3
devel/bison             3.7.5
devel/boehm-gc          8.0.4
devel/cmake
devel/cvsps             2.1
devel/gettext-runtime
devel/git
devel/gmake             4.3
devel/jsoncpp           1.9.4
devel/kyua              0.13
devel/libatomic_ops             7.6.10
devel/libedit           ${EDITVERSION}.${EDITDATE}
devel/libffi            3.3
devel/libinotify                20180201
devel/libltdl
devel/libtool
devel/libunistring              0.9.10
devel/libunwind         20201110        # This is the release date on https://download.savannah.gnu.org/releases/libunwind/
devel/libuv
devel/lutok             0.4
devel/m4                1.4.18
devel/mercurial         5.5
devel/meson             0.57.1
devel/ninja             1.10.2
devel/npth              1.6
devel/p5-B-COW          0.004
devel/p5-Capture-Tiny           0.48
devel/p5-Clone          0.45
devel/p5-IO-HTML                1.001
devel/p5-Inline         0.86
devel/p5-Inline-Files           0.71
devel/p5-Locale-libintl         1.32
devel/p5-Parse-RecDescent               1.967015
devel/p5-Sub-Uplevel            0.2800
devel/p5-Term-ReadKey           2.38
devel/p5-Test-Deep              1.130
devel/p5-Test-Exception         0.43
devel/p5-Test-Fatal             0.016
devel/p5-Test-Needs             0.002006
devel/p5-Test-NoWarnings                1.04
devel/p5-Test-Warn              0.36
devel/p5-TimeDate               2.33
devel/p5-subversion
devel/pcre2             10.36
devel/pkgconf           1.7.4
devel/py-Jinja2         2.11.2
devel/py-apipkg         1.5
devel/py-atomicwrites
devel/py-attrs          20.3.0
devel/py-babel          2.9.0
devel/py-cffi           1.14.5
devel/py-coverage               4.5.4
devel/py-csv23          0.3.2
devel/py-dateutil               2.8.1
devel/py-flaky
devel/py-freezegun              1.0.0
devel/py-genty          1.3.2
devel/py-hypothesis             5.49.0
devel/py-invoke         1.5.0
devel/py-iso8601                0.1.12
devel/py-mock           3.0.5
devel/py-more-itertools         8.7.0
devel/py-msgpack                1.0.2
devel/py-nose           1.3.7
devel/py-pip            20.2.3
devel/py-pluggy         0.13.1
devel/py-pretend                        1.0.9
devel/py-py             1.9.0
devel/py-pyasn1         0.4.7
devel/py-pyasn1-modules
devel/py-pycparser              2.20
devel/py-pyinotify              0.9.6
devel/py-pympler                0.4.2
devel/py-pytest         4.5.0
devel/py-pytest-cov             2.9.0
devel/py-pytest-forked          1.0.2
devel/py-pytest-freezegun               0.4.2
devel/py-pytest-mock            1.10.4
devel/py-pytest-rerunfailures           9.1
devel/py-pytest-runner          2.11.1
devel/py-pytest-timeout         1.3.4
devel/py-pytest-xdist           1.32.0
devel/py-pytz           2020.5
devel/py-scripttest             1.3.0
devel/py-setuptools             44.0.0
devel/py-setuptools_scm         4.1.2
devel/py-six            1.15.0
devel/py-sortedcontainers               2.3.0
devel/py-tox            3.12.1
devel/py-virtualenv             16.7.5
devel/py-wcwidth                0.1.8
devel/py-wheel          0.36.2
devel/py-yaml           5.3.1
devel/py-zope.interface         5.3.0
devel/readline          8.1.${PATCHLEVEL}
devel/ruby-gems         3.0.8
devel/scons             3.1.2
devel/subversion
devel/tcllib            1.20
dns/libidn2             2.3.0
dns/py-idna             2.10
emulators/tpm-emulator          0.7.4
ftp/curl                7.75.0
lang/cython             0.29.21
lang/expect             5.45.4
lang/lua52              5.2.4
lang/p5-Error           0.17029
lang/p5-Try-Tiny                0.30
lang/perl5.32
lang/python39           ${PYTHON_PORTVERSION}
lang/ruby27             ${RUBY_PORTVERSION}
lang/tcl87
math/gmp                6.2.1
misc/dejagnu            1.6.2
misc/getopt             1.1.6
misc/help2man           1.48.1
misc/py-pexpect         4.8.0
misc/py-progressbar             2.5
net/libzmq4
net/norm                1.5r6
net/openpgm
net/p5-IO-Socket-INET6          2.72
net/p5-Socket6          0.29
net/p5-URI              5.07
net/py-libcloud         3.3.1
net/py-pysocks          1.7.1
net/py-pyzmq            22.0.3
net/py-urllib3          1.25.11
ports-mgmt/pkg
print/indexinfo         0.3.1
print/libpaper          1.1.24.4
print/texinfo           6.7
security/ca_root_nss            ${VERSION_NSS}
security/gnupg          2.2.27
security/gnutls         3.6.15
security/krb5
security/libassuan              2.5.4
security/libgcrypt              1.9.2
security/libgpg-error           1.42
security/libksba                1.5.0
security/libtasn1               4.16.0
security/nettle         3.7.2
security/openssl                1.1.1k
security/p11-kit
security/p5-Authen-SASL         2.16
security/p5-Digest-HMAC         1.03
security/p5-GSSAPI              0.28
security/p5-IO-Socket-SSL               2.070
security/p5-Net-SSLeay          1.88
security/pinentry               1.1.1
security/pinentry-curses
security/py-certifi             2020.12.5
security/py-cryptography                3.3.2
        2.9.2
security/py-cryptography-vectors                2.9.2
security/py-openssl             20.0.1
        19.1.0
security/py-pycryptodomex
security/py-service_identity            18.1.0
security/py-trustme             0.7.0
security/rhash          1.4.1
security/trousers               0.3.14
shells/bash                     5.1.${PATCHLEVEL:S/^0//g}
shells/bash-completion          2.11
sysutils/py-distro              1.5.0
sysutils/py-execnet             1.6.0
sysutils/py-filelock
sysutils/py-psutil              5.8.0
sysutils/py-ptyprocess          0.6.0
textproc/docbook                1.5
textproc/docbook-sgml           4.5
textproc/docbook-xml            5.0
textproc/docbook-xsl            1.79.1
textproc/expat2         2.2.10
textproc/iso8879                1986
textproc/libxml2
textproc/libxslt
textproc/libyaml                0.2.5
textproc/p5-Unicode-EastAsianWidth              12.0
textproc/py-chardet             3.0.4
textproc/py-markupsafe          1.1.1
textproc/py-toml                0.10.2
textproc/rubygem-asciidoctor            2.0.12
textproc/sdocbook-xml           1.1
textproc/utf8proc
textproc/xmlcatmgr              2.2
textproc/xmlcharent             0.3
textproc/xmlto          0.0.28
www/libnghttp2          1.43.0
www/p5-CGI              4.51
www/p5-HTML-Parser              3.75
www/p5-HTML-Tagset              3.20
www/p5-HTTP-Date                6.05
www/p5-HTTP-Message             6.28
www/p5-LWP-MediaTypes           6.04
www/p5-Mozilla-CA               20200520
www/py-requests         2.22.0
www/py-tornado          6.1
www/py-werkzeug         1.0.1
www/serf                1.3.9
www/w3m         0.5.3.${SNAPDATE}
=============================================
```
The input can be pkglist used for poudriere or single port.  I was hoping for more in-depth where you can:

view list of all ports to build
view dependency for each port
for input list, each port is required by which main ports
etc...
That above list resolved the `DEFAULT_VERSIONS`, `OPTIONS_SET` and `OPTIONS_UNSET` in the `make.conf` and not the fine tuned configured options (sets) for poudriere in `/usr/local/etc/poudriere.d`.
It's still work in progress and I think I'm making really good progress today


----------



## sidetone (Apr 14, 2021)

I didn't misunderstand about KERNCONF. It's relevant to /etc/make.conf, but irrelevant to the make.conf for jails. Whatever kernel is built for the whole system, is the same kernel that jails use.


----------



## tommyhp2 (Apr 14, 2021)

sidetone said:


> I didn't misunderstand about KERNCONF. It's relevant to /etc/make.conf, but irrelevant to the make.conf for jails. Whatever kernel is built for the whole system, is the same kernel that jails use.


I didn't specify KERNCONF to build for host or jail.  Please read my OP again .  The KERNCONF is the means to use any configuration on demand for compilation, which could also mean for different target (aka cross compile).  You should look into it.  Hence, I'm asking if anyone knows similar flexibility of specifying different make.conf file for the ports.  Example:
`/usr/ports/www/tomcat10: # make MAKECONF=~/dev_make.conf` for development environment or
`/usr/ports/www/tomcat10: # make MAKECONF=~/prod_make.conf` for production environment.  Poudriere has this capability via 'sets'. 

Here's the poudriere reference of sets (options) and make.conf selection combination, specifically section 10.5.9 and 10.5.10.

But there wasn't a way that I could find before to easily get all dependencies, including tree, for each port.


----------



## sidetone (Apr 14, 2021)

tommyhp2 said:


> Is it possible to specify the 'make.conf' file similar KERNCONF and options location instead of default /var/db/ports?





tommyhp2 said:


> The KERNCONF is the means to use any configuration on demand for compilation, which could also mean for different target (aka cross compile).


KERNCONF doesn't need to be confused for use with jails. KERNCONF means Kernel Configuration. It's only used for building the kernel. I was stating that it's not relevant to jails, but only relevant to the primary make.conf.


sidetone said:


> Parameters that don't apply to the Kernel can be set here for the jail's make.conf.


You want other options for jail makefiles (make.conf), and I gave one sample of that.

make.conf(5)

Thread share-your-make-conf-and-src-conf.63544


----------

