Dub for internal dependency management: Git repo as package supplier?
FeepingCreature
feepingcreature at gmail.com
Wed Jul 31 13:02:10 UTC 2019
We (Funkwerk) are currently using rake as a build system. Since
rake does not offer package management, we have to list all
transitive dependencies of every package, which is obviously not
satisfactory. Because of this, we're looking into switching to
dub and dub.selection.json as a "source of truth" for the used
set of library dependencies.
We're currently using git submodules for local dependencies. If
they were migrated to dub, we'd run into the problem of what to
do while working on a dependency. Often changes to a dependency
only make sense in the context of the project that needs the
dependency, so we have to be able to set dub to use the git
branch that we're working on. However, while this can be made to
work locally by using dub add-override to point dub at a folder
that has the branch checked out, this cannot work on our Jenkins
system because obviously that doesn't have the local folder.
It seems to me that a possible solution would be to be able to
set a git repository as a dub package supplier. Dub would then
check out the repository to .dub/packages/<project>/<git hash>,
and build from there. dub.selections.json could store the commit
hash for reproducible builds.
Since this would require a hefty amount of work on dub to support
git remote repos, I wanted to ask upfront: would such a PR
plausibly be accepted? And in case not, do you have alternate
proposals for D dependency management that won't force us to tag
a repo before using it in another project?
Thanks for your consideration!
More information about the Digitalmars-d
mailing list