Open keynmol opened 1 year ago
Thanks for reporting! I wonder how hard would it be to fallback to 2.13 if 3 version doesn't exist (maybe also the other way?). That would be a much better experience for the user since they wouldn't need to learn about for2_13Use3
.
True, but it would also create non-determinism. The list of dependencies is no longer sufficient to precisely define a build: you have to know the "state of the world" at the time.
There's also the option of lockfiles π
There are enough caveats with for2_13Use3
(the big two being: macros, diamond dependency conflicts) that I don't think I'd be comfortable with it ever being enabled without explicit opt-in.
Agree with Seth and Arman.
Given that people have taken to backpublishing their libraries under same versions but for Scala 3, it's not a good world where you suddenly compile and run against a different artifact.
I ran into this today, trying to use scala-graph
for Advent of Code 2023 in a Scala-cli project for 3.3.1.
I worked around it with:
//> using dep org.scala-graph:graph-core_2.13:2.0.0
(Note that I had to drop one of the colons to make it work.)
I support @keynmol 's suggestion! Either syntax option is fine with me.
Automatic fallback would be bad indeed.
even if no special support for this is added, https://scala-cli.virtuslab.org/docs/guides/introduction/dependencies/ should document the status quo, IMO
someone asks on Discord from time to time
SBT has a way of specifying 2.13 as a fallback, using
CrossVersion.for3Use2_13
orfor2_13Use3
.Scala CLI has no such thing, so you have to specify the dependency in full:
This gets hairy when you are using native/JS dependencies:
And you are also immediately using the ability to use the
--native
or--js
CLI flags if your script is cross-building.To kick start the bikeshedding, one can add syntax as follows (vote with π ):
or even better (vote with β€οΈ ):
or (and I don't like it) the way
url
parameter is added (vote with π):On the last note, it would be much more preferable to have the key-value pairs outside the string (vote with π ):