Skip to content
Discussions/App Development/An error I am having when building a DAML projectForum ↗

An error I am having when building a DAML project

App Development12 posts437 views2 likesLast activity May 2022
CO
cohen.avrahamOP
Apr 2022

G-d willing

Hello,
I am having a weird issue that prevents me from building a daml project.
While the same code builds correctly on another machine, on my computer it doesn’t.So I know it is not related directly to the code

Right after I am executing daml build, I am getting 2 error messages indicating:

File:     daml
Hidden:   no
Range:    1:1-1:7
Source:   parser
Severity: DsError
Message:  daml:1:1: error: parse error on input ../../

Does anyone know why this is happening?

RI
rikotacards
Apr 2022

Could you provide more details about the system / setup you’re using?

CO
cocreature
Apr 2022

Are you using Windows and does your project have a symlink? It looks like ../.. is actually the content of the file. In some cases symlinks get translated into a file containing the file path on Windows.

ST
Stephen
Apr 2022

It appears to be due to checking out a git repo with a symlink on Windows, without having git symlinks set up to work in Windows, as in this previous issue.

CO
cohen.avraham
Apr 2022

No, I am not using symlinks…
I even did a fresh install of a Linux machine, and I am getting the same error there as well.

CO
cohen.avraham
Apr 2022

Regarding that previous post, the project was updated accordingly so it won’t use symlinks. So all Windows developers won’t have this issue again.

GA
Gary_Verhaegen
Apr 2022

Does the string ../.. appear anywhere in your project, either in Daml source files or in daml.yaml? How much of your project can you publicly share? Having access to the code would make debugging that kind of issue a lot easier.

GA
Gary_Verhaegen
Apr 2022

Perhaps you could share the result of

git grep '../..'

run from the root of your project?

ST
Stephen
Apr 2022
cohen.avraham:

Regarding that previous post, the project was updated accordingly so it won’t use symlinks.

The feature you were referring to in the previous post is not what you thought. Here’s what you observed:

  1. Cloning a project on Linux creates a symlink, builds successfully.
  2. Cloning it on Windows creates a file with a path as its only content instead of the symlink.
  3. This doesn’t build on Windows.

Your hypothesis to explain these was that there was a feature that lets you create a regular file with a path in it and use that as your source, or in other words:

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 this isn’t the case; there is no such feature. The true explanation for the behavior you observed was that checking out the build on Linux created the symlink, and therefore the build was successful, whereas your checkout on Windows did not create a symlink, and therefore the build didn’t work.

Therefore taking out the symlink will not fix the issue you’re having; it will just make it so you also have the issue on Linux. You must use more symlinks to fix the issue, not fewer. The other possibility is to point the source property directly to a real directory containing the sources, so that the symlink is not needed.

CO
cohen.avraham
Apr 2022

G-d willing

I truly appreciate your effort in trying to resolve this. I did try a few things you suggested.
But, whatever resolved the issue was something else.
The issue was resolved when I downloaded the entire code by doing a git clone.
I will explain, first, that when I reported the issue, I downloaded the code from git from Azure by choosing: “Download as Zip”, and NOT by pulling the code directly from git (since the new laptop was not yet configured with my git account).
I don’t know why it made a difference since the bottom line is the same files (at least it is supposed to be the same)…

ST
Stephen
May 2022
cohen.avraham:

I don’t know why it made a difference since the bottom line is the same files

The best explanation I can think of is that it is not exactly the same files; that is, the Zip did not include a symlink, but your git clone created symlinks successfully. Zip doesn’t support symlinks, so there is no way to fix this.

Regardless, going forward, please keep in mind that a regular file (i.e. not a symlink) containing only a path to a directory is not a valid setting for the source property in daml.yaml.

CO
cohen.avraham
May 2022

Got you… thank you very much for the explanation.
I believe that this was the reason for the failure.

← Back to Discussions