-
Notifications
You must be signed in to change notification settings - Fork 131
build(native): initial GraalVM native-image support #3938
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
Open
nixel2007
wants to merge
7
commits into
develop
Choose a base branch
from
feature/update-deps
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5ce27e2
build(native): add initial GraalVM native-image support
nixel2007 b406be6
refactor(codelenses): extract TestSourcesProvider, drop @Lazy self-in…
nixel2007 180422a
build(native): expand reachability hints, restore aspectjweaver runtime
nixel2007 354bb43
build(native): native binary now starts and runs AnalyzeCommand
nixel2007 2d64968
build(native): make 1C metadata parsing работать в native + initial a…
nixel2007 8c0de15
chore(native): add BSL_LS_THREAD_DUMP watchdog для диагностики runtim…
nixel2007 0c8f84d
fix(native): устранить deadlock в native-runtime, native analyze рабо…
nixel2007 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/TestSourcesProvider.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| /* | ||
| * This file is a part of BSL Language Server. | ||
| * | ||
| * Copyright (c) 2018-2026 | ||
| * Alexey Sosnoviy <labotamy@gmail.com>, Nikita Fedkin <nixel2007@gmail.com> and contributors | ||
| * | ||
| * SPDX-License-Identifier: LGPL-3.0-or-later | ||
| * | ||
| * BSL Language Server is free software; you can redistribute it and/or | ||
| * modify it under the terms of the GNU Lesser General Public | ||
| * License as published by the Free Software Foundation; either | ||
| * version 3.0 of the License, or (at your option) any later version. | ||
| * | ||
| * BSL Language Server is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| * Lesser General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Lesser General Public | ||
| * License along with BSL Language Server. | ||
| */ | ||
| package com.github._1c_syntax.bsl.languageserver.codelenses; | ||
|
|
||
| import com.github._1c_syntax.bsl.languageserver.configuration.LanguageServerConfiguration; | ||
| import com.github._1c_syntax.utils.Absolute; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.jspecify.annotations.Nullable; | ||
| import org.springframework.cache.annotation.CacheConfig; | ||
| import org.springframework.cache.annotation.CacheEvict; | ||
| import org.springframework.cache.annotation.Cacheable; | ||
| import org.springframework.stereotype.Component; | ||
|
|
||
| import java.net.URI; | ||
| import java.nio.file.Path; | ||
| import java.util.Optional; | ||
| import java.util.Set; | ||
| import java.util.stream.Collectors; | ||
|
|
||
| /** | ||
| * Поставщик списка каталогов с тестовыми исходниками для линз запуска тестов. | ||
| * <p> | ||
| * Кэширование вынесено в отдельный бин, чтобы вызов кэшируемого метода | ||
| * шёл через нормальный Spring AOP-прокси без self-injection в линзах | ||
| * (паттерн {@code @Lazy self} ломает native-image на конфликте | ||
| * pre-generated CGLIB-стабов с runtime AOP). | ||
| */ | ||
| @Component | ||
| @CacheConfig(cacheNames = "testSources") | ||
| @RequiredArgsConstructor | ||
| public class TestSourcesProvider { | ||
|
|
||
| private final LanguageServerConfiguration configuration; | ||
|
|
||
| /** | ||
| * Получить список каталогов с тестами с учётом корня рабочей области. | ||
| * | ||
| * @param configurationRoot Корень конфигурации. | ||
| * @return URI каталогов с тестами. | ||
| */ | ||
| @Cacheable | ||
| public Set<URI> getTestSources(@Nullable Path configurationRoot) { | ||
| var configurationRootString = Optional.ofNullable(configurationRoot) | ||
| .map(Path::toString) | ||
| .orElse(""); | ||
|
|
||
| return configuration.getCodeLensOptions().getTestRunnerAdapterOptions().getTestSources() | ||
| .stream() | ||
| .map(testDir -> Path.of(configurationRootString, testDir)) | ||
| .map(path -> Absolute.path(path).toUri()) | ||
| .collect(Collectors.toSet()); | ||
| } | ||
|
|
||
| /** | ||
| * Сбросить кэш каталогов с тестами. | ||
| */ | ||
| @CacheEvict(allEntries = true) | ||
| public void evict() { | ||
| // No-op. Сброс кеша выполняется аспектом @CacheEvict. | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
In Gradle Kotlin DSL, for ModuleDependency.exclude inside a dependency block, isexclude("commons-logging:commons-logging")valid syntax to exclude groupcommons-loggingand modulecommons-logging, or should it use separategroupandmodulearguments?💡 Result:
For Gradle Kotlin DSL, inside a dependency block using ModuleDependency.exclude, you should use separate group and module arguments (i.e., exclude(group =..., module =...)); the single-string coordinate syntax exclude("commons-logging:commons-logging") is not the supported ModuleDependency.exclude overload for per-dependency transitive exclusions. Gradle’s Kotlin DSL documentation shows the per-dependency exclusion rule as: exclude(group = "commons-collections", module = "commons-collections") [1] The ModuleDependency Kotlin DSL API also defines exclude with an optional group and module parameters: fun <T: ModuleDependency> T.exclude(group: String? = null, module: String? = null): T [2] So for commons-logging, use: implementation("...") { exclude(group = "commons-logging", module = "commons-logging") } If you try to use a coordinate-style string like exclude("group:module"), it may not match the available Kotlin DSL signature for ModuleDependency.exclude, and you can hit a “Could not find method exclude for arguments [...]” error (reported for similar usage) [3].
Citations:
🏁 Script executed:
Repository: 1c-syntax/bsl-language-server
Length of output: 179
🏁 Script executed:
Repository: 1c-syntax/bsl-language-server
Length of output: 12339
Fix malformed
commons-loggingexclude inlanguage-enimplementation("org.languagetool:language-en:$languageToolVersion")usesexclude("commons-logging:commons-logging"), which is the wrong form; it should exclude with separategroupandmodulelike the neighboringlanguagetool-core/language-rublocks.graalvmNativebuilds (the file only setsmainClassandbuildArgs), since the referenced GraalVM CE version isn’t reflected in Gradle config.Suggested fix
implementation("org.languagetool:language-en:$languageToolVersion") { - exclude("commons-logging:commons-logging") + exclude(group = "commons-logging", module = "commons-logging") exclude("com.sun.xml.bind", "jaxb-core") exclude("com.sun.xml.bind", "jaxb-impl") // io.grpc.netty-shaded ломает native-image: его static init захватывает // ch.qos.logback.classic.Logger в image heap. LanguageTool сам netty-shaded // не использует — только в составе grpc-stub-а для удалённых правил, который // мы не задействуем; остальные grpc-api/grpc-protobuf остаются на classpath, // чтобы LanguageTool мог разрешать `io.grpc.Channel` при загрузке правил. exclude("io.grpc", "grpc-netty-shaded")📝 Committable suggestion
🤖 Prompt for AI Agents