coursier / coursier/apps

Is there a way to "install" a snapshot?

Open
#188 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Scala
Stars
41
Forks
59
Avg merge
3h 20m
Merged PRs (30d)
8

Description

I sort of assumed I could do something like this:

```
cs install -r sonatype:snapshots metals:0.11.9+128-92db24b7-SNAPSHOT
```

But when I try this I get:

```
❯ cs install -r sonatype:snapshots metals:0.11.9+128-92db24b7-SNAPSHOT
https://repo1.maven.org/maven2/org/scala-lang/scala-library/maven-metadata.xml
No new update since 2022-10-08 20:29:56
Exception in thread "main" java.lang.Exception: coursier.install.AppArtifacts$ScalaDependenciesNotFound: Can't find a scala version suffix for org.scalameta::metals:0.11.9+128-92db24b7-SNAPSHOT (likely a non existing module or version)
at coursier.install.AppDescriptor.artifacts(AppDescriptor.scala:109)
at coursier.install.InstallDir.update$1(InstallDir.scala:271)
at coursier.install.InstallDir.$anonfun$createOrUpdate$22(InstallDir.scala:417)
at coursier.install.InstallDir.$anonfun$createOrUpdate$22$adapted(InstallDir.scala:416)
at coursier.install.Updatable$.get$1(Updatable.scala:61)
at coursier.install.Updatable$.$anonfun$writing$1(Updatable.scala:106)
at coursier.cache.CacheLocks$.loop$1(CacheLocks.scala:71)
at coursier.cache.CacheLocks$.withLockOr(CacheLocks.scala:95)
at coursier.install.Updatable$.writing(Updatable.scala:106)
at coursier.install.InstallDir.createOrUpdate(InstallDir.scala:416)
at coursier.install.InstallDir.createOrUpdate(InstallDir.scala:96)
at coursier.cli.install.Install$.$anonfun$run$7(Install.scala:127)
at coursier.cli.install.Install$.$anonfun$run$7$adapted(Install.scala:114)
at scala.collection.immutable.List.foreach(List.scala:431)
at coursier.cli.install.Install$.run(Install.scala:114)
at coursier.cli.install.Install$.run(Install.scala:22)
at caseapp.core.app.CaseApp.main(CaseApp.scala:149)
at caseapp.core.app.CommandsEntryPoint.main(CommandsEntryPoint.scala:115)
at coursier.cli.Coursier$.main(Coursier.scala:118)
at coursier.cli.Coursier.main(Coursier.scala)
Caused by: coursier.install.AppArtifacts$ScalaDependenciesNotFound: Can't find a scala version suffix for org.scalameta::metals:0.11.9+128-92db24b7-SNAPSHOT (likely a non existing module or version)
at coursier.install.AppDescriptor.$anonfun$processDependencies$9(AppDescriptor.scala:231)
at scala.Option.toRight(Option.scala:485)
at coursier.install.AppDescriptor.processDependencies(AppDescriptor.scala:231)
at coursier.install.AppDescriptor.artifacts(AppDescriptor.scala:107)
... 19 more
```

Is this meant to work, or is there any way to achieve this?

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the `cs install` command and start in `modules/coursier-install/src/main/scala/coursier/install/AppDescriptor.scala`, especially `artifacts` and `processDependencies`; the stack trace identifies these entry points. Check how the install command handles the snapshot coordinate, then verify that the requested snapshot can be installed or that its limitation is clearly reported.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.