Use sbt's launcher, for now
See original GitHub issueWhile I think, long-term, it would be excellent to kill off sbt/launcher, I’m concerned that it’s still premature and over-reaching to do so right now.
As such, I recommend that, instead of cs setup
installing a bootstrap around coursier/sbt-launcher, it just bootstraps https://repo1.maven.org/maven2/org/scala-sbt/sbt-launch/, even if that means that the process will resolve sbt (https://repo1.maven.org/maven2/org/scala-sbt/sbt/), and its internal and external dependencies, with old-man Apache Ivy.
(Whether that means changing https://github.com/coursier/apps/blob/master/apps/resources/sbt-launcher.json or creating a new descriptor, I’m not sure.)
AFAICT, there are 3 parts that cs setup
impacts:
- build-time packaging (sbt “preloads” the bundles with the dependencies, and copies them during on first run)
- the “runner” part (before
java
), which does the preloading stuff above, and-D
,-J
support, etc (sbt/sbt-launcher-package vs paulp/sbt-extras) - the “launcher” part (on the JVM), where sbt is just an “app”, with the complicated setup it has (components, locks, “installing” components, ScriptMain, etc).
This issue suggests deferring changing that last part to later.
For the first issue, I’ve always been sceptical of the preloading business, but we must, nonetheless, try not to regress, particularly for users behind corporate firewalls, the Great Firewall of China or the Great Barrier Reef (high latency).
For the second part, we already have unfortunate divergence with the history behind the two. But I also think it’s a much simpler problem to solve than the legacy behind sbt/launcher’s logic.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top GitHub Comments
I wasn’t aware that
cs launch org.scala-sbt:sbt-launch:1.3.10
basically works… Not sure what are the limitations of using just that. Beyond it using Ivy to fetch sbt, and not reading things like.sbtopts
I guess.The original reason I settled with coursier/sbt-launcher is that I knew I can launch it like any other JVM application, with
cs launch
or via an app descriptor.Thanks. I’m also asking because I want to do the same by porting dwijnand/scala-runners to Scala (or Java, if necessary), using an API-stable programmatic equivalent of
cs launch
, and then native-image that.