We have a project which has a data dependency dar referenced. While daml build and js bindings are created fine it will not generate the java bindings due to a duplicate module issue within the standard library. Perhaps we have applied it wrong but module-prefixes does not seem to make a difference and the error still occurs.
Error generating code: Duplicate module com.namespace.DA.Next.Map found in multiple packages 9264d7a02cdbcf483d3f60ff0e351b6ccc7a803e8a3b1f96e6beeb31dd390437, 3b85572e240440a547a727b78eff8c13e00ad8a2e579146037dad172365dcb25. To resolve the conflict rename the modules in one of the packages via module-prefixes.
daml-helper: Received ExitFailure 201 when running
The issue is that you are renaming the wrong package. If you look at the error message, you can see the package id it is complaining about. You need to use packagename-packageversion of that package as the key in module-prefixes. One option for figuring that out is to use daml damlc inspect-dar, e.g. as follows (replace the path to the DAR):
Thanks. With that fix in place, in a multi dependency world where each may have been built with different versions of the SDK would we need to prefix each and every one of their standard libs?
How would this behave when we have a nested dependency tree say - A > B > C and B > D and we reference C and D in our dars data-dependencies (again where some may have been built in different SDK versions)
If your DARs contains multiple versions of daml-stdlib you might need to rename multiple ones yes. Keep in mind thought that you should generally structure upgrades such that you don’t keep references to old packages forever. Take a look at the upgrading documentation for an example of how to avoid a direct dependency from your new models on your old models.
Can the priority of this be looked into or a workaround provided. Say we’re on version 2.3.2 and a 3rd party library was built using a pervious version, we effectively cant use it (module-prefixes doesn’t help either).
In our case its purely for data types.
A workaround, if you have access to the 3rd party library source code, is to build it against SDK 2.3.2. We’ll raise the priority of this and work on it in the coming weeks.