Some command-line parameters affect the operation of Buck itself, regardless of which subcommand is being run.
Sets the verbosity level of the console output. For example:
buck targets --verbose 10
Disables the build artifact cache.
Overrides settings specified in
.buckconfig. For example:
buck build --config cache.mode=dir ...
--configparameter can be specified multiple times on the same command line. Note, however, that if the same configuration option is specified more than once, Buck uses the last value specified ("last write wins"). For example, the following invocation of
buck buildbuilds the
target, rather than the
target, which was specified earlier on the command line.
# # Build for development? # # No, build for production. # buck build --config 'alias.main=//:dev' --config 'alias.main=//:prod' main
The preferred method of overriding values in
.buckconfigis by using a
.buckconfig.localfile. Overriding values of
.buckconfigfrom the command line makes reproducing builds difficult.
The number of threads that buck should use when executing jobs. This defaults to 1.25 times the number of processors in the system; on systems with hyperthreading, this means that each core is counted twice. The number of threads to use for building can also be set by adding a "
threads" key to the "
build" section of the
The order of precedence for setting the number of build threads (from highest to lowest) is:
- command-line option
- default value
The number of active threads may not always be equal to this argument.
--flagfile /path/to/commandline-args or @/path/to/commandline-args
Additional command-line arguments can be stored in external files (flag files), one argument per line. The arguments in these files can themselves be
@arguments, which would then include a second file's contents as arguments.
# File config/common --verbose
# File config/gcc @config/common --config cxx.cxx=/usr/bin/g++ ...
# File config/clang @config/common --config cxx.cxx=/usr/bin/clang++ ...
buck build @config/gcc foo/bar: buck build @config/clang foo/bar:
Lines in flag files must not have any leading or trailing white space.
The equals sign (
=) separates the specified property and value. There should be no whitespace between the property and equals sign, nor between the equals sign and the value.
We recommend that you use
--flagfilerather than the
@symbol as it is more self-describing.
If Buck is regularly invoked with different sets of arguments, we recommend that you use flag files, as they can be stored in source control, making builds more reproducible.