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.
b0b0 --whatb0 listb0 list --tests # List tests
b0 test # Run all tests
b0 test -l # Run all tests, including the long ones
b0 test --what # Report what would build and 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 testsSince 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 --helpb0 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 onlyThe 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 browserb0 info mytool
b0 info mypackeval $(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 --helpb0 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 # Cleanb0 log
b0 log -lb0 log -db0 log -eb0 log -u