Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ commands:
key: daml-{{ checksum ".circleci/install-daml" }}
paths:
- /home/circleci/.daml
- restore_cache:
key: daml-{{ checksum ".circleci/install-dpm" }}
- run:
command: .circleci/install-dpm
- save_cache:
key: daml-{{ checksum ".circleci/install-dpm" }}
paths:
- /home/circleci/.dpm
- restore_cache:
key: python-deps-{{ checksum "poetry.lock" }}-<<parameters.python_version>>
- run:
Expand Down
6 changes: 6 additions & 0 deletions .circleci/install-dpm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
# Copyright (c) 2017-2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
set -xeuo pipefail

dpm install 3.4.9
4 changes: 4 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# Copyright (c) 2017-2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

watch_dir nix
use flake ./nix
.circleci/install-dpm
47 changes: 47 additions & 0 deletions nix/dpm.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{ pkgs ? import <nixpkgs> {} }:

let
dpmPath = "europe-docker.pkg.dev/da-images/public/components/dpm";
dpmVersion = "1.0.6";
dpmRef = "${dpmPath}:${dpmVersion}";

dpmHashes = {
"x86_64-linux" = "sha256-WFly1i2QRKDV5OIAOaguBrlyTO9zb5MBvZdZy3aZqwo=";
"aarch64-linux" = "sha256-jEYFr7q1EXa1NUF25af39E+ZUqoWLvufIGDdrCnVi60=";
"x86_64-darwin" = "sha256-nUmd3isAUmoehdeqSiak7StA8R2s+tHIvbWI/6PEg1w=";
"aarch64-darwin" = "sha256-WCk/5SYrf9/GSibhqNq24JdGXODLrlp+hlFfn+d45kQ=";
};
dpmHash = dpmHashes.${pkgs.system} or (throw "Unsupported system: ${pkgs.system}");

ociPlatforms = {
"x86_64-linux" = "linux/amd64";
"aarch64-linux" = "linux/arm64";
"x86_64-darwin" = "darwin/amd64";
"aarch64-darwin" = "darwin/arm64";
};
ociPlatform = ociPlatforms.${pkgs.system} or (throw "Unsupported system: ${pkgs.system}");
in
pkgs.stdenv.mkDerivation {
pname = "dpm";
version = dpmVersion;

src = pkgs.stdenv.mkDerivation {
name = "dpm-pull-${dpmRef}.${ociPlatform}";

nativeBuildInputs = [ pkgs.oras pkgs.cacert ];

buildCommand = ''
set -e
echo "Pulling dpm component from ${dpmRef} for platform ${ociPlatform}"
oras pull --platform ${ociPlatform} -o $out ${dpmRef}
'';
outputHashMode = "recursive";
outputHashAlgo = "sha256";
outputHash = dpmHash;
};

installPhase = ''
mkdir -p $out/bin
install -Dm755 $src/dpm $out/bin/dpm
'';
}
1 change: 1 addition & 0 deletions nix/overlays.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
canton-3 = super.callPackage ./canton-3/default.nix {};
daml-protos-2 = super.callPackage ./daml-protos-2/default.nix {};
daml-protos-3 = super.callPackage ./daml-protos-3/default.nix {};
dpm = super.callPackage ./dpm.nix {};
protopack = super.callPackage ./protopack/default.nix {};
})]
1 change: 1 addition & 0 deletions nix/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ let

requiredPackages = with pkgs; ([
# these packages are required both in CI and for local development
dpm
glibcLocales
jq
go
Expand Down