Invalid SDK config file when running daml build

What could be causing the below error when running daml build on linux.
$ daml build --debug

Invalid SDK config file:YAML exception:
Yaml file not found: PROJECT_DIR/daml/sdk/sdk-2.3.2/sdk-config.yaml

The daml sdk is under:
/daml/bin (which is on the path and has a daml symlink to the below)

/daml/sdk/2.3.2

sdk-config.yaml - exists in the above directory but its trying to look for it in the project folder instead,

How did you install the SDK? It sounds like you tweaked some paths if it is installed in /daml.

Downloaded tar.gz to /daml/sdk, extracted it, ran install.sh it printed to add /daml/bin to path which I did. daml version prints fine. daml build gets the error. daml build is being run from the project directory.

Can you share the output of daml exec env? (filtering to variables starting with DAML_ is fine if you don’t wan to share everything)

DAML_HOME=/daml
DAML_CACHE=/root/.cache/daml
DAML_PROJECT=
DAML_SDK=/daml/sdk/2.3.2
DAML_SDK_VERSION=2.3.2
DAML_SDK_VERSION_LATEST=
DAML_ASSISTANT=/daml/bin/daml
DAML_ASSISTANT_VERSION=2.3.2

Any specific reason why you’re running this as root and installed daml to /daml? (instead of the default ~/.daml)

This is the setting up of a daml build image. The location is arbitrary and can be changed.

If you’re talking Docker images, I’d recommend going for something along the lines of this:

FROM ubuntu:kinetic
RUN apt-get update \
 && apt-get install -y curl openjdk-11-jre-headless \
 && rm -rf /var/lib/apt/lists/*
ARG VERSION
# This is needed to get the DNS requests
# from Haskell binaries to succeed.
# Otherwise they fail to even resolve localhost.
RUN echo 'hosts: files dns' > /etc/nsswitch.conf
RUN addgroup --system daml && adduser --system --ingroup daml daml
USER daml
RUN curl https://get.daml.com | sh -s $VERSION \
    && printf "auto-install: false\nupdate-check: never\n" >> /home/daml/.daml/daml-config.yaml

ENV PATH="/home/daml/.daml/bin:${PATH}"
WORKDIR /home/daml

I there a version or guidance for if you can’t access the web i.e. from the tar.gz bundle

As a non-root user, this seems to work for me:

TEMP=$(mktemp -d)
cd $TEMP
wget https://github.com/digital-asset/daml/releases/download/v2.4.0/daml-sdk-2.4.0-linux.tar.gz
tar xzf daml-sdk-2.4.0-linux.tar.gz
sdk-2.4.0/install.sh
export PATH=$HOME/.daml/bin:$PATH
cd $(mktemp -d)
rm -rf $TEMP
daml new t
cd t
daml build
1 Like