You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lage getHashForFiles() function throws an exception when attempting to get the hash of a symlink
To Reproduce
Steps to reproduce the behavior:
Start with a monolith;
Move the entire monolith into a subfolder, such as packages/monolith.
Using the tutorial as a guide, create a new package.json and lage.config.js in the project root.
Run npm install. (Consequence: a new symlink is created from ./node_modules/@organization/monolith -> ../packages/monolith)
Run lage build.
See error. (Note that this is a hacked copy of Lage: I reduced the call to git hash-object to run on individual files, so I could figure out where this was failing.)
Error: Command failed with exit code 128: git hash-object /Users/ken/projects/dev/web/node_modules/@goauthentik/mono
This is as expected, as git hash-object on a symlink is nonsensical:
$ git hash-object node_modules/@goauthentik/mono
fatal: Unable to hash web/node_modules/@goauthentik/mono
$ ls -l node_modules/\@goauthentik/mono
lrwxr-xr-x 1 ken staff 18 Dec 20 13:38 node_modules/@goauthentik/mono@ -> ../../packages/mono
Expected behavior
I expected lage to not attempt to hash symlinks. I'm not sure what alternative you have for tracking them, but git hash-object cannot be used in this case. It's not a file, and it refers to a folder, which is also not hashable.
Workaround
Adding 'node_modules/@goauthentik/mono' to .gitignore worked, but that's not a very viable long-term solution.
Environment/Troubleshooting
Please paste in the result of npx envinfo to help identify your run time environment.
This might be fixed by the latest glob-hasher version (lage dependency). It's not obvious from the description, but I remember this change was fixing some related issues.
Describe the bug
Lage getHashForFiles() function throws an exception when attempting to get the hash of a symlink
To Reproduce
Steps to reproduce the behavior:
packages/monolith
.npm install
. (Consequence: a new symlink is created from./node_modules/@organization/monolith -> ../packages/monolith
)lage build
.git hash-object
to run on individual files, so I could figure out where this was failing.)This is as expected, as
git hash-object
on a symlink is nonsensical:Expected behavior
I expected lage to not attempt to hash symlinks. I'm not sure what alternative you have for tracking them, but
git hash-object
cannot be used in this case. It's not a file, and it refers to a folder, which is also not hashable.Workaround
Adding 'node_modules/@goauthentik/mono' to
.gitignore
worked, but that's not a very viable long-term solution.Environment/Troubleshooting
Please paste in the result of
npx envinfo
to help identify your run time environment.The text was updated successfully, but these errors were encountered: