Command Line Usage#

usage: build [-h] [-s] [-S] [-g] [-c] [-x] [-f] [-j JOBS] [--core-percentage COMPILATION_CORES] [--msbuild-renice] [-mpc MEM_PER_CORE] [-mc MAX_CORES] [-q] [-v] [-b]
            [--fetch-only] [--post-build-only] [--no-licensing] [--licensing] [-e EXTRA_ARGS] [-p PLATFORM_TARGET] [-t TARGET] [--use-devenv] [--ccache]
            [--config [{debug,release} ...]] [-d] [-r] [--abi ABI] [--enable-asan] [--compiler-toolset COMPILER_TOOLSET]

Build system main command.

Build command does the following:

    1. Fetch dependencies using packman
    2. Generate projects
    3. Stage files (copy files and link folder using prebuild.toml, setup vscode env)
    4. Build projects
    5. Run post-build commands (if specified)

This is done for both "release" and "debug" configuration.

Use various flag to control which steps you want to be executed.

By default host platform is used as target platform.

Options:

-h, --help

Show this help message and exit

-s, --stage

Stage files, skip generation step (step 1 and 3).

-S, --stage-only

Only stage files, skip dependencies and project generation (only step 3).

-g, --generate

Only stage files, skip dependencies and project generation (only step 3).

-c, --clean

Clean repo and exit.

-x, --rebuild

Clean repo before building.

-f, --fast-rebuild

Clean repo before building.

-j JOBS, --jobs JOBS

Number of parallel compilation jobs for gcc/msbuild. gcc respects this, msbuild will overprovision the host and thrash the host. It is suggested to use --core-percentage for msbuild.

--core-percentage COMPILATION_CORES

Alternative to --jobs. Declare a percentage e.g. --core-percentage=50 == 50 percent of host cores. Included with this is an alternate scheduler for msbuild that reduces host thrashing and thereby ends up with faster compilation.

--msbuild-renice

Force MSBuild’s compilation processes to Idle priority and to not use cores 0 and 1.

--msbuild-renice

Force MSBuild’s compilation processes to Idle priority and to not use cores 0 and 1.

-mpc MEM_PER_CORE, --mem-per-core MEM_PER_CORE

Amount of memory (in gigabytes) required per-core when determining available cores for repo_build

-mc MAX_CORES, --max-cores MAX_CORES

Maximum number of cores to be utilized if container cpu.max returns ‘max’ (default: 32)

-q, --quiet-v, --verbose-b, --build-only

Only perform actual building step, skip all others.

--fetch-only

Only fetch dependencies (step 1) and stop.

--post-build-only

Only perform post build step, skip all others.

--no-licensing

Skip license gather step (The gather step is on by default).

--licensing

Perform license gather step (The gather step is on by default).

-e EXTRA_ARGS, --extra-args EXTRA_ARGS

Extra argument to pass directly to build tool. Can be specified multiple times.

-e EXTRA_ARGS, --extra-args EXTRA_ARGS

Extra argument to pass directly to build tool. Can be specified multiple times.

-p PLATFORM_TARGET, --platform-target PLATFORM_TARGET

Extra argument to pass directly to build tool. Can be specified multiple times.

-t TARGET, --target TARGET

Build the specified target (e.g. carb.dictionary.plugin)

--use-devenv

Enable attempts to search for devenv installation and prefer it over MsBuild on windows. DevEnv seems to handle incremental builds better.

--ccache

Use ccache with settings defined in repo.toml [repo_build.distributed_build_services].

--config [{debug,release}]

release or debug, or both, e.g.: –config release debug

-d, --debug, --debug-only

Build the “debug” configuration.

-r, --release, --release-only

Build the “debug” configuration.

--abi ABI

Sets the abi token that can be used to filter linbuild docker images to target specific glibc versions.

--enable-asan

Enable -fsanitize=address (memory error detection). This is similar to valgrind’s memory error detection, except with a greatly reduced performance impact and the ability to detect stack memory errors. This has a significant performance impact that can reduce processing speed by over 50% and significantly increase physical memory usage. Setting the environment variable ASAN_OPTIONS=halt_on_error=0 will prevent the application from exiting when a memory error is encountered. Setting the environment variable ASAN_OPTIONS=detect_leaks=0 will disable leak detection. If you notice that the printed stack traces on memory leaks are incomplete, try setting the environment variable LSAN_OPTIONS=fast_unwind_on_malloc=0. This disables warnings as errors because asan instrumentation adds some incorrect looking warnings to the build. Note that this will copy libasan.so to the _build directory (because of GCC bug 64234), so this should not be used for release builds. No copy is performed when combining this with –no-docker, so you may encounter runtime linking errors. This should only be used on a clean build.

--compiler-toolset COMPILER_TOOLSET

Specify a different compiler toolset for the host. Supported options: clang (default on MacOS) gcc (default on Linux) msc (default on Windows)