-
Notifications
You must be signed in to change notification settings - Fork 659
🐛 Infinite symlink expansion error when there's no infinite symlink AFAICT #4193
Comments
The symbolic link detection is optimized for speed and does not cache the entire resolution tree. For this reason, the displayed error message is not very detailed. The warning message is shown, when an already traversed file path is found more than once. The interner is a cache of all traversed file paths. tools/crates/rome_fs/src/fs/os.rs Lines 240 to 243 in 99ee725
This warning message can only be caused by using symbolic links. Please verify, that no symbolic link points to a parent directory where the file is located. |
There are no symbolic links to directories. All symbolic links in this setup always resolve to a specific file. So it may go through a parent directory (e.g. ln -s |
My reading of the code is that any symlinks in multiple directories will trigger this because the infinite symlink expansion warning gets triggered if the same file appears in 2 separate directories (even |
Yes, exactly. The provided example is too generic, but I assume there might be some symbolic link inside of a node_modules dependency. |
I explicitly create a symlink in my project. That's tripping it up. What I'm suggesting is that if ln -s file1 file2 or ln -s dir1 dir2 triggers the warning, the warning isn't actually useful as it's not catching any issue. It needs to be a bit more careful (eg encountering a symlink directory while following a symlink directory). |
This should be fixed now? |
I've created a branch that extends the test cases so the issue is reproduced: https://github.com/rome/tools/compare/main...arendjr:rome-tools:infinite-links?expand=1#diff-6a7c89207a1d417336bc86aeec0899754eb6e72e50c235828d7fd7ca80ea0391R964 Next step will be trying to come up with a fix :) |
Environment information
What happened?
npx rome check .
For example:
Problems:
.
and the npm-runner.js script is located atworkflow/tools/node/npm-runner.js
Relevant information:
An example of a symlink looks like:
workflow
is a submodule to another project. I get the similar errors when running rome from within the submodule (or even as a standalone checkout) so most of the errors about the symlinks that exist within workflow (the npm-runner.js script is reused within workflow and within projects that import it).Expected result
Simple symlinks to JS files shouldn't cause infinite symlink errors.
Code of Conduct
The text was updated successfully, but these errors were encountered: