From 9c48e315113b4b99fcd9fe898cccb2ba6b2f4eb4 Mon Sep 17 00:00:00 2001 From: Eruis2579 Date: Wed, 11 Feb 2026 01:38:12 +0100 Subject: [PATCH] fix: Restore --version check inside native client block to fix hang (#8717) Revert to checking --version inside the if !run_native_client! block to match the working version's execution flow. This should fix the Windows hang while still preventing hangs when --version is used in sbt 2.x project directories. --- launcher-package/src/universal/bin/sbt.bat | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/launcher-package/src/universal/bin/sbt.bat b/launcher-package/src/universal/bin/sbt.bat index dd06b89e4..4a03a92bb 100755 --- a/launcher-package/src/universal/bin/sbt.bat +++ b/launcher-package/src/universal/bin/sbt.bat @@ -617,21 +617,11 @@ if !sbt_args_print_sbt_script_version! equ 1 ( goto :eof ) -rem Handle --version before native client to avoid hangs in sbt 2.x project dirs (#8717) -if "!sbt_args_print_version!" == "1" ( - if "!is_this_dir_sbt!" == "1" ( - if not "!build_props_sbt_version!" == "" ( - echo sbt version in this project: !build_props_sbt_version! - ) - ) - echo sbt runner version: !init_sbt_version! - echo. - echo [info] sbt runner (sbt-the-batch-script) is a runner to run any declared version of sbt. - echo [info] Actual version of the sbt is declared using project\build.properties for each build. - goto :eof -) - if !run_native_client! equ 1 ( + rem Skip native client if --version is set to avoid hangs in sbt 2.x project dirs (#8717) + if "!sbt_args_print_version!" == "1" ( + goto :skip_native_for_version + ) goto :runnative !SBT_ARGS! goto :eof )