Buck: read_config()
Support Ukraine. Help Provide Humanitarian Aid to Ukraine.


This is liable to change in the future.

The read_config() function is used to read .buckconfig settings from within a build file.


  • section The first argument is the name of the .buckconfig section with the desired value.
  • field The second argument is the name of the .buckconfig field with the desired value.
  • default (defaults to None) The third argument is a value to return if the desired value is not set in the .buckconfig.


Use read_config() to define a custom config setting to enable address sanitizer:
cflags = []

sanitizer = read_config('cxx', 'sanitizer')
if sanitizer == 'address':

  name = 'example',
  # ...
  compiler_flags = cflags,