From e858b8e7ca5247eb02d9db843cd76e36b56e12e2 Mon Sep 17 00:00:00 2001 From: Will Cohen Date: Thu, 20 Aug 2026 12:42:49 -0400 Subject: [PATCH] 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) --- pkgs/by-name/cl/clj-kondo/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/cl/clj-kondo/package.nix b/pkgs/by-name/cl/clj-kondo/package.nix index 34a45e30faa3..2296d7d353e0 100644 --- a/pkgs/by-name/cl/clj-kondo/package.nix +++ b/pkgs/by-name/cl/clj-kondo/package.nix @@ -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";