bdep-defau...ions-files(1)

πŸ“¦
version 0.17.0 Β· 2 versions
, in fedora 43, fedora 44, nixos 26.05

πŸ’… bdep-default-options-files β€” specifying default options

okay bestie, welcome to the bdep-default-options-files page from the General Commands Manual πŸ’– this one is short but it's IMPORTANT, so grab your strawberry drink and let's get into it ✨

πŸŽ€ NAME πŸŽ€

bdep-default-options-files β€” specifying default options


🌸 SYNOPSIS 🌸

bdep command [mode-options] ...

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜• the build2 toolchain does NOT do the whole "separate config file format" thing for tool configuration. nope. instead it uses default options files, and those files contain literally the exact same options you could type on the command line. no cap. they're like the options files you can hand over with --options-file (that's a bdep-common-options(1) situation, go look it up iykyk) β€” except these ones get loaded by default. automatic. no asking. πŸ’…

so where do we even find them? πŸ‘€ the default options files get searched for in the .build2/ and .build2/local/ subdirectories of each outer directory, starting from the start directory and going up until you hit either the home directory or the filesystem root directory β€” and bestie, both of those are excluding. like, we stop before them, we do not include them, okay? 🌈

then after all that: the .build2/ subdirectory of the home directory, and finally the system directory (for example /etc/build2/) if it's configured. that's the full tour ✨

once the search is done, the files get loaded in reverse order, which means:

  1. starting from the system directory (if there is one),
  2. then the home directory,
  3. ending with the start directory,
  4. and finishing off with the options you actually typed on the command line.

in other words: generic first, specific last, and the command line options are the final boss πŸ‘‘ they can override any value that came from the default options files. periodt.

the start directory, the names of the default options files, and the order they get loaded within each directory? all determined by the command itself and potentially its mode-options. so check each command's own DEFAULT OPTIONS FILES section for the deets. every command has its own vibe 🫢

if a default options file contains --no-default-options, then the search stops right at the directory containing that file, and no outer files get loaded. done. shut it down πŸ’€ and if you pass that option on the command line? then NONE of the default options files get searched for or loaded at all. zero. none. nada.

you can also point at an extra directory of default options files with --default-options. here's how that plays out:

  • if that directory is a subdirectory of the start directory, or it sits somewhere between the start directory and the end of the outer search β€” then its configuration files get loaded at the corresponding point in the directory hierarchy. very tidy. very on brand ✨
  • otherwise, they get loaded after the home directory.

now, a lil security moment πŸ”’ the presence of the .git filesystem entry makes the default options files in that directory and any of its subdirectories count as remote. depending on the command, some security-sensitive options may be disallowed, or may trigger a prompt, when they show up in remote options files. and ngl, in the current implementation this is the case even for files from the .build2/local/ subdirectory β€” because the mere location is not enough to definitively conclude the file isn't remote. to be actually sure, you'd have to go query the version control system. so yeah, we're being cautious 🧚

also note: additional default options files you specify with --default-options are never considered remote. they're safe, they're chill, they're not the problem πŸ’œ

and if you're the type who needs to see the receipts πŸ‘€ the order in which the default options files are loaded gets traced at verbosity level 3 (that's the -V option) or higher. crank it up and watch it go 🌟


πŸ’€ BUGS πŸ’€

found a bug? send bug reports to the users@build2.org mailing list. they'll handle it, fr fr 😭


Copyright (c) 2014-2024 the build2 authors.

Permission is granted to copy, distribute and/or modify this document under the terms of the MIT License.


and that's the whole page, bestie πŸŽ€ this was bdep 0.17.0, dated June 2024 β€” go forth and configure your defaults like the main character you are πŸŒˆβœ¨πŸ’–

πŸ“¦ where this page comes from