Testing with a demo project

The dpm-git-links-demo project exists to test this feature end to end. It is a small Daml app whose daml.yaml declares two Git DAR dependencies, one under dependencies and one under data-dependencies. If either link fails to resolve, the build fails, which makes the project a self-checking test of Git dependency support.

dependencies:
  - git:github.com/Moonsong-Labs/test-daml-hello#master?path=dist/test-daml-hello-sdk-3.5.2-lf-2.2.dar

data-dependencies:
  - git:github.com/canton-network/splice#release-line-0.6.8?path=daml/dars/splice-amulet-0.1.19.dar

This page covers the quickest path: build dpm-dev, then install, build, and test the demo.

For the full testing details, including every declaration form and the expected output, read the demo README.

Prerequisites

Git DAR support is not in a released dpm yet. Build dpm-dev from the Moonsong Labs fork, branch proposal/git-dependencies-support. You need Go 1.25.0 or later.

git clone --branch proposal/git-dependencies-support git@github.com:Moonsong-Labs/dpm.git
cd dpm
go build -o bin/dpm-dev ./cmd/dpm/
export PATH="$PWD/bin:$PATH"

The first fetch needs network access to github.com. After that the DARs live under ~/.dpm/cache.

Quickstart

From the demo checkout:

dpm-dev install package
dpm-dev build
dpm-dev test

install package fetches both Git DARs and pins the movable refs (master, release-line-0.6.8) to commit SHAs. A later install on already-pinned lines skips the fetch if the cache is warm.

The rewrite of daml.yaml is expected. Restore the unpinned file before you push the demo.

build should produce .daml/dist/dpm-git-links-demo-0.0.1.dar. test runs the scripts in daml/Tests.daml.

To prove the links are doing real work, delete either Git line and build again. Without splice you get Could not find module 'Splice.Amulet'. Without Hello you get Could not find module 'Hello'.

Sample declarations

The demo samples/ folder has the other declaration forms. Quoted refs there are inputs (master, 0.6.10, main). They are not frozen SHAs.

Sample Form
browser-url-tag.yaml GitHub raw URL at a tag, via dpm-dev add dar
browser-url-branch.yaml GitHub raw URL on a branch
browser-url-commit.yaml GitHub blob URL at a commit
artifact-location-alias.yaml @alias under artifact-locations
release-single-asset.yaml GitHub release, one named asset
release-all-assets.yaml GitHub release, every .dar asset

Release samples use Moonsong-Labs/daml-finance (test-release-0.0.6). Splice publishes DARs in the tree, not as release assets.

Known limitations

  • Paste a browser URL into dpm-dev add dar, not into daml.yaml. Reading the file expects a git: line. A raw https:// dependency fails with http dependencies not yet supported.
  • dependencies is stricter than data-dependencies. It requires the same SDK version and LF target across the closure. Splice belongs under data-dependencies in this demo for that reason.
  • To re-resolve from scratch, delete .daml/. For a cold cache, also delete ~/.dpm/cache/git.