DAML_PROJECT not working with `daml start`

If I have a DAML project at path example I can build from anywhere using `DAML_PROJECT.

DAML_PROJECT=example daml build

However, it seems I cannot start it using the same approach.

DAML_PROJECT=example daml start

gives the following error:

daml-helper: ConfigFileInvalid "project" (InvalidYaml (Just (YamlException "Yaml file not found: example/daml.yaml")))

Is this intentional or a bug?

Also, I could not find reference to DAML_PROJECT in the docs. Did I miss it or is it not a supported and hence discouraged feature?

Hi @Tamas_Kalcza,

DAML_PROJECT hasn’t really been treated as a public interface until now, hence the lack of documentation. Its primary function is as a means of communication between daml-assistant (the program that is invoked when you run a daml command and that deals with SDK versions) and daml-helper (the program that is part of the SDK and actually knows how to run most of the commands).

That said, this is clearly a bug in either daml or daml start. Also, since there aren’t any good alternatives to DAML_PROJECT, it really should be promoted to a public interface and well documented. I’ve added a GitHub issue to track both of these: Running `daml start` with relative `DAML_PROJECT` fails. · Issue #6977 · digital-asset/daml · GitHub

For now, you can get around this issue by passing an absolute path in DAML_PROJECT.

[For daml build there is an alternative way to specify the project path, namely daml build --project-root=PATH, but this should not be preferred over DAML_PROJECT, because it can cause SDK version inconsistencies unless you set the SDK version explicitly via DAML_SDK_VERSION.]

2 Likes

Update: This issue has been fixed and should be in the latest snapshot release, as well as the next stable release (1.5.0). I also added a regression test to prevent the issue from cropping up again. Please see issue #6977 for details.

1 Like

To save other people a couple minutes of cross-referencing dates, by “the latest snapshot” here @Sofia_Faro means 1.5.0-snapshot.20200818.5027.0.1b33d374. To test it, you can install it with

daml install 1.5.0-snapshot.20200818.5027.0.1b33d374
2 Likes