Package and build management system for D
Branch: master
Clone or download
dlang-bot Merge pull request #1428 from wilzbach/fix-877
dub run <package> should search the registry on failure
merged-on-behalf-of: Nicholas Wilson <>
Latest commit e52567a Feb 19, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github use xml comments in issue template Nov 29, 2017
bin dub will be build into the bin directory, so that when the dub execut… Mar 19, 2013
changelog dub run <package> should search the registry on failure Feb 16, 2019
examples Add SDL based example project. Jul 12, 2015
scripts Add build type syntax Jul 12, 2018
source dub run <package> should search the registry on failure Feb 16, 2019
.codecov.yml Force CodeCov to be informational only Jul 7, 2018
.editorconfig add .editorconfig Aug 9, 2014
.gitignore Ability to run a single test + output overview log May 8, 2018
.travis.yml Build win{32,64} binaries with LDC Jan 4, 2019 some basic information on the architecture Dec 20, 2017 update version to v1.12.0-beta.1 Oct 16, 2018 generate changelog from fragments (tools/changed) May 1, 2018
Jenkinsfile load ci repo as shared jenkins library Oct 6, 2017
LICENSE Add a MIT License file that can be detected by GitHub Mar 26, 2018 Add a Buildkite badge Jan 4, 2019
appveyor.yml Merge pull request #1575 from dlang/appveyor-disable-nightlies Nov 28, 2018
architecture.graphmlz some basic information on the architecture Dec 20, 2017
architecture.png some basic information on the architecture Dec 20, 2017
build-files.txt Split-up package suppliers into individual modules May 8, 2018 implement $DUB build variable Nov 25, 2018
build.cmd implement $DUB build variable Nov 25, 2018
curl.lib Added files necessary to build on Windows. Feb 22, 2013
dub.sdl implement $DUB build variable Nov 25, 2018
dub.selections.json Bump stdx-allocator version to 2.77.2 Jul 5, 2018 Build win{32,64} binaries with LDC Jan 4, 2019 Use -flto=full for the release builds Apr 6, 2018 Use GDC from Semaphore and upgrade the minimally required host compiler Jul 29, 2018 Merge pull request #1579 from wilzbach/fix-gh-api-bug Nov 28, 2018

dub package manager

Package and build manager for D applications and libraries.

There is a central package registry located at

GitHub tag Travis Coverage Status Buildkite


DUB emerged as a more general replacement for vibe.d's package manager. It does not imply a dependency to vibe.d for packages and was extended to not only directly build projects, but also to generate project files (currently VisualD). Mono-D also supports the use of dub.json (dub's package description) as the project file.

The project's philosophy is to keep things as simple as possible. All that is needed to make a project a dub package is to write a short dub.json file and put the source code into a source subfolder. It can then be registered on the public package registry to be made available for everyone. Any dependencies specified in dub.json are automatically downloaded and made available to the project during the build process.

Key features

  • Simple package and build description not getting in your way
  • Integrated with Git, avoiding maintenance tasks such as incrementing version numbers or uploading new project releases
  • Generates VisualD project/solution files, integrated into MonoD
  • Support for DMD, GDC and LDC (common DMD flags are translated automatically)
  • Supports development workflows by optionally using local directories as a package source

Future direction

To make things as flexible as they need to be for certain projects, it is planned to gradually add more options to the package file format and eventually to add the possibility to specify an external build tool along with the path of it's output files. The idea is that DUB provides a convenient build management that suffices for 99% of projects, but is also usable as a bare package manager that doesn't get in your way if needed.


DUB comes precompiled for Windows, OS X and Linux. It needs to have libcurl with SSL support installed (except on Windows).

The dub executable then just needs to be accessible from PATH and can be invoked from the root folder of any DUB enabled project to build and run it.

If you want to build for yourself, just install DMD and libcurl development headers and run ./ On Windows you can simply run build.cmd without installing anything besides DMD.

Arch Linux

Михаил Страшун (Dicebot) maintains a dub package of the latest release in Community, for x86_64 and i686. Moritz Maxeiner has created a PKGBUILD file for GIT master:

Debian/Ubuntu Linux

Jordi Sayol maintains a DEB package as part of his D APT repository. Run sudo apt-get install dub to install.


Chris Molozian has added DUB to Homebrew. Use brew install dub to install the stable version, optionally adding --HEAD/--devel to install the latest git master or development release respectively.

There is also a MacPorts package available. Type sudo port install dub to install the latest stable version.


Daniel Jost maintains a dub package on chocolatey. Use cinst dub or cinst dub -version #.#.# to install stable or a custom version respectively.

Using DUB as a library

The DUB package of DUB can be used as a library to load or manipulate packages, or to resemble any functionality of the command line tool. The former task can be achieved by using the Package class. For examples on how to replicate the command line functionality, see commandline.d.

Minimal D compiler required to build DUB

In general it is always recommended to build DUB with the latest version of your D compiler. However, currently 2.072 is required to build DUB from source.


New contributers are always welcome, there's plenty to work on! For an easy start, take a look at issues marked bootcamp