diff --git a/triggers/runner/src/main/scala/com/digitalasset/daml/lf/engine/trigger/Runner.scala b/triggers/runner/src/main/scala/com/digitalasset/daml/lf/engine/trigger/Runner.scala index a2789750c7d..b8d544efeee 100644 --- a/triggers/runner/src/main/scala/com/digitalasset/daml/lf/engine/trigger/Runner.scala +++ b/triggers/runner/src/main/scala/com/digitalasset/daml/lf/engine/trigger/Runner.scala @@ -717,9 +717,10 @@ object Runner extends StrictLogging { timeProviderType: TimeProviderType, applicationId: ApplicationId, party: String, + config: Compiler.Config, )(implicit materializer: Materializer, executionContext: ExecutionContext): Future[SValue] = { val darMap = dar.all.toMap - val compiledPackages = PureCompiledPackages.build(darMap) match { + val compiledPackages = PureCompiledPackages.build(darMap, config) match { case Left(err) => throw new RuntimeException(s"Failed to compile packages: $err") case Right(pkgs) => pkgs } diff --git a/triggers/runner/src/main/scala/com/digitalasset/daml/lf/engine/trigger/RunnerConfig.scala b/triggers/runner/src/main/scala/com/digitalasset/daml/lf/engine/trigger/RunnerConfig.scala index 5ba3dcb4a4f..e39cf09702c 100644 --- a/triggers/runner/src/main/scala/com/digitalasset/daml/lf/engine/trigger/RunnerConfig.scala +++ b/triggers/runner/src/main/scala/com/digitalasset/daml/lf/engine/trigger/RunnerConfig.scala @@ -10,6 +10,7 @@ import com.daml.ledger.api.refinements.ApiTypes.ApplicationId import com.daml.ledger.api.tls.TlsConfiguration import com.daml.ledger.api.tls.TlsConfigurationCli import com.daml.platform.services.time.TimeProviderType +import com.daml.lf.speedy.Compiler case class RunnerConfig( darPath: Path, @@ -26,6 +27,7 @@ case class RunnerConfig( accessTokenFile: Option[Path], applicationId: ApplicationId, tlsConfig: TlsConfiguration, + compilerConfig: Compiler.Config, ) object RunnerConfig { @@ -33,6 +35,7 @@ object RunnerConfig { private[trigger] val DefaultTimeProviderType: TimeProviderType = TimeProviderType.WallClock private[trigger] val DefaultApplicationId: ApplicationId = ApplicationId("daml-trigger") + private[trigger] val DefaultCompilerConfig: Compiler.Config = Compiler.Config.Default @SuppressWarnings(Array("org.wartremover.warts.NonUnitStatements")) // scopt builders private val parser = new scopt.OptionParser[RunnerConfig]("trigger-runner") { @@ -98,6 +101,14 @@ object RunnerConfig { } .text(s"Application ID used to submit commands. Defaults to ${DefaultApplicationId}") + opt[Unit]("dev-mode-unsafe") + .action((_, c) => c.copy(compilerConfig = Compiler.Config.Dev)) + .optional() + .text( + "Turns on development mode. Development mode allows development versions of Daml-LF language." + ) + .hidden() + TlsConfigurationCli.parse(this, colSpacer = " ")((f, c) => c.copy(tlsConfig = f(c.tlsConfig)) ) @@ -158,6 +169,7 @@ object RunnerConfig { accessTokenFile = None, tlsConfig = TlsConfiguration(false, None, None, None), applicationId = DefaultApplicationId, + compilerConfig = DefaultCompilerConfig, ), ) } diff --git a/triggers/runner/src/main/scala/com/digitalasset/daml/lf/engine/trigger/RunnerMain.scala b/triggers/runner/src/main/scala/com/digitalasset/daml/lf/engine/trigger/RunnerMain.scala index d9a0aaf3707..f08cb8dd3ce 100644 --- a/triggers/runner/src/main/scala/com/digitalasset/daml/lf/engine/trigger/RunnerMain.scala +++ b/triggers/runner/src/main/scala/com/digitalasset/daml/lf/engine/trigger/RunnerMain.scala @@ -96,6 +96,7 @@ object RunnerMain { config.timeProviderType.getOrElse(RunnerConfig.DefaultTimeProviderType), config.applicationId, config.ledgerParty, + config.compilerConfig, ) } yield ()