Solved Poudriere: illegal option -o on FreeBSD 13.2

Hi,

this is my first post so I hope my thread is in the correct forum.

I'am currently experimenting with poudriere() since I want to serve custom build ports to multiple freebsd machines on our network.
I want to use a "global" options-directory for all of my jails. When reading the main man page of poudriere I figured out I can use the poudriere.d/options directory for all options of my ports I want to build.
I already copied configured options from my other machines from /var/db/ports to poudriere.d/options. I set up a portsnapshot named "MAIN_HEAD".
Now I want to update my options with the following command: sudo poudriere options -c -p MAIN_HEAD -f /usr/local/etc/poudriere.d/core_ports.txt, but then I get this warning message:

Code:
[00:00:00] Warning: You already have options configured without '-p MAIN_HEAD' that will no longer be used.
[00:00:00] Warning: Drop the '-p MAIN_HEAD' option to avoid this problem.
[00:00:00] Are you sure you want to continue? [y/N]

When reading poudriere-options() and poudriere() I saw that if I would answer "yes" in the above output, a new directory called poudriere.d/MAIN_HEAD-options would be created with the updated options.
But that's not what I want so I figured by reading the poudriere-options man page that I can use the -o argument to store my options in another directory.
But when I try using sudo poudriere options -p MAIN_HEAD -f /usr/local/etc/poudriere.d/core_ports.txt -o /usr/local/etc/poudriere.d/options/ I get the following error:

Code:
Illegal option -o
poudriere options [options] [-f file|cat/port ...]

Parameters:
    -f file     -- Give the list of ports to set options
    [ports...]  -- List of ports to set options on

Options:
    -a arch     -- Indicates the TARGET_ARCH if no jail is specified. Such as i386
                   or amd64. Format of TARGET.TARGET_ARCH is also supported.
    -c          -- Use 'make config' target
    -C          -- Use 'make config-conditional' target (default)
    -j name     -- Run on the given jail
    -p tree     -- Specify on which ports tree the configuration will be done
    -n          -- Do not configure/show/remove options of dependencies
    -r          -- Remove port options instead of configuring them
    -s          -- Show port options instead of configuring them
    -z set      -- Specify which SET to use

Looking on my installed man page for poudriere-options I don't see any argument with -o, but when looking at poudriere-options() I see the argument -o. So what's the deal? Why can't I use the -o argument on a fresh installed FreeBSD 13.2?

Is there a better way to accomplish what I want to do?

Kind Regards
 
