Environment variables
BuildBox uses several environment variables to work. These variables are kept up-to-date by local environment mechanism, and are influenced by active target settings.
WARNING
Do not write BuildBox environment variables directly, use BuildBox API for that. This is the same for standard environment variables managed by BuildBox.
BuildBox environment variables can be used anywhere, for example for scripting tests, packages distribution.
BuildBox specific variables
It is possible to list only BuildBox environment variables and their values by running:
bbx envHere is a partial list of these variables and their meaning:
BB_TARGET: active target nameBB_PROJECT_DIR: active project base directoryBB_PROJECT_PROFILE_DIR: active project profile directory (.bbx/)BB_PROJECT_SRC_DIR: active project sources directoryBB_TARGET_DIR: active target base directoryBB_TARGET_SRC_DIR: active target sources directoryBB_TARGET_BUILD_DIR: active target build directoryBB_LAST_TARGET: previous active target nameBB_TARGET_VAR_*: target specific variableBB_TOOLS_DIR: tools local clones directoryBB_CACHE_DIR: BuildBox cacheBB_TRASH_KEEP_DAYS: minimum days to keep data in BuildBox trashBB_BUILD_JOBS: concurrent build jobs numberBB_BINDIR: BuildBox public and internal executables pathsBB_DIR: BuildBox sources directoryBB_WORKDIR: project profile directory path (.bbx/), bind-mounted at the same path on both host and containerBB_LAUNCHER_ID: PID of the host-sidebbxlauncher process; used to locate the named pipes for thebb_host_sendmechanismBB_PREBUILT_USERNAME: pre-built target release user name for remote serverBB_PREBUILT_SERVER: pre-built target server addressBB_PREBUILT_PATH: pre-built target remote pathBB_PREBUILT_ONLY_TAGGED: pre-built target 1 to restrict pre-built target generation only to tagged projects, else 0BB_CONFIG: active project configuration file path (.bbx/config)BB_USER_CONFIG: user configuration file path (~/.config/buildbox/config)BB_SYSTEM_CONFIG: system configuration file path (/etc/buildbox/config)BB_USER_CONFIG_DIR: user configuration directory, bind-mounted in the container at its host path; when unset,$XDG_CONFIG_HOME/buildboxis usedBB_SYSTEM_CONFIG_DIR: system configuration directory; when unset,/etc/buildboxis usedBB_LOCAL_ENV_LAST_*: used for local environment cache computation
Target build settings variables
The following variables describe the active target hardware and its toolchain. They are not listed by bbx env:
CPUCPU_FAMILYCPU_DESCRIPTION(do not rely on its value to condition code flow as it is a human-readable string subject to change)CPUDEFCHOST
BuildBox does not know anything about CPU and toolchains: these variables, as well as CFLAGS and LDFLAGS, come from the target build settings of the active target, and default to a native build when the target file does not define them. Add a setting to the target file to change any of them, never write these variables directly.
Standard variables managed by BuildBox
Moreover, BuildBox local environment mechanism keeps up-to-date the following environment variables:
PATHLD_LIBRARY_PATHPKG_CONFIG_PATHACLOCAL_PATHXDG_DATA_DIRSCFLAGS, target build directory and tools include paths, completed with the active target build settings flagsLDFLAGS, target build directory and tools library paths, completed with the active target build settings flagsTMPDIR, a temporary directory under the project profile directory
