Question regarding building Daml projects

G-d willing

Normally in a Daml project, we have the daml.yaml file which has the source field that indicates where all files are stored.
For example

sdk-version: 2.0.0
name: testProject
source: damlDir

So, when I execute the “daml build” command in the shell, Daml goes into the source folder (damlDir in my case) and uses the files from there in order to create the DAR file.
However, I noticed a different approach where instead of having a “damlDir” folder, there is a damlDir file that its content is simply one line of text: “…/…/someOtherFolder/damlDir”.
But, when I execute the command in Windows 10, I am getting an error message:

File:     daml
Hidden:   no
Range:    1:1-1:7
Source:   parser
Severity: DsError
Message:  daml:1:1: error: parse error on input ../../
ERROR: Creation of DAR file failed.
damlc: ../someOtherFolder/.daml/dist/someOtherFolder-0.0.1.dar: openBinaryFile: does not exist (No such file or directory)

However, when running this command on a Linux machine, there is no problem. Build finishes okay and I am getting the DAR file. I do prefer to work on Windows, cause otherwise, I will need to continue working on a VM - which is less comfortable for me.
Is there a way to fix this?

In the example you have verified works on Linux, is this a regular file, or a symbolic link?

i.e. What is the output of

test -f damlDir && echo "is regular" || echo "is not regular"

I ask this because, by default on Windows, git checks out a symlink as a file containing as plain text what the symlink should point to. Which will lead to the error you share as it tries to read a regular file as a Daml source file.

If you get "is not regular", I suggest trying to enable git symlinks on Windows, re-checkout, and see if things don’t work better.

1 Like

Thank you @Stephen for your reply.
I am getting “is not regular” in the output.
I followed the solution you offered in the link here, I enabled Developer Mode on Windows, and ran the “git config --global core.symlinks true” command. However, this did not resolve the problem I am having.
Am I missing something here?

Did you try making a fresh clone of the repo? Changing git config may not affect existing checkouts.