pkg icon indicating copy to clipboard operation
pkg copied to clipboard

There will be an infinite loop, with only different dirname symLinks, when findCommonJunctionPoint, in windows OS

Open ranforce opened this issue 4 years ago • 5 comments

What version of pkg are you using?

[email protected]

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" }

ranforce avatar Jan 07 '22 12:01 ranforce

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

github-actions[bot] avatar Apr 08 '22 00:04 github-actions[bot]

PR?

robertsLando avatar Apr 08 '22 06:04 robertsLando

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

github-actions[bot] avatar Jul 08 '22 00:07 github-actions[bot]

This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.

github-actions[bot] avatar Jul 14 '22 00:07 github-actions[bot]

I have also encountered this issue and would like to add a few more observations.

  • This issue is encountered when running pkg as 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 sh Jenkins command (uses Git Bash).
  • When running with the powershell command the issue is not seen. NB: lerna bootstrap and tsc must both be run with powershell in 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, findCommonJunctionPoint gets stuck in the while-loop, continuously moving up directories until it reaches C:\ and gets stuck there.
  • I added additional consol.log in the findCommonJunctionPoint loop to output the current file and realFile: it looks like file === "c:\\" while realFile === "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.

awolokita avatar Sep 13 '22 04:09 awolokita

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

github-actions[bot] avatar Dec 13 '22 00:12 github-actions[bot]

This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.

github-actions[bot] avatar Dec 19 '22 00:12 github-actions[bot]