--no-server mode

Fixes #6530
Ref #6101

Problem
-------
Although having sbt server up by default is beneficial to well-tested
platforms like macOS, on less tested setups various native and/or
native-adjacent techniques we use could end up causing instability.

Solution
--------
This adds `--no-server` as a quick way of telling sbt not to start up
the sbt server or create virtual terminal.
This commit is contained in:
Eugene Yokota 2021-11-27 20:17:26 -05:00
parent a448b1caab
commit 7d429c6724
2 changed files with 16 additions and 0 deletions

View File

@ -50,6 +50,7 @@ set sbt_args_sbt_dir=
set sbt_args_sbt_version=
set sbt_args_mem=
set sbt_args_client=
set sbt_args_no_server=
rem users can set SBT_OPTS via .sbtopts
if exist .sbtopts for /F %%A in (.sbtopts) do (
@ -205,6 +206,15 @@ if defined _no_colors_arg (
goto args_loop
)
if "%~0" == "-no-server" set _no_server_arg=true
if "%~0" == "--no-server" set _no_server_arg=true
if defined _no_server_arg (
set _no_server_arg=
set sbt_args_no_server=1
goto args_loop
)
if "%~0" == "-no-global" set _no_global_arg=true
if "%~0" == "--no-global" set _no_global_arg=true
@ -646,6 +656,10 @@ if defined sbt_args_traces (
set _SBT_OPTS=-Dsbt.traces=true !_SBT_OPTS!
)
if defined sbt_args_no_server (
set _SBT_OPTS=-Dsbt.io.virtual=false -Dsbt.server.autostart=false !_SBT_OPTS!
)
rem TODO: _SBT_OPTS needs to be processed as args and diffed against SBT_ARGS
if !sbt_args_print_sbt_version! equ 1 (

2
sbt
View File

@ -22,6 +22,7 @@ declare sbt_verbose=
declare sbt_debug=
declare build_props_sbt_version=
declare use_sbtn=
declare no_server=
declare sbtn_command="$SBTN_CMD"
declare sbtn_version="1.4.7"
@ -631,6 +632,7 @@ map_args () {
-traces|--traces) options=( "${options[@]}" "-Dsbt.traces=true" ) && shift ;;
--supershell=*) options=( "${options[@]}" "-Dsbt.supershell=${1:13}" ) && shift ;;
-supershell=*) options=( "${options[@]}" "-Dsbt.supershell=${1:12}" ) && shift ;;
-no-server|--no-server) options=( "${options[@]}" "-Dsbt.io.virtual=false" "-Dsbt.server.autostart=false" ) && shift ;;
--color=*) options=( "${options[@]}" "-Dsbt.color=${1:8}" ) && shift ;;
-color=*) options=( "${options[@]}" "-Dsbt.color=${1:7}" ) && shift ;;
-no-share|--no-share) options=( "${options[@]}" "${noshare_opts[@]}" ) && shift ;;