#23525OPEN Issue
`dpm test --files` should resolve paths relative to the package root
0xNeshi21-10-2026
<!--
I confirm that, if this is a feature request that has security implications, I already contacted security@digitalasset.com and followed the [responsible disclosure policy](https://digitalasset.com/security/).
I confirm that this is not a question or a request for technical support by the community, for which the [Daml forum](https://discuss.daml.com/) is available.
-->
What is the problem you want to solve?
When I set the package with --package-root or DAML_PACKAGE, dpm test --files still resolves the file path relative to the current directory. Thus, I must write the package root two times.
This works:
DAML_PACKAGE=test/some-package-test/ dpm test --files test/some-package-test/daml/Path/To/File/Test.daml
This fails:
$ DAML_PACKAGE=test/some-package-test/ dpm test --files daml/Path/To/File/Test.daml
...
File: /home/user/repos/project/daml/Path/To/File/Test.daml
Hidden: no
Range: 1:1-2:1
Source: compiler
Severity: DsError
Message:
/home/user/repos/project/daml/Path/To/File/Test.daml: openBinaryFile: does not exist (No such file or directory)
damlc: Error when running Shake build system:
BadDependency "GeneratePackage"
What is the solution you would propose?
If --package-root or DAML_PACKAGE sets the package, resolve a relative path in --files relative to the package root.
If the file is not in the package, show a clear error that gives the package root and the resolved path. The current error (BadDependency "GeneratePackage") does not tell the user what is wrong.
Describe alternatives you've considered
- Write the full path from the current directory. This works, but the path repeats the package root.
cdinto the package and use a path relative to it. This makes--package-rootandDAML_PACKAGEunnecessary for this use case.
Additional context
SDK version: 3.5.8 dpm version: 1.0.22