Skip to content
CCPEDIAby Unity Nodes
App Development

Daml Training Platform: Episode 5.2 Build Failure

3 posts491 views5 likesLast activity Jun 2021

  1. quidagisOP 1

    I am working through Episode 5.2 and it was going well until I read the Monthly Developer email by @anthony. Up until that point I had been using Daml 1.13.1 with no SDK-related issues, just PEBKAC :grinning:

    I updated the system to the 1.14.xxxxx snapshot and resumed the tutorial. However now when I go to build the .dar from the existing private_nft/nft codebase I am getting a fatal build error. I thought that I’d shortcut it all and revert back to Daml 1.13.1, using daml install 1.13.1 --activate and daml uninstall 1.14.xxxxx however this has not fixed the issue.

    $ make build
    
    cd nft && daml build
    Compiling nft to a DAR.
    Created .daml/dist/nft-0.0.1.dar
    daml2js: ./daml/dist/*.dar: openBinaryFile: does not exist (No such file or directory)
    daml-helper: Received ExitFailure 1 when running
    Raw command: /home/quid/.daml/sdk/1.13.1/daml2js/daml2js -o daml.js ./daml/dist/*.dar
    
    make: *** [Makefile:3: build] Error 1
    
    All relevant system info below

    $ daml version

    SDK versions:
      1.12.0
      1.13.1  (default SDK version for new projects)
    

    $ tree > daml_ep_5-2_errata.txt

    .
    ├── daml_ep_5-2_errata.txt
    ├── Makefile
    └── nft
        ├── daml
        │   ├── Main.daml
        │   ├── Payment.daml
        │   ├── Token.daml
        │   └── UserAdmin.daml
        ├── daml.yaml
        ├── navigator.log
        └── sandbox.log
    
    2 directories, 9 files
    

    $ cat Makefile

    build:
    	cd nft && daml build
    	cd nft && daml codegen js -o daml.js ./daml/dist/*.dar
    
    deploy: build
    	mkdir -p deploy
    	cp nft/.daml/dist/*.dar deploy
    
    clean:
    	cd nft && rm -rf .daml
    	cd nft && rm -rf daml.js
    	rm -rf deploy
    

    $ ls -al nft/.daml/dist

    total 348
    drwxrwxr-x 2 quid quid   4096 Jun 14 13:34 .
    drwxrwxr-x 6 quid quid   4096 Jun 14 13:34 ..
    -rw-rw-r-- 1 quid quid 344542 Jun 14 13:34 nft-0.0.1.dar
    

    $ pwd

    /home/quid/.daml/sdk/1.13.1/daml2js
    

    $ ls ~/.daml/sdk/1.13.1/daml2js

    daml2js lib
    

    $ make build

    cd nft && daml build
    Compiling nft to a DAR.
    Created .daml/dist/nft-0.0.1.dar
    cd nft && daml codegen js -o daml.js ./daml/dist/*.dar
    
    daml2js: ./daml/dist/*.dar: openBinaryFile: does not exist (No such file or directory)
    daml-helper: Received ExitFailure 1 when running
    Raw command: /home/quid/.daml/sdk/1.13.1/daml2js/daml2js -o daml.js ./daml/dist/*.dar
    
    make: *** [Makefile:3: build] Error 1
    

    I have now done this three times completely using the make clean & make build commands to ensure that it is being done the same, everytime.

  2. cocreature 2

    Hi @quidagis, what exactly do you mean by I updated the system to the 1.14.xxxxx snapshot and resumed the tutorial.? Did you actually change the daml.yaml of this specific project? Just installing an SDK version via daml install is not going to change a per-project SDK version unless you modify daml.yaml.

    As for the error, there is a typo in your makefile. Line 3 should be

    cd nft && daml codegen js -o daml.js ./.daml/dist/*.dar
    

    i.e., ./.daml not ./daml.

  3. quidagis 2

    I checked the daml.yaml and no, it was still set to 1.13.1 even after I installed the 1.14.1.xxxxx. Actually forgot about the daml.yaml anyway :sunglasses:

    . ← that’s all it took, thank you … PEBKAC strikes again.