apps icon indicating copy to clipboard operation
apps copied to clipboard

Is there a way to "install" a snapshot?

Open ckipp01 opened this issue 3 years ago • 2 comments

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?

ckipp01 avatar Nov 10 '22 14:11 ckipp01

It seems repositories passed to cs install aren't used to install the app for now. These are only used to fetch the channel data (that contains the app descriptors).

It seems this could be changed… The app descriptor can be changed in the AppInfo around here. Then the passed repositories should be taken into account.

alexarchambault avatar Nov 14 '22 15:11 alexarchambault

So I failed to make it work and I need to focus on other things currently. My initial approach was in https://github.com/tgodzik/coursier/tree/add-repositories-to-install if anyone wants to continue.

tgodzik avatar Mar 29 '23 16:03 tgodzik