Using old SDK version
How do I use an old version of the DAML SDK? I’ve tried all the relevant options for daml install, for example
❯ daml install --install-assistant=yes 1.2.0
SDK version 1.2.0 is already installed.
Activating assistant version 1.2.0
That looks promising, but then daml version gives me
DAML SDK versions:
1.2.0
1.3.0 (not installed)
1.4.0-snapshot.20200715.4733.0.d6e58626 (default SDK version for new projects)
What I really want to do is run daml sandbox with version 1.2.0 but running this always uses the snapshot version above.
I don’t have a daml.yaml file in the directory I’m running this in.
You can set the DAML_SDK_VERSION environment variable, e.g., DAML_SDK_VERSION=1.2.0 daml sandbox will run version 1.2.0. By default, the newest installed SDK will be used outside of a project.
Ah thank you!
DAML_SDK_VERSION=1.2.0 daml sandbox
did the trick.
A post was split to a new topic: Why does --project-root not pick up the SDK version of the project?
Is this still the go-to way to use an earlier version? I noticed the --activate flag for the daml install command, but it says it’s deprecated and the --install-assistant=yes flag suggested in the deprecation notice doesn’t have the same effect.
You shouldn’t need either of those. Setting DAML_SDK_VERSION should be all that’s needed.
Ok. Once I created a project with DAML_SDK_VERSION=1.14.0 daml new create-daml-app --template create-daml-app (I have a 1.15.x snapshot version installed) is the DAML_SDK_VERSION variable needed to run the commands or will the daml assistant pick up the Daml version from the daml.yaml file?
The assistant will pick it up from daml.yaml. You only need to set the env var if you’re working outside a project (like for daml new) or if you want to override the version set in daml.yaml.