I’m trying to use the --package
build option as per the documentation here to upgrade a contract from one version of a dar to a different version (same package, module and template names).
Hence I have 3 separate projects for this -
- PrimerV1 (that builds to
Primer-0.0.1.dar
) - PrimerV2 (that builds to
Primer-0.0.2.dar
) - UpgradePrimer (build fails)
Upon executing a daml build
on project UpgradePrimer
, I get the following error -
Compiling Primer to a DAR.
File:
Hidden: no
Range: 1:0-100001:0
Source: compiler
Severity: DsError
Message:
<command line>: cannot satisfy --package Primer-0.0.2 with (Assets.AssetTypes as V2.AssetTypes,
Managers.CoinManager as V2.Managers)
(use -v for more information)
ERROR: Creation of DAR file failed.
The daml.yaml
for project UpgradePrimer looks like the following -
sdk-version: 1.0.0
name: UpgradePrimer
source: daml
parties:
- Alice
- Bob
version: 0.0.1
dependencies:
- daml-prim
- daml-stdlib
- daml-script
build-options:
- '--package'
- 'Primer-0.0.1 with (Assets.AssetTypes as V1.AssetTypes, Managers.CoinManager as V1.Managers)'
- '--package'
- 'Primer-0.0.2 with (Assets.AssetTypes as V2.AssetTypes, Managers.CoinManager as V2.Managers)'
sandbox-options:
- --wall-clock-time
The daml.yaml
for project PrimerV1
looks like the following -
sdk-version: 1.0.0
name: Primer
source: daml
parties:
- Alice
- Bob
version: 0.0.1
dependencies:
- daml-prim
- daml-stdlib
- daml-script
sandbox-options:
- --wall-clock-time
The daml.yaml
for project PrimerV2
looks like the following -
sdk-version: 1.0.0
name: Primer
source: daml
parties:
- Alice
- Bob
version: 0.0.2
dependencies:
- daml-prim
- daml-stdlib
- daml-script
sandbox-options:
- --wall-clock-time