Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sbtx --client always returns exitcode=0 #321

Open
steinybot opened this issue Mar 24, 2021 · 8 comments
Open

sbtx --client always returns exitcode=0 #321

steinybot opened this issue Mar 24, 2021 · 8 comments

Comments

@steinybot
Copy link

steinybot commented Mar 24, 2021

Initially reported as sbt/sbt#6196 but it is not a problem in the latest official sbt script. It is a problem in the latest sbt-extras script.

❯ ./sbtx --client boom
[info] entering *experimental* thin client - BEEP WHIRR
[info] terminate the server with `shutdown`
> boom
[error] stack trace is suppressed; run last boom for the full output
[error] (boom) Kaboom!
[error] Total time: 0 s, completed 25/03/2021, 8:10:28 AM

❯ echo $?
0

sbt-extras is used by https://github.com/olafurpg/setup-scala and subsequently https://github.com/djspiewak/sbt-github-actions and so is a problem causing false positive builds when trying to use sbt's native thin client.

@dwijnand
Copy link
Owner

So, if I understand correctly --client runs the old, java-based, client. So I guess the error is that that doesn't correctly handle failing commands/tasks returning non-zero? sbt-extras just invokes java with the sbt launcher (you can see and run exactly what it runs by adding a -v) so I'm not sure how this can be a runner issue.

@steinybot
Copy link
Author

My understanding was that it was the other way around. sbt --client is equivalent to running sbtn. I haven't dug into it but the log messages saying entering *experimental* thin client - BEEP WHIRR supports that theory.

@dwijnand
Copy link
Owner

dwijnand commented Apr 7, 2021

"entering experimental thin client" is definitely the old one, the one that shipped in sbt 1.2 (sbt/sbt#4227).

@paulp
Copy link
Collaborator

paulp commented Apr 7, 2021

Lol at BEEP WHIRR which is presumably a descendant of

Welcome to Scala version 2.11.3 (OpenJDK 64-Bit Server VM, Java 1.8.0_144).
Type in expressions to have them evaluated.
Type :help for more information.

scala> :power
** Power User mode enabled - BEEP WHIR GYVE **
** :phase has been set to 'typer'.          **
** scala.tools.nsc._ has been imported      **
** global._, definitions._ also imported    **
** Try  :help, :vals, power.<tab>           **

@steinybot
Copy link
Author

Ah ok well you know better than me then. All I know is that it works with sbt and doesn't work with sbtx.

@steinybot
Copy link
Author

steinybot commented Apr 19, 2021

The sbt docs seem to say that sbt --client will use the native client but only when using the official launcher not the "knockoff kind" (shots fired! 🤣).

Regardless, do you not consider this a bug in sbtx if it works fine in the official launcher? Surely it is.

@dwijnand
Copy link
Owner

I guess I'm talking about one thing and (rightly) you're talking about another: sbt-extras (what I was talking about) is doing java -jar sbt-launcher.jar --client boom and that's the original java client and it doesn't report the right exit code. My guess is the sbt-launcher-package fork of sbt-extras (🚀) is special-casing --client to run the native client, instead.

Effectively there's no way to download and run the native client with sbt-extras (unless I'm forgetting anything) and, indeed, for the occasional use of it I have, I run sbtn which is in the sbt homebrew package.

One thing that I don't know is what kind of guarantees there are between this new client and sbt itself: are old clients going to work with new servers, or is it a strict new-client + new-server stepwise upgrade? I think we'll understand that better with sbt's next minor version bump.

I'm happy to do review some PRs for sbtn support (see also #288) but I don't need it badly enough to look into it right now.

@steinybot
Copy link
Author

Ah right, thanks for the background 😃.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants