Handling external `*.dar`s in CI
App Development2 posts221 views1 likesLast activity Feb 2022
LU
LucianoOP
Feb 2022More of a survey than a question, but I’m interested to hear how devs are handling external *.dar dependencies, particularly wrt to CI and build process.
I’ve locally got a lib/ folder and I symlink or drop *.dar files which are daml.yaml dependencies in there.
However, this doesn’t work for our CI on github, because those files don’t exist. They need to be fetched from somewhere.
I would rather avoid checking-in the *.dar files into the source tree.
RI
Richard_Kapolnai
Feb 2022In some refapps, we fetch the code and build them in the make command:
digital-asset/ex-bond-issuance/blob/9a68bce68e0da516dce586c2b6c914497a2776c4/Makefile#L27
- install-python-dependencies:
- cd scripts && pipenv sync
-
- ### DARS ###
-
- .PHONY: build-dars
- build-dars: $(MODELS_DAR) $(TRIGGERS_DAR)
-
- DAML_SRC=$(shell find src/ -name '*.daml')
-
- $(FINLIB_DAR):
- scripts/getfinlib.py $(SDK_VERSION)
-
- $(MODELS_DAR): $(DAML_SRC) daml.yaml $(FINLIB_DAR)
- daml build --output $@
-
- TRIGGERS_DAML_SRC=$(shell find triggers/src/ -name '*.daml')
-
- $(TRIGGERS_DAR): $(TRIGGERS_DAML_SRC) triggers/daml.yaml $(MODELS_DAR)
- cd triggers && daml build --output ../$@
-
github.com
digital-asset/ex-bond-issuance/blob/9a68bce68e0da516dce586c2b6c914497a2776c4/scripts/getfinlib.py
#!/usr/bin/env python3
#
# Copyright (c) 2019, Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Produces dar file `target/finlib-master-sdk-{daml_sdk_version}.dar' by fetching the source and building it.
# Arguments: daml_sdk_version
import logging
from io import BytesIO
from os import environ, getcwd, path, chdir, chmod, mkdir
from subprocess import call
from sys import argv
from tempfile import mkdtemp
from zipfile import ZipFile
from shutil import copyfile
# based on 'Cheat Sheet: Writing Python 2-3 compatible code'
# from https://python-future.org/compatible_idioms.html
This file has been truncated. show original