DUB-BUILD(1)
π DUB-BUILD(1) β the D Language Foundation's own build command, explained by your favorite terminal gremlin
okay so bestie, welcome to dub-build(1), fresh from The D Language Foundation. This is the page for dub build β the command that actually builds your package. And yes, by default it uses the main package sitting in your current working directory, like it just knows where you live. main character energy fr fr π
β¨ SYNOPSIS β¨
dub build [<package>[@<version-spec>]] OPTIONS...
that's it. that's the whole vibe. package optional, version-spec optional, options go brrr π¦
πΈ DESCRIPTION πΈ
Builds a package. Uses the main package in the current working directory by default. no cap, that's the entire description and honestly? iconic. short, sweet, to the point π
π₯ OPTIONS π₯
--temp-buildβ builds the project in the temp folder if possible. cozy little temp-dir era β¨--rdmdβ userdmdinstead of directly invoking the compiler. delegation queen π-f,--forceβ forces a recompilation even if the target is up to date. not me rebuilding something that's already fine π-y,--yesβ automatic yes to prompts. assumes"yes"as the answer to all interactive prompts. trust the process π-n,--non-interactiveβ don't enter interactive mode. antisocial mode: activated π«Ά--deepβ build all dependencies, even when the main target is a static library. go deep or go home π--dest=VALUEβ base directory in which output atifacts will be placed. (yes, "atifacts" β I don't make the spelling rules, I just report them π)-b,--build=VALUEβ specifies the type of build to perform. β οΈ heads up: setting theDFLAGSenvironment variable will override the build type with custom flags. the possible names are:
debug, plain, release, release-debug, release-nobounds, unittest,
profile, profile-gc, docs, ddox, cov, cov-ctfe, unittest-cov,
unittest-cov-ctfe, syntax and custom types
so many flavors, pick your fighter π
-c,--config=VALUEβ builds the specified configuration. configurations can be defined indub.json. very customizable, very demure π--override-config=VALUEβ uses the specified configuration for a certain dependency. can be specified multiple times. format is--override-config=<dependency>/<config>β slash-separated, bestie, don't forget the slash πΈ--compiler=VALUEβ specifies the compiler binary to use (can be a path). arbitrary pre- and suffixes to the identifiers below are recognized (e.g.ldc2ordmd-2.063) and matched to the proper compiler type:
dmd, gdc, ldc, gdmd, ldmd
it's giving options, and I'm obsessed β¨
-a,--arch=VALUEβ force a different architecture (e.g.x86orx86_64). architecture? we changing it π-d,--debug=VALUEβ define the specifieddebugversion identifier when building. can be used multiple times. stack 'em up π§--d-version=VALUEβ define the specifiedversionidentifier when building. can be used multiple times. β οΈ use sparingly β with great power comes great responsibility! for commonly used or combined versions, and versions that dependees should be able to use, create configurations in your package instead. fr fr, do it the clean way π--nodepsβ do not resolve missing dependencies before building. we're rawdogging the dependency graph apparently π--build-mode=VALUEβ specifies the way the compiler and linker are invoked. valid values:
separate (default), allAtOnce, singleFile
separate is the default, in case you were wondering π
--singleβ treats the package name as a filename. the file must contain a package recipe comment. one file, one destiny π¦--force-removeβ deprecated option that does nothing. it's literally just vibes at this point π--filter-versionsβ [Experimental] filter version identifiers and debug version identifiers to improve build cache efficiency. experimental means experimental, bestie π§ͺ--combinedβ tries to build the whole project in a single compiler run. efficiency slay π₯--print-buildsβ prints the list of available build types. I love a list π--print-configsβ prints the list of available configurations. another list, we stay winning β¨--print-platformβ prints the identifiers for the current build platform as used for the build fields indub.json. know your platform, love your platform π--parallelβ runs multiple compiler instances in parallel, if possible. multitasking icon π
π COMMON OPTIONS π
see dub(1) β the mothership has the shared deets, iykyk π«Ά
β EXIT STATUS β
0β DUB succeeded. we love a win πΈ1β usage errors, unknown command line flags. oops π2β package not found, package failed to load, miscellaneous error. the "miscellaneous" is doing so much heavy lifting there π
π FILES π
dub.sdldub.json
your recipe files, your whole personality basically π
π AUTHOR π
Copyright (c) 1999-2026 by The D Language Foundation. legends, honestly π
π¦ ONLINE DOCUMENTATION π¦
http://code.dlang.org/docs/commandline β¨β©
go read the docs, bestie, they're free β¨
π SEE ALSO π
dub(1), dub-run(1), dub-test(1), rdmd(1)
the whole friend group, go say hi π«Ά
and that's the whole page, bestie β brought to you by The D Language Foundation, dated 2026-08-16, in the DUB-BUILD(1) era. go build something iconic ππβ¨
π¦ where this page comes from
- arch rolling: dub 1.42.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms