b0
, occasionallyThe quick hints if you need to use the b0
tool occasionally.
In b0
the build is organized into named units. Lists of units can be gathered into named packs. A unit can be in more than one pack. In general the repeatable options -u
and -p
allow to select units and packs and -x
and -X
to substract from this selection.
b0
b0 --what
b0 list
b0 list --tests # List tests
b0 test # Run all tests
b0 test -l # Run all tests, including the long ones
b0 test --what # Show what will run
b0 test -u this -u that # Only run the 'this' and 'that' tests
b0 test --seed 123 # Run random tests with seed 123
b0 test --correct # Correct failed snapshot tests
Since tests are executable you can also run them directly. See How do I run build artefacts ?. In particular certain tests may offer specific options, consult them by invoking the test directly.
b0 -- this_test --help
b0 list # Spot the name of the unit you are interested in
b0 -- mytool … # Build mytool and run with arguments.
b0 -- mylib # If mylib is a library gets you in a REPL
b0 -- mymedia # May be configured to render the media
b0 -b -- mytool … # Back to build only
The following forms can be used in order to have up-to-date artefacts but avoiding timing the build.
time $(b0 --path -- mytool) …
hyperfine "$(b0 --path -- mytool) …"
b0 -- .show-url mywebsite
b0 -- .show-url --help # See the different modes of operation
b0 -- mywebsite # May be configured to open in your browser
b0 info mytool
b0 info mypack
eval $(b0 lock)
cd /any/where/
b0 -- mytool …
b0 init src > module.ml # Default has OCaml syntax
b0 init src unit.h unit.c # Uses extensions for syntax
b0 init src -x > example.ml # Uses CC0-1.0 license
b0 init src --help
b0 list # Spot units names or packs you are interested in
b0 -u mylib -p mypack # Build unit mylib and units in mypack
b0 -p mypack -x mytool # Build units in mypack without mytool (if applicable)
b0 delete
b0 delete -a # Clean
b0 log
b0 log -l
b0 log -d
b0 log -e
b0 log -u