Daml.Trigger import breaks daml repl session

Following the daml repl documentation with the templated example using daml new script-example script-example, I can add daml-trigger to my dependencies and create A.daml in src/ with contents:

module A where import DA.Trigger

When rebuilding, restarting the sandbox and then (in another terminal) performing daml repl --ledger-host=localhost --ledger-port=6865 .daml/dist/script-example-0.0.1.dar I get the following when trying to use the repl:

daml> import DA.Time
File:     
Hidden:   no
Range:    1:0-100001:0
Source:   compiler
Severity: DsError
Message: 
  <command line>: cannot satisfy --package script-example-0.0.1:
  script-example-0.0.1 is unusable due to missing dependencies:
  daml-trigger-0.0.1
  (use -v for more information)
damlc: Error when running Shake build system:
BadDependency "GhcSession"

Note: I am providing a stripped down repro of the issue which arose elsewhere when I had a repl failure in a project which happened to use triggers.

2 Likes

At the moment, DAML REPL does not support DARs with additional dependencies. This will be fixed in the future. However, there are no plans to support running a trigger from DAML REPL so for this particular example you are probably better off, splitting off your templates into a separate package from your trigger (which you should always do, otherwise modifying your trigger requires upgrading live data on the ledger) and then load the templates DAR into DAML Repl.

1 Like