How is the order computed for building models in `daml build --all`

I’m using daml build --all to build three models, with the following multi-package.yaml file:

packages:
- ./testv1
- ./testv2
- ./scripts

The only dependency between the three is a dependency of scripts on testv1.

Building with the above file yields the following error:

$ ./build.sh 
target
INFO: Building Daml models.
Running multi-package build of all packages in /Users/mikeschaeffer/daml-interface-simple-demo.

2024-04-03 14:42:49.92 [INFO]  [multi-package build] 
Building /Users/mikeschaeffer/daml-interface-simple-demo/scripts
damlc: ../testv1/.daml/dist/test-0.0.1.dar: openBinaryFile: does not exist (No such file or directory)
File:     /Users/mikeschaeffer/daml-interface-simple-demo/scripts
....

This implies that it’s attempting to build scripts before testv1. If I reverse the ordering, like this, the build progresses properly and succeeds:

packages:
- ./scripts
- ./testv1
- ./testv2

This raises a couple questions:

  • Is it expected that packages are built in the reverse of the order in which they are declared in multi-package.yaml?
  • Does package ordering in daml build --all work for dependencies in general, or just data dependencies?
  • Maybe the most important - What is the proper way to express this sort of dependency to daml build --all?
2 Likes

Hi Michael

Unfortunately this behaviour is a bug, currently multi-build is only respecting data-dependencies for build order. This should be fixed soon.
As for the reverse build order, that is surprising - I’ve not seen this in testing. I will take a look.

1 Like