In December 2019, I blogged about a package manager for Delphi that I am working on. This post is
a progress update that shows where it's at and what's left to do to get to v1.
DPM Recap
For those not familiar with what I am trying to achieve here, I highly recommend reading my original
Delphi Package Manager RFC post. In that post I detailed my ideas, and some of the challenges that Delphi presents when compared to other development environments.
In December 2019, the bare bones of DPM were there. We had a command line tool and that was it. We were able to create packages, install packages (and their dependencies) and restore them
(restore ensures all referenced packages are present). Oh and we could list the available packages in our package feed (a folder).
IDE Integration
In the last 13 months there were around 175 commits to the DPM repository. In that time I have added an IDE plugin (that works in Delphi XE2 to 10.4). This involved the creation of several
custom controls (I wasn't able to bend any existing ones to work how I wanted it to).
In addition to the work in the project repository, I also published several useful libraries that I needed for this
project. DPM is now bootstrapped, to build DPM you need DPM, as it requires several libraries that are referenced as dpm packages.
In Nov 2020 I published the first alpha release that included an installer (code signed by VSoft Technologies) for installing both the command line tool and the IDE plugin (single
installer, you can choose which IDE versions to install for). The installer allows you to install for the current user, or for all users (requires elevation to install).
I also did a zoom presentation about DPM to the Melbourne chapter of the Australian Delphi Users Group - a recording of that (long) presentation can be found here.
Adding IDE support for DPM was a massive undertaking. I had very little experience in developing Delphi IDE plugins (using the tools api) - and there were lots of subtle changes between
delphi versions, getting things working correctly in 12 versions of Delphi was not easy. In particular, with the later versions of Delphi IDE that use VCL themes, getting things to look
right (ie like a native part of the IDE) was a challenge.
The above image shows the installed packages for one of the projects in the project group, you get to this view by right clicking on the project node, or the DPM Packages node in the
Project tree.
Note the view only shows the directly installed packages, not the transient dependencies - those you can see in the project tree under the DPM Packages node.
Before you can use DPM in the IDE, you need to configure a package source (a folder where your package files will live)
This can be done fron the command line
dpm sources add -name=local -source=path to the folder you created
Or from the IDE Settings
Compile during install
The most recent updates added support for compiling packages during first install. Packages need to declare how to build in their dspec file, and dpm will use that and call msbuild to
compile the packages if needed. DPM also records a bill of materials file (package.bom) in the package cache so that it can tell whether the package needs to be recompiled or not.
On first install, packages that are being compiled during the install process will take a little longer, but on subsequent installs or restores, the process is almost instant (a few ms).
Prior to adding this feature, building dpm on our Continua CI build agents took 13 minutes, much of which was taken up with compiling the dpm packages that it references (in particular,
earlier versions of Delphi were very slow with spring4d). Since updating dpm on our agents with the new version, the entire build process for DPM (console app and 12 versions of the IDE
plugin and the installer) takes less than 2 minutes.
Missing features
Project group support
When installing packages, the dependency resolution code does not know about other projects in the project group, or what packages and versions they reference. This
will be a problem for packages that include design time components that need to be loaded - the IDE can only load 1 version of a design time package. This is what I am currently working
on.
Design time packages
DPM does not currently install design time packages into the IDE. This is dependent on project group support, so it's next on the list after project group support.
Package Updates
The ability to detect when package updates are available and make it easy to install those updates. There's an Updates tab in the IDE but it's non functional at this time.
Package Repository
In it's current state, DPM only supports folder based package feeds. This works fine, but it does have some limitations
- Limted search abilities - limted to searching on the package filenames.
- You have to download packages to a folder.
- Package Authors have to host the package files somewhere (mine are under releases on their github projects).
I have made a start on the Package Repository, but not a lot of progress since I'm focusing on the client site right now.
Q & A
Is it usable?
In it's current state, it's only usable for non visual libraries. As I mentioned, the DPM projects all use DPM themselves, and
we have DPM actions in FinalBuilder for running the Pack and Restore commands.
If you use any of my open source libraries like DUnitX, Delphi Mocks etc, I have created packages for all of those libraries, and also
created mirror projects (just for hosting the package files) for some other popular libraries like Spring4D.
I would encourage library authors in particular to take a look and provide feedback.
Where can we find it?
DPM is an open source project on GitHub, the installer can be found under Releases
(under each release, there is an Assets dropdown section).
What versions of Delphi does it support?
Delphi XE2 to 10.4.2 - note that we compile with the latest updates installed for each compiler version.
Why is it taking so long?
Yes, someone asked that recently! This is a side project, free and open source. My primary focus is on running my business and working on our products (that keeps the lights on).
Can we sponsor the project?
Not right now, however it's something I'll look at in the future.
Can we help?
Absolutely. Fork the project on GitHub and clone it to your dev machine and spend some time getting to know the source code. Before making any pull requests, create an issue on github
to discuss your ideas and make sure we on the same wavelength!