tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How does $bob_packages work?



* On 2026-05-18 at 15:35 BST, Benny Siegert wrote:

I updated bob to 0.99.5, and I am trying to convert my existing config.

I noticed that the new default config file, created by "bob init", contains a reference to a "$bob_packages" variable, but I cannot seem to find documentation about it. Am I supposed to set it?

There are a list of standard environment variables, set using the bob_* prefix, that are used by the internal build scripts but also exported to the environment used in actions and hooks:

  https://docs.rs/bob/latest/bob/action/index.html#environment-variables

Many of them are set directly from equivalent pkgsrc variables, and computed once at the start, so for example bob_packages is set to the value retrieved by:

  $ bmake show-var VARNAME=PACKAGES

You don't need to set any of them, they are calculated at the start, and then cached in the database for that build run. The general principle is that you don't need to set anything - configure everything in mk.conf as you normally would for any other build environment, and bob will retrieve anything it needs directly. The only reason they are exposed is because sometimes it's useful to perform some additional sandbox setup that requires them, like the $bob_prefix used by dev sandboxes.

A natural follow-up question would be "why not just use $PACKAGES rather than $bob_packages" and the answer is because setting them directly in the environment like that would wipe out any ?= settings. The separate bob_* namespace keeps everything clean.

Hope that helps. I know the docs aren't ideal right now, I do plan to improve them once I've finished with the code.

--
Jonathan Perkin                    pkgsrc.smartos.org
Open Source Complete Cloud   www.tritondatacenter.com


Home | Main Index | Thread Index | Old Index