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

Expose fully-fledged Coursier as a subcommand #2172

Open
keynmol opened this issue May 30, 2023 · 6 comments
Open

Expose fully-fledged Coursier as a subcommand #2172

keynmol opened this issue May 30, 2023 · 6 comments
Labels
coursier Issues tied with coursier integration. enhancement New feature or request Extra commands

Comments

@keynmol
Copy link
Contributor

keynmol commented May 30, 2023

Scala CLI already embeds a non-trivial portion of Coursier for its dependency resolution needs.

I propose exposing scala coursier as a separate command with subcommands such as (but not limited to)

  1. launch
  2. resolve
  3. fetch
  4. bootstrap

to provide immediate access to the full ecosystem of packages, coursier channels, etc.

Currently coursier is in a weird place – it's the de facto dependency resolution mechanism for both SBT and Mill, it is the official way of installing Scala, it is used to resolve and bootstrap CLIs, it has incredibly helpful poweruser functions to fetch classpaths and resolve dependency trees.

And yet:

  • it's hosted in a separate organisation, not affiliated with either Scala Center, VirtusLab, Lightbend, or EPFL
  • it requires separate installation
  • it's not available in official package managers in Windows and in some Linux distributions

With Scala CLI being the official launcher (and hopefully at some point being simply a apt install scala away...), I believe requiring a separate installation of coursier to get access to same functionality is unnecessary.

Workaround for the impatient:

$ scala-cli run --dep io.get-coursier:coursier-cli_2.12:2.1.5 --scala-snippet 'object A' -S 2.12 -M coursier.cli.Coursier -- java --available
...
adoptium:1.11.0.15
adoptium:1.11.0.16
adoptium:1.11.0.16.1
adoptium:1.11.0.17
adoptium:1.11.0.18
adoptium:1.11.0.19
adoptium:1.17
adoptium:1.17.0.1
adoptium:1.17.0.2
adoptium:1.17.0.3
@keynmol keynmol added the enhancement New feature or request label May 30, 2023
@armanbilge
Copy link
Contributor

@diesalbla
Copy link

@SethTisue
Copy link
Contributor

SethTisue commented Jun 2, 2023

I'm in general agreement with Anton here about the advisability of coursier continuing to be its own command-line thing and its own package manager. I posted similar thoughts at https://contributors.scala-lang.org/t/sip-46-scala-cli-as-default-scala-command/5996/64

@tgodzik
Copy link
Member

tgodzik commented Jun 21, 2023

I think we could include some of the commands such as launch, but I would not opt to do add everything that coursier does as I am not sure if we could provide a sensible level of support here.

@ekrich
Copy link

ekrich commented Jul 28, 2023

I can just say that installing more things on some corporate networks is next to impossible so anything to simplify and have official "signed" launchers/installers is highly desired.

@yadavan88
Copy link
Contributor

I would also love to see one feature to setup the JDK using Scala-CLI alone. May be as a power flag or a sub-command or any other way. Right now, I promote cs to a lot of my colleagues and friends to manage JDKs. I also tries to promote scala-cli. So thought, it might make it easier if we can do the JDK explicit setup using Scala-CLI itself instead of separate cs install.

@Gedochao Gedochao added Extra commands coursier Issues tied with coursier integration. labels Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coursier Issues tied with coursier integration. enhancement New feature or request Extra commands
Projects
None yet
Development

No branches or pull requests

8 participants