Opened 14 years ago

Closed 13 years ago

#26701 closed defect (worksforme)

sbt @0.7.4 gives a "[error] Could not parse command: (1,1): Expected identifier"

Reported by: alessandro_mecca@… Owned by: me@…
Priority: Normal Milestone:
Component: ports Version: 1.9.1
Keywords: Cc:
Port: sbt

Description

I installed sbt, downloaded the LiftWeb demo project from here http://github.com/lift/lift_sbt_prototype/tarball/Lift_20 unpacked and run "sbt update".

It returned this message:

[info] Building project Lift SBT Tempalte 0.1 against Scala 2.7.7
[info]    using LiftProject with sbt 0.7.4 and Scala 2.7.7
[error] Could not parse command: (1,1): Expected identifier
[info] 
[info] Total time: 0 s, completed Oct 2, 2010 11:10:10 AM
[info] 
[info] Total session time: 1 s, completed Oct 2, 2010 11:10:10 AM
[error] Error during build.

Then I found that even a simple sbt --help was giving the same problem.

Using the jar downloaded from the official sbt page http://code.google.com/p/simple-build-tool/downloads/detail?name=sbt-launch-0.7.4.jar it works.

Change History (7)

comment:1 Changed 14 years ago by jmroot (Joshua Root)

Owner: changed from macports-tickets@… to me@…
Port: @0.7.4 removed
Summary: sbt gives a "[error] Could not parse command: (1,1): Expected identifier"sbt @0.7.4 gives a "[error] Could not parse command: (1,1): Expected identifier"

Please remember to cc the maintainer.

comment:2 Changed 14 years ago by toby.matejovsky@…

I had the same problem on OS X 10.6.4 GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)

The 0.7.4 jar file from MacPorts is the exact same one as from the Google Code page (sha1: 2b7cfadf05b3b26285bb2038145479741268d334).

The problem is something with the $QUOTED_ARGS in the sbt script. If you remove that part and substitute "$@" (with quotes) for $QUOTED_ARGS (as recommended in the SBT project page), the sbt script works. Patch:

20,26d19
< # Capture any arguments
< QUOTED_ARGS=""
< while [ "$1" != "" ] ; do
<       QUOTED_ARGS="$QUOTED_ARGS \"$1\""
<       shift
< done
< 
33c26
< exec java $JAVA_OPTS -jar "$LAUNCHJAR" $QUOTED_ARGS
---
> exec java $JAVA_OPTS -jar "$LAUNCHJAR" "$@"

comment:3 in reply to:  2 Changed 14 years ago by lists@…

I will change the launcher script and bump the Portfile revision number.

I am not able to re-create the problem you or Alessandro reported. Most of my test systems (8) match your bash version.

Are you passing any arguments to the sbt script?

Do you have and JAVA_OPTS set when you get the error?

Do you have any unusual shell options set in your .bashrc or .bash_profile?

Replying to toby.matejovsky@…:

I had the same problem on OS X 10.6.4 GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)

The 0.7.4 jar file from MacPorts is the exact same one as from the Google Code page (sha1: 2b7cfadf05b3b26285bb2038145479741268d334).

The problem is something with the $QUOTED_ARGS in the sbt script. If you remove that part and substitute "$@" (with quotes) for $QUOTED_ARGS (as recommended in the SBT project page), the sbt script works. Patch:

20,26d19
< # Capture any arguments
< QUOTED_ARGS=""
< while [ "$1" != "" ] ; do
<       QUOTED_ARGS="$QUOTED_ARGS \"$1\""
<       shift
< done
< 
33c26
< exec java $JAVA_OPTS -jar "$LAUNCHJAR" $QUOTED_ARGS
---
> exec java $JAVA_OPTS -jar "$LAUNCHJAR" "$@"

comment:4 Changed 14 years ago by alessandro_mecca@…

The error for me happens even when giving a "sbt --help"

I don't have JAVA_OPTS set. Nothing to mention in the .bashrc/.bach_profile ...

comment:5 Changed 14 years ago by lists@…

I created ticket #26725 with patches. I was not able to re-create the the message you described. Do let me know whether 0.7.4.1 fixes your problems after the patches are applied to MacPorts.

comment:6 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

sbt has been updated to 0.7.4_1; please let us know if the problem remains after updating to that version.

comment:7 Changed 13 years ago by jmroot (Joshua Root)

Resolution: worksforme
Status: newclosed

No response; closing.

Note: See TracTickets for help on using tickets.