clj-kondo: fix startup crash with GraalVM >= 25.1

GraalVM 25.1 removed @AutomaticFeature discovery, so the bundled
graal-build-time feature stopped running. Register it explicitly; drop
when clj-kondo/clj-kondo#2949 ships. Add versionCheckHook so a binary
that cannot start fails the build.

Assisted-by: Claude Code (claude-fable-5)
This commit is contained in:
Will Cohen
2026-08-20 12:42:49 -04:00
parent 47f8d8b01d
commit e858b8e7ca

View File

@@ -2,6 +2,7 @@
lib,
buildGraalvmNativeImage,
fetchurl,
versionCheckHook,
}:
buildGraalvmNativeImage (finalAttrs: {
@@ -16,8 +17,16 @@ buildGraalvmNativeImage (finalAttrs: {
extraNativeImageBuildArgs = [
"-H:+ReportExceptionStackTraces"
"--no-fallback"
# GraalVM >= 25.1 removed @AutomaticFeature discovery, so the bundled
# graal-build-time feature no longer runs and the binary crashes at
# startup. Register it explicitly. Remove once a release carrying
# https://github.com/clj-kondo/clj-kondo/pull/2949 is packaged.
"--features=InitAtBuildTimeFeature"
];
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
meta = {
description = "Linter for Clojure code that sparks joy";
homepage = "https://github.com/clj-kondo/clj-kondo";