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-s, --stageShow this help message and exit
-S, --stage-onlyStage files, skip generation step (step 1 and 3).
-g, --generateOnly stage files, skip dependencies and project generation (only step 3).
-c, --cleanOnly stage files, skip dependencies and project generation (only step 3).
-x, --rebuildClean repo and exit.
-f, --fast-rebuildClean repo before building.
-j JOBS, --jobs JOBSClean repo before building.
--core-percentage COMPILATION_CORESNumber 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-percentagefor msbuild.--msbuild-reniceAlternative 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-reniceForce MSBuild’s compilation processes to Idle priority and to not use cores 0 and 1.
-mpc MEM_PER_CORE, --mem-per-core MEM_PER_COREForce MSBuild’s compilation processes to Idle priority and to not use cores 0 and 1.
-mc MAX_CORES, --max-cores MAX_CORESAmount of memory (in gigabytes) required per-core when determining available cores for repo_build
-q, --quiet-v, --verbose-b, --build-onlyMaximum number of cores to be utilized if container cpu.max returns ‘max’ (default: 32)
--fetch-onlyOnly perform actual building step, skip all others.
--post-build-onlyOnly fetch dependencies (step 1) and stop.
--no-licensingOnly perform post build step, skip all others.
--licensingSkip license gather step (The gather step is on by default).
-e EXTRA_ARGS, --extra-args EXTRA_ARGSPerform license gather step (The gather step is on by default).
-e EXTRA_ARGS, --extra-args EXTRA_ARGSExtra argument to pass directly to build tool. Can be specified multiple times.
-p PLATFORM_TARGET, --platform-target PLATFORM_TARGETExtra argument to pass directly to build tool. Can be specified multiple times.
-t TARGET, --target TARGETExtra argument to pass directly to build tool. Can be specified multiple times.
--use-devenvBuild the specified target (e.g. carb.dictionary.plugin)
--ccacheEnable attempts to search for devenv installation and prefer it over MsBuild on windows. DevEnv seems to handle incremental builds better.
--config [{debug,release}]Use ccache with settings defined in repo.toml [repo_build.distributed_build_services].
-d, --debug, --debug-onlyrelease or debug, or both, e.g.: –config release debug
-r, --release, --release-onlyBuild the “debug” configuration.
--abi ABIBuild the “debug” configuration.
--enable-asanSets the abi token that can be used to filter linbuild docker images to target specific glibc versions.
--compiler-toolset COMPILER_TOOLSETEnable -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.
Specify a different compiler toolset for the host. Supported options: clang (default on MacOS) gcc (default on Linux) msc (default on Windows)