There will be an infinite loop, with only different dirname symLinks, when findCommonJunctionPoint, in windows OS
What version of pkg are you using?
Which version(s) of pkg work for you?
pkg@4
What version of Node.js are you using?
v12.22.8
What operating system are you using?
Windows 7 and 10 both
What CPU architecture are you using?
x86_64
What Node versions, OSs and CPU architectures are you building for?
default,as 12.22.7-win-x64 in console
Describe the Bug
Hello, in code https://github.com/vercel/pkg/blob/f081c634c73aaf00cff69750c561771442092098/lib/walker.ts#L306 , when the scope is as follows, there will be an infinite loop. { "file": "D:\project-name\node_modules\element-ui\package.json", "realFile": "D:\project-name\node_modules\_element- [email protected] @element-ui\package. json" } The final scope is: { "file": "D:\", "realFile": "D:\" }
Expected Behavior
Build sussece
To Reproduce
The scope only the dirname is diffrent. { "file": "D:\project-name\node_modules\element-ui\package.json", "realFile": "D:\project-name\node_modules\_element- [email protected] @element-ui\package. json" }
This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label
PR?
This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label
This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.
I have also encountered this issue and would like to add a few more observations.
- This issue is encountered when running
pkgas a part of our Jenkins CI job. - The package target is a lerna monorepo sub-package with dependencies on other packages in the mono-repo
- Only encountered when running with the
shJenkins command (uses Git Bash). - When running with the
powershellcommand the issue is not seen. NB: lerna bootstrap and tsc must both be run withpowershellin order to work around the issue. - Moreover, using git bash (even with CI=true) manually on the Jenkins node doesn't cause this issue. Issue is also not seen when using
- When this issue is seen,
findCommonJunctionPointgets stuck in the while-loop, continuously moving up directories until it reachesC:\and gets stuck there. - I added additional
consol.login thefindCommonJunctionPointloop to output the currentfileandrealFile: it looks likefile === "c:\\"whilerealFile === "C:\\". - So possibly the issue is that for some reason, the difference in case of the root is the cause of the issue?
Unfortunately I don't have time to make a reproducer, nor can I really add debug logs as the logs contain sensitive information.
This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label
This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.