-
Notifications
You must be signed in to change notification settings - Fork 949
Closed
Labels
Description
steps
- Use a computer that has sbt on it and bash (linux for sure, maybe macs?).
- SBT version should be 1.10.0. (I've seen it on 1.9.7 as well.)
- Take an sbt project with an existing
project/build.properties
file, and modify thesbt.version
line like so:- Remove all spaces to the left of the equal sign, and add one after the equal sign so it looks like this (for example):
sbt.version= 1.9.4
- Remove all spaces to the left of the equal sign, and add one after the equal sign so it looks like this (for example):
- Run any
sbt
command.
problem
$ sbt clean
/opt/sbt/bin/sbt: line 741: ((: 1.9.4 >= 2 : syntax error: invalid arithmetic operator (error token is ".9.4 >= 2 ")
/opt/sbt/bin/sbt: line 741: ((: 1.9.4 >= 1 : syntax error: invalid arithmetic operator (error token is ".9.4 >= 1 ")
[info] welcome to sbt 1.9.4 (Eclipse Adoptium Java 17.0.9)
The current parsing of the sbt version in build.properties causes issues in the isRunNativeClient
function because it can't compare the parsed values numerically. This in turn causes problems running the sbt server.
expectation
I would have expected the spaces in build.properties to not cause any issues.
The following two examples work:
sbt.version =1.9.4
sbt.version = 1.9.4
but the this one does not:
sbt.version= 1.9.4
notes
I have a PR already that trims the whitespace around the keys & values when they are read from build.properties, which fixes the issue: #7585