Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Why does --project-root not pick up the SDK version of the project?Forum ↗

Why does --project-root not pick up the SDK version of the project?

App Development3 posts526 views3 likesLast activity Nov 2020
TA
Tamas_KalczaOP
Nov 2020

I ran into this issue with building a DAML project.

While setting DAML_SDK_VERSION does solve the issue I would have expected this to work as well:

daml build --project-root path-to-my-project

However, it picks up the SDK version I have installed globally.

Thoughts?

CO
cocreature
Nov 2020

This is a bit of an unfortunate consequence of how things are implemented. SDK versions are handled by the assistant which will invoke a tool for a given SDK version (in this case the daml compiler) once the SDK has been installed. However --project-root is handled by the compiler. So by the time we resolve --project-root, we’ve already invoked the compiler binary for a given version.

A way around this is to use the DAML_PROJECT environment variable which is resolved by the assistant itself so it ends up invoking the correct compiler binary.

SO
Sofia_Faro
Nov 2020

Indeed --project-root is problematic because it can’t pick the correct SDK version. Using the DAML_PROJECT environment variable is the correct way to set the project path when using the daml assistant:

DAML_PROJECT="path-to-my-project" daml build
← Back to Discussions