Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] В случае если каталог исполняемого файла и каталога с файлами для анализа различаются происходит ошибка анализа #3252

Open
zeegin opened this issue Mar 16, 2024 · 2 comments
Labels
type/bug Something isn't working

Comments

@zeegin
Copy link
Contributor

zeegin commented Mar 16, 2024

Версия
v0.23.0-rc.5
v0.22.0

Описание ошибки диагностики

В случае если каталог исполняемого файла и каталога с файлами для анализа различаются происходит ошибка анализа

Надо сделать внятное сообщение об ошибке. Сейчас понять что произошло невозможно.

C:\git\sarif-bsl>"C:\services\bsl-language-server\bsl-language-server.exe" --analyze --srcDir D:\tmp --reporter sarif
Analyzing files... 100% [===================================================================================================================] 8/8 (0:00:00 / 0:00:00) 
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: 'other' has different root
        at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(Unknown Source)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source)
        at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinTask.getThrowableException(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinTask.reportException(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinTask.invoke(Unknown Source)
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateParallel(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
        at com.github._1c_syntax.bsl.languageserver.cli.AnalyzeCommand.call(AnalyzeCommand.java:188)
        at com.github._1c_syntax.bsl.languageserver.cli.AnalyzeCommand.call(AnalyzeCommand.java:79)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at com.github._1c_syntax.bsl.languageserver.BSLLSPLauncher.run(BSLLSPLauncher.java:146)
        at com.github._1c_syntax.bsl.languageserver.BSLLSPLauncher.main(BSLLSPLauncher.java:110)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:95)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65)
Caused by: java.lang.IllegalArgumentException: 'other' has different root
        at java.base/sun.nio.fs.WindowsPath.relativize(Unknown Source)
        at java.base/sun.nio.fs.WindowsPath.relativize(Unknown Source)
        at com.github._1c_syntax.bsl.languageserver.cli.AnalyzeCommand.getFileInfoFromFile(AnalyzeCommand.java:207)
        at com.github._1c_syntax.bsl.languageserver.cli.AnalyzeCommand.lambda$call$1(AnalyzeCommand.java:186)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.base/java.util.stream.ReduceOps$ReduceTask.doLeaf(Unknown Source)
        at java.base/java.util.stream.ReduceOps$ReduceTask.doLeaf(Unknown Source)
        at java.base/java.util.stream.AbstractTask.compute(Unknown Source)
        at java.base/java.util.concurrent.CountedCompleter.exec(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)

Пример кода

Скриншоты

Дополнительная информация
#1276

@zeegin zeegin added the type/bug Something isn't working label Mar 16, 2024
@nixel2007
Copy link
Member

Тут проблема не в каталоге как таковом, а в том, что диски разные

@zeegin
Copy link
Contributor Author

zeegin commented Mar 17, 2024

Ну вот у меня софт на быстром диске C, а воркспейсы и исходники на D который виртуальный.

https://learn.microsoft.com/en-us/windows/dev-drive/

Новая фича win 11 заметно ускоряет работу.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants