Azure pipeline installing daml sdk issue

Hi,
I have a pipeline for azure repo, I set a daml test after merging commit to master branch but on the process of installing daml sdk it got stuck on this

Waiting for SDK installation lock /home/vsts/.daml/sdk/.lock

and pipeline gets failed after long stuck.

Here is my pipeline code :

trigger:
- master

pool:
  vmImage: ubuntu-20.04

steps:
- script: echo Hello, world!
  displayName: 'Run a one-line script'

- script: |
    sudo apt-get update
    sudo apt-get install -y make
    #sudo apt-get install build-essential
    curl -sSL https://get.daml.com/ | sh
  displayName: 'Install environment'
- script: |
    export PATH="$PATH:$HOME/.daml/bin"
    cat ~/.bashrc
    daml version
    make build
    daml test

Let me know what needs to be done on this to fix the issue. Thanks

Here is the screenshot of my pipeline erorr

Thanks

Hi @ariscatan,

Under Azure Pipelines, you’re not supposed to write outside of the project directory. There is also no guarantee that the pipeline runner is fresh (it could be reused from one of your other runs of the same pipeline), and if it isn’t, only the Build.StagingDirectory folder is guaranteed to be cleaned up.

With that in mind, I can suggest two solutions:

  1. add a rm -rf /home/vsts/.daml before the curl install line. That way, if there’s anything there, you’ll be sure to get rid of it.
  2. add a export DAML_HOME="$(Build.StagingDirectory)/daml" line before the curl command, and then change your PATH line accordingly (i.e. to export PATH="$PATH:$(Build.StagingDirectory)/daml/bin"). You may need to also set DAML_HOME in your other scripts to match.

Let me know if either of those works for you.

1 Like

Thank you I will apply this solution. Thanks

Hi @Gary_Verhaegen
I made it working by adding

cd ~

since the azure pipeline is on different directory which has root permission or so, which a sudo user cannot do execution

Here is my pipeline that works now:

- script: |
    sudo apt-get update
    sudo apt-get install -y make
    sudo rm -rf /home/vsts/.daml
    DAML_HOME="$(Build.StagingDirectory)/daml"
    cd ~
    sudo curl -sSL https://get.daml.com/ | sh
  displayName: 'Install environment'
- script: |
    export PATH="$PATH:$HOME/.daml/bin"
    cat ~/.bashrc
    daml version
    make build-dars
    echo "Running DAML Test"
    daml test
  displayName: 'Install, build and test Daml SDK'

Cheers!

1 Like

Glad you got it working! You probably should remove the sudo part of sudo curl.

2 Likes

Yes will do. Thanks