Is the build-options include flag working?

Can you double-check me? When I do this…

  1. daml new myapp
  2. cd myapp
  3. mkdir daml/app
  4. mkdir daml/test
  5. mv daml/Main.daml daml/app/Main.daml
  6. echo "module MainTest where" > daml/test/MainTest.daml
  7. Edit the daml.yaml file to match the below, with source: set to daml/app and the addition of a build-options: flag for daml/test.
  8. daml build
  9. daml damlc inspect-dar .daml/dist/myapp-0.0.1.dar
sdk-version: 2.5.3
name: myapp
source: daml/app
# init-script: Main:setup
version: 0.0.1
dependencies:
  - daml-prim
  - daml-stdlib
  - daml-script
build-options:
  - --include=daml/test

… I expected the dar file to include the MainTest module. It does not. I’m not seeing that the --include=daml/test makes a difference.

Am I do something wrong?

:thinking:

I also find that with the above project, the following command does not include the MainTest.daml file in the dar.

daml damlc build --include daml/test

I even tried with sdk-version: 1.18.3. Same behavior.

Created The damlc --include flag is not used · Issue #16493 · digital-asset/daml · GitHub

Take a look at Behaviour of relative paths in `source:` in multi-dar projects - #6 by cocreature

In short: --include modifies the include path in which modules are searched. But it does not modify the root modules from which the search starts. So unless one of the root modules pulls in a file in your include path it’s not going to be include.