Skip to content
CCPEDIAby Unity Nodes
App Development

Invalid SDK config file when running daml build

10 posts310 views1 likesLast activity Nov 2022

  1. TuranOP

    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,

  2. cocreature

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

  3. Turan

    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.

  4. cocreature

    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)

  5. Turan
    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
    
  6. Gary_Verhaegen

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

  7. Turan

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

  8. Gary_Verhaegen

    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
    
  9. Turan

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

  10. Gary_Verhaegen 1
    Gary_Verhaegen:

    curl https://get.daml.com

    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