Skip to content
CCPEDIAby Unity Nodes
App Development

Daml build fail: Transitive dependencies with same unit id but conflicting package ids

7 posts326 views1 likesLast activity Nov 2023

  1. skylornaOP

    I want to depend on both dars at the same time, but I got this kind of error,
    Transitive dependencies with same unit id but conflicting package ids: hkjc-daml-bet-0.1.0 [c1af3d3e880d1147663339fb75d341263fe783315d7680f6eb531b11d27b71e5,cfe6a2c4a922 89e0f1cd23c8a7878c3aff4d06c43350cbaae02ffc9647c9072d], product-engine-validation-2.1.2 [26648e5442c58665045f7ff78d07183673781c76730161dfa432d679f 78d706d,388fcd1683695705debaa080ec0263296f65b18f8fd8a3a48d96f0e2c1243b74]
    The following is the content of my yaml file, how should I avoid this error

    sdk-version: 2.5.0
    
    name: intro6
    
    source: daml
    
    version: 1.0.0
    
    dependencies:
    
    - daml-prim
    
    - daml-stdlib
    
    - daml-script
    
    - daml-trigger
    
    data-dependencies:
    
    - ./dar/hkjc-daml-payout1.dar
    
    - ./dar/hkjc-daml-payout2.dar
    
    build-options:
    
    - '--package'
    
    - 'hkjc-daml-payout1 with (PayoutSummary as PayoutSummary1)'
    
    - '--package'
    
    - 'hkjc-daml-payout2 with (PayoutSummary as PayoutSummary2)'
    
    sandbox-options:
    
    - --wall-clock-time
    
  2. bernhard 1

    Hi @skylorna , have a look at this docs section: Reference: Daml Packages — Daml SDK 2.6.3 documentation. You need to configure “Module Prefixes” in your daml.yaml.

  3. skylorna

    thank you very much

  4. skylorna

    I changed it to this and still get the same error

    sdk-version: 2.5.0
    
    name: intro6
    
    source: daml
    
    version: 1.0.0
    
    dependencies:
    
    - daml-prim
    
    - daml-stdlib
    
    - daml-script
    
    - daml-trigger
    
    data-dependencies:
    
    - ./dar/hkjc-daml-payout1.dar
    
    - ./dar/hkjc-daml-payout2.dar
    
    # build-options:
    
    # - '--package'
    
    # - 'hkjc-daml-payout1 with (PayoutSummary as PayoutSummary1)'
    
    # - '--package'
    
    # - 'hkjc-daml-payout2 with (PayoutSummary as PayoutSummary2)'
    
    module-prefixes:
    
    hkjc-daml-payout1: payout1
    
    hkjc-daml-payout2: payout2
    
    sandbox-options:
    
    - --wall-clock-time
    

    Transitive dependencies with same unit id but conflicting package ids: hkjc-daml-bet-0.1.0 [c1af3d3e880d1147663339fb75d341263fe783315d7680f6eb531b11d27b71e5,cfe6a2c4a92289e0f1cd23c8a7878c3aff4d06c43350cbaae02ffc9647c9072d], product-engine-validation-2.1.2 [26648e5442c58665045f7ff78d07183673781c76730161dfa432d679f78d706d,388fcd1683695705debaa080ec0263296f65b18f8fd8a3a48d96f0e2c1243b74]

  5. akrmn

    hi @skylorna,

    the error mentions hkjc-daml-bet-0.1.0 and product-engine-validation-2.1.2, which are not named directly in the daml.yaml file you shared, so I assume they are included transitively through the hkjc-daml-payout{1,2}.dar files.

    It’s hard to tell without access to the daml.yaml files for hkjc-daml-payout{1,2}, but it looks like the 1 and 2 versions were built with different .dars for hkjc-daml-bet-0.1.0 and product-engine-validation-2.1.2 which however shared the same version string. Do you have access to the dam.yaml files for hkjc-daml-payout{1,2} and/or the .dar files for hkjc-daml-bet-0.1.0 and product-engine-validation-2.1.2?

  6. skylorna

    Hi @akrmn ,
    this is the daml.yaml for hkjc-daml-payout{1,2}

    sdk-version: 2.5.0
    name: hkjc-daml-bet
    version: 0.1.0
    source: daml
    dependencies:
    - daml-prim
    - daml-stdlib
    - daml-script
    data-dependencies:
      - ../../../../txn-ledger/bet-daml/.daml/dist/txn-3.1.7.dar
      - ../../../../txn-ledger/itrls-cpc/commingle/cpc-daml/dar/wagering-event-product-management.dar
      - ../../../../txn-ledger/bet-daml/dar/product-engine-validation.dar
      - ../../../../txn-ledger/bet-daml/dar/cpc-partner-management.dar
    start-navigator: true
    codegen:
      js:
        output-directory: ui/daml.js
        npm-scope: daml.js
    # Remove this line when running against a ledger without user management.
    init-script: Setup:setup
    
    

    hkjc-daml-payout depends on many other dar files, and these dependent dar files themselves also depend on other dar files.

    hkjc-daml-payout1.dar decompression is hkjc-daml-bet-0.1.0


  7. skylorna

    When the PKIDs of two dar files are inconsistent, the name and version in daml.yaml must not be the same, or this problem will occur if the two dar files are dependenced at the same time.