Looking on my installed man page for poudriere-options I don't see any argument with -o, but when looking at poudriere-options() I see the argument -o. So what's the deal? Why can't I use the -o argument on a fresh installed FreeBSD 13.2?
Manpage on the website here is probably from ports-mgmt/poudriere-devel (the web man page can't differentiate between man pages with the same name). The -devel version has a few extra features that haven't been added to the 'stable' version yet.

It's fairly safe to use the -devel version, with the added caveat that it could contain bugs, it's a development version after all.
 
Manpage on the website here is probably from ports-mgmt/poudriere-devel. The -devel version has a few more features that haven't been added to the 'stable' version yet.
Thank you for your fast response SirDice. So would it be beneficial to install ports-mgmt/poudriere-devel instead? Or do you have another idea how I could use a "global" option directory for all of my jails?
I know that when using poudriere-bulk() it will append the poudriere.d/options to my jail where I bulk configure the port when no other matching option-directory is found.
That wouldn't be a problem since it is what I want to do.

But when trying to update or reconfigure my options in poudriere.d/options with a command like sudo poudriere options -c -p MAIN_HEAD -f /usr/local/etc/poudriere.d/core_ports.txt the options in poudriere.d/options won't be udated and new options in poudriere.d/MAIN_HEAD-options will be created instead. Is there another way to prevent this without using the development version of poudriere?
 
So would it be beneficial to install ports-mgmt/poudriere-devel instead?
If you want to use that feature, then yes.

Or do you have another idea how I could use a "global" option directory for all of my jails?
Yes. You can set/unset options in the make.conf file. In my opinion a lot easier to manage as you can easily see which options are set or unset on which ports.

They work like this (a partial make.conf from my build system):
Code:
devel_cmake_UNSET= DOCS
devel_git_UNSET= GITWEB
devel_py-molecule_SET= DOCKER
math_gmp_SET= CPU_OPTS
net_samba413_SET= MDNSRESPONDER
net_samba413_UNSET= AVAHI CUPS FRUIT
net_samba416_SET= MDNSRESPONDER
net_samba416_UNSET= AVAHI CUPS FRUIT
security_strongswan_SET= CURL GCM KDF SWANCTL VICI
security_sudo_SET= INSULTS
sysutils_cpupdate_SET= INTEL
sysutils_vm-bhyve_SET= BHYVE_FIRMWARE GRUB2_BHYVE
textproc_py-docutils_SET= PYGMENTS
 
One hint that I'm seeing in poudriere-options(8):
Code:
-o port_dbdirname
        Use the    specified directory name to write the options to.
        This name will expand to $POUDRIERE_ETC/$port_dbdirname.  This
        can be used to write options to    a different directory than
        -jpz specify.  The -jpz    flags will be used for the make.conf,
        poudriere.conf,    and ports dir.

Try using the -j, -p, and -z flags, play with values you give them. Refer back to the poudriere-options(8) to figure out what those flags mean.

Yeah, it takes a LOT of reading the manpages and connecting the dots.

Your new command will probably look like something like this:
poudriere-options -j default -p default -z MAIN_HEAD-options... Well, this will only work if set MAIN_HEAD-options is available (via poudriere.d/MAIN_HEAD-options/ directory name)

The way I'm reading this, it sounds like you want to be able to update the options directory in-place... why?

The original /var/db/ports/ directory offers that option, but the nice thing about Poudriere (IMHO) is that I can update a selection of my ports while keeping my options. If I want to recompile my stuff using different Makefile options, I like having the posibility of easily going back to an old config if I mess something up.

The -z option is synonymous with the -o option...

Hope this helps.
 
Thank you for all of your information. I will look into that further on how to configure it properly for my needs.
Yes. You can set/unset options in the make.conf file. In my opinion a lot easier to manage as you can easily see which options are set or unset on which ports.

They work like this (a partial make.conf from my build system):
Code:
devel_cmake_UNSET= DOCS
devel_git_UNSET= GITWEB
devel_py-molecule_SET= DOCKER
math_gmp_SET= CPU_OPTS
net_samba413_SET= MDNSRESPONDER
net_samba413_UNSET= AVAHI CUPS FRUIT
net_samba416_SET= MDNSRESPONDER
net_samba416_UNSET= AVAHI CUPS FRUIT
security_strongswan_SET= CURL GCM KDF SWANCTL VICI
security_sudo_SET= INSULTS
sysutils_cpupdate_SET= INTEL
sysutils_vm-bhyve_SET= BHYVE_FIRMWARE GRUB2_BHYVE
textproc_py-docutils_SET= PYGMENTS

But what about the dependencies of the ports? Some of them I configure too. Do I need to set / unset those options also in the make.conf? If yes that would be big pain going through 100+ dependencies for all the options (although I could use a script copying the values from the options file of each dependency into the make.conf)

Vermaden wrote an interesting guide on poudiere here is the link

https://vermaden.wordpress.com/2023/04/30/simple-freebsd-poudriere-harvester-guide/

Thank you for the link I will look into that!

Try using the -j, -p, and -z flags, play with values you give them. Refer back to the poudriere-options(8) to figure out what those flags mean.

I am not sure about the -z option. I don't use SETs and I actually don't know what they are, but I can atleast try.

astyle said:
The way I'm reading this, it sounds like you want to be able to update the options directory in-place... why?

The original /var/db/ports/ directory offers that option, but the nice thing about Poudriere (IMHO) is that I can update a selection of my ports while keeping my options. If I want to recompile my stuff using different Makefile options, I like having the posibility of easily going back to an old config if I mess something up.

Your assumption is correct. I thought when updating ports and they have new options I need to configure those options. When I need to configure them they should be written to the options in poudriere.d/options/some_port/options.
But that wouldn't work since poudriere would write the option to something like poudriere.d/<jailname><portsnapshot>-options/some_port/options when using poudriere-options(8) with a command like poudriere options -C -j <jailname> -p <portsnapshot> -f /usr/local/etc/poudriere.d/<portlist>

But I don't know how poudriere would behave when updating a port which has a new option and then bulk-building it wihout configuring that option. Where would the option be written to?
 
But what about the dependencies of the ports? Some of them I configure too. Do I need to set / unset those options also in the make.conf?
Only if you actually change any of the options. If there are no changes the default options of the port is used.
 
Ok. Thank you for your information. I guess I need to figure out my concept how I want to work with poudriere in the future.
 
When I need to configure them they should be written to the options in poudriere.d/options/some_port/options.
Not quite how that even works... if you do ls -l /var/db/ports, you'll see that every single port's option is captured in a text file that is straight-out named category_port_options... the -z flag tells Poudriere to look in poudriere.d/ for the directory name...

Need to correct myself... It's /var/db/ports/category_port/options where options really get updated for compilation...

/var/db/ports/ contains a set of files that capture the options... when you copy that set of files to poudriere.d/, you can refer to it by the -z flag. This is why it's actually easier to work with (and refer to) a set of option files.

Try diagramming it out on a piece of paper to visualize where things are.
 
Last edited:
Thank you for your quick explanation about sets. I am still a novice and need to learn more about FreeBSD! I will look into it and try to visualize it.
 
Back
Top