Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 17 20:03
    chadselph closed #1774
  • May 17 20:02
    chadselph commented #1774
  • May 17 18:54

    alexarchambault on gh-pages

    Update website (compare)

  • May 17 18:20

    alexarchambault on master

    Merge page cli-setup.md into cl… (compare)

  • May 17 18:20
    alexarchambault closed #2417
  • May 17 15:24
    julienrf commented #2415
  • May 17 15:22
    julienrf opened #2417
  • May 16 20:31
    TrevCan commented #2395
  • May 16 20:26
    TrevCan commented #2395
  • May 16 13:38
    bjornregnell commented #2416
  • May 16 13:10
    alexarchambault closed #2416
  • May 16 13:10
    alexarchambault commented #2416
  • May 16 12:48
    alexarchambault closed #1484
  • May 16 12:48
    alexarchambault commented #1484
  • May 16 09:51

    alexarchambault on gh-pages

    Update website (compare)

  • May 16 09:29
    alexarchambault commented #2414
  • May 16 09:16
    alexarchambault commented #2413
  • May 16 09:14

    alexarchambault on master

    Update cli-installation.md (no … Add scala-cli to default app li… Merge pull request #2415 from a… (compare)

  • May 16 09:14
    alexarchambault closed #2415
  • May 16 09:14
    alexarchambault commented #2415
Eric K Richardson
@ekrich
The interface for Scala Native has changed a bit in 0.4.0 although the old interface still works but is deprecated. I didn't see any issues or PRs - is this update being considered?
Siddhant Sanyam
@siddhant3s
I guess I'm not understanding coursier's repo resolution at all:
I've set my mirrors.properties to point central.to correctly my local maven proxy. On top of that, I'm passing -r https://maven.company.com/nexus/content/groups/public --no-default to coursier. Even then... it's trying to connect to repo1.maven.org. I don't understand why.
Ondra Pelech
@sideeffffect
Hello, when using coursier/cache-action, we're seeing warnings like reserveCache failed. Is it OK? Or is something going wrong? /cc @mijicd
coursier/cache-action#102
Oliver
@xthemage:synapse.xthemage.net
[m]
Hi folks. First off, fantastic tool. Coursier bootstrap is amazing! I've been noticing that recent versions of coursier have been embedding the primary jar file in the bootstrap binary. Is there a way to disable this feature?
1 reply
(or perhaps am I using it wrong?)
Specifically, I have a little bit of a hack that relies on python's ability to execute a tar file to package python code with my jar, and recently I've noticed that bootstrap binaries are seeing the classloader reading from path/to/bootstrap!coursier/bootstrap/launcher/jars/___.jar instead of the typical file:/path/to/__main__.py or jar:/path/to/___.jar
Oliver
@xthemage:synapse.xthemage.net
[m]
Hmm... is coursier automatically packaging files that aren't visible to a global resolver? If so, is there a command-line flag that will turn this behavior into an error?
ekrich
@ekrich:matrix.org
[m]
I have been trying to get the Scala tool set to work behind a corp proxy with basic auth. The following meta issue was added - scalameta/metals#2485 I did some analysis starting at the very beginning.
Siddhant Sanyam
@siddhant3s

Hi, I'm trying to use a local maven repo. When I do coursier fetch scalafmt it fails with Caused by: coursier.install.AppArtifacts$ScalaDependenciesNotFound: Can't find a scala version suffix for org.scalameta::scalafmt-cli:latest.release (likely a non existing module or version)

However when I write the exact version number (after consulting the internet on whatever the latest version, couriser succeeds):

[siddhant@localhost ~] coursier fetch org.scalameta:scalafmt-cli_2.13:2.7.5

Does anyone have ideas as to what might be going on or how do I debug this?

I tried coursier fetch org.scalameta::scalafmt-cli:2.7.5 but that doesn't work either (notice the ::)
Eric K Richardson
@ekrich
I was trying to see if I could make some changes using this as a guide. If I look at the script it looks like it calls main in Coursier but if I put some System.err.println in there I see nothing so I am thinking I am missing something.
Emily Chen
@six5532one
Hi, I'm using Homebrew 3.0.0 and tried brew install coursier/formulas/coursier and brew tap coursier/formulas. Each time, I get these errors:
Error: Invalid formula: /usr/local/Homebrew/Library/Taps/coursier/homebrew-formulas/coursier.rb
coursier: Unsupported special dependency :java
Error: Cannot tap coursier/formulas: invalid syntax in tap!
Siddhant Sanyam
@siddhant3s
What's the difference between bootstrap --standalone and bootstrap --assembly ?
Przemek Pokrywka
@przemek-pokrywka

Hi @lolgab

Does coursier need special treatment to update GraalVM to 21.0.0 ? If so, is it tracked somewhere?

Coursier uses a JSON file with an index of JVMs from Jabba project. Version 21.0 of GraalVM was only recently added there. For some reason Coursier doesn't pick this up automatically, but if you pass an additional option, the new GraalVM can be used. The option is

--jvm-index https://raw.githubusercontent.com/shyiko/jabba/master/index.json

Lorenzo Gabriele
@lolgab
@przemek-pokrywka Thank you very much :pray:
StinkyLord
@StinkyLord
Hi guys
anybody knows how to get coursierDependencyTree by specific scope/s?
i can see support when i run sbt test:coursierDependencyTree but it is not working the same for
provided/import/runtime..
just for test/compile..
any idea where i can find documentation about this?
Mark T. Kennedy
@mtk
is there a way to ask coursier to tell me what could be updated without actually updating anything?
StinkyLord
@StinkyLord
is this forum even alive?:D
Przemek Pokrywka
@przemek-pokrywka
@StinkyLord semi-alive. I may be wrong but Coursier doesn't support the concept of scopes at the moment I think.
StinkyLord
@StinkyLord
it's weird because this sbt test:coursierDependencyTree syntax work fine.. and i checked the source code it has support for scopes.. i wonder why its not official in the docs
Henry
@hygt
hello, is there a way to make thin bootstraps not point to maven central? or should I build standalone bootstraps?
2 replies
Justin Kaeser
@jastice
Can I use the API to resolve hashes and signatures besides just the artifacts and classifiers? i.e. the whole repo
7 replies
Simon Parten
@Quafadas

Can anyone see why this might be giving me the below errors?

./coursier --help --no-default -r "https://repo.corp.com/repository/maven-public/"

It appears to be ignoring the command line args?

Error while downloading https://repo1.maven.org/maven2/com/github/alexarchambault/case-app_2.12/2.0.0-M9/case-app_2.12-2.0.0-M9.jar: Connection reset, ignoring it
Error while downloading https://repo1.maven.org/maven2/com/github/alexarchambault/argonaut-shapeless_6.2_2.12/1.2.0-M11/argonaut-shapeless_6.2_2.12-1.2.0-M11.jar: Connection reset, ignoring it
Error while downloading https://repo1.maven.org/maven2/com/github/alexarchambault/case-app-util_2.12/2.0.0-M9/case-app-util_2.12-2.0.0-M9.jar: Connection reset, ignoring it
Error while downloading https://repo1.maven.org/maven2/com/chuusai/shapeless_2.12/2.3.3/shapeless_2.12-2.3.3.jar: Connection reset, ignoring it
Error while downloading https://repo1.maven.org/maven2/com/github/alexarchambault/case-app-annotations_2.12/2.0.0-M9/case-app-annotations_2.12-2.0.0-M9.jar: Connection reset, ignoring it
5 replies
Justin Kaeser
@jastice
Given a path to an artifact, is there a simple way to get the path to the repo subdirectory? E.g. I have the downloaded /Users/jast/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jetbrains/scala/scala-compiler-indices-protocol_2.13/1.0.13/scala-compiler-indices-protocol_2.13-1.0.13-javadoc.jar and want the /Users/jast/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/ and org/jetbrains/scala/scala-compiler-indices-protocol_2.13/1.0.13/scala-compiler-indices-protocol_2.13-1.0.13-javadoc.jar portions separately?
4 replies
Justin Kaeser
@jastice
how do I write an sbt plugin dependency in the API or command line?
cs resolve org.jetbrains.scala:sbt-structure-extractor_2.10_0.13:2021.1.1 yields an error
3 replies
Justin Kaeser
@jastice
Another problem! when I add .addClassifiers(Classifier.javadoc, Classifier.sources) to a Fetch, it will fetch only the classifiers, but not the primary jars. why is that?
3 replies
Eric K Richardson
@ekrich
@alexarchambault I asked a question about a dozen posts back - any hints
2 replies
Yevgen Nerush
@nerush

Hi, seems like Coursier cannot resolve the latest version of the netty-transport-native-epoll library for Mac and Linux:

When I add "io.netty" % "netty-transport-native-epoll" % "4.1.60.Final” dependency to the build, Coursier fails retrieveing the artifact with the following error:

 Caused by: lmcoursier.internal.shaded.coursier.cache.ArtifactError$NotFound: not found: https://repo1.maven.org/maven2/io/netty/netty-transport-native-epoll/4.1.60.Final/netty-transport-native-epoll-4.1.60.Final-linux-aarch64.jar
[error]     at lmcoursier.internal.shaded.coursier.cache.FileCache.$anonfun$download$12(FileCache.scala:244)
[error]     at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:659)
[error]     at scala.util.Success.$anonfun$map$1(Try.scala:255)
[error]     at scala.util.Success.map(Try.scala:213)
[error]     at scala.concurrent.Future.$anonfun$map$1(Future.scala:292)
[error]     at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:33)
[error]     at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:33)
[error]     at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
[error]     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error]     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error]     at java.base/java.lang.Thread.run(Thread.java:834)
[error] (update) lmcoursier.internal.shaded.coursier.error.FetchError$DownloadingArtifacts: Error fetching artifacts:
[error] https://repo1.maven.org/maven2/io/netty/netty-transport-native-epoll/4.1.60.Final/netty-transport-native-epoll-4.1.60.Final-linux-aarch64.jar: not found: https://repo1.maven.org/maven2/io/netty/netty-transport-native-epoll/4.1.60.Final/netty-transport-native-epoll-4.1.60.Final-linux-aarch64.jar

Cause: coursier tries to download the artifact with linux-aarch64 prefix, while the actual prefix is linux-aarch_64

Is there any way to configure the correct prefix for transitive dependency?

Adrishyantee Maiti
@adrishyantee
Screenshot from 2021-03-27 13-56-31.png
1 reply
Can some one help me with this issue highlighted. It says: rror while fetching artifact with coursier: " + exec_result.stderr
@maven//:javax_inject_javax_inject in repository @ maven which failed to fetch. no such package '@ maven//'
Hanns Holger Rutz
@Sciss

Hi there. I want to implement an --offline mode for my application where I constrain coursier to not look up anything on the network, but only locally. For example, in Versions and Resolve. If I print the default repositories, I get

IvyRepository(Pattern(List(Const(file:/home/hhrutz/.ivy2/local/), Var(organisation), Const(/), Var(module), Const(/), Opt(List(Const(scala_), Var(scalaVersion), Const(/))), Opt(List(Const(sbt_), Var(sbtVersion), Const(/))), Var(revision), Const(/), Var(type), Const(s/), Var(artifact), Opt(List(Const(-), Var(classifier))), Const(.), Var(ext))), None, None, true, true, true, true, None, true)
MavenRepository(https://repo1.maven.org/maven2, None, None, true, true)

and if I add withRepositories(Nil), coursier no longer includes Maven Central, but unfortunately the local location is also wiped. Is there a shortcut, for getting that location? Like (hypothetically)

withRespositories(Repositories.local :: Nil)

?

3 replies
Ok, found it
val repos = if (offline) LocalRepositories.ivy2Local :: Nil else Resolve.defaultRepositories
3 replies
Hanns Holger Rutz
@Sciss
How can I remove the repository information from cache and artifacts? Like instead of ~/.local/share/mellite/coursier/https/repo1.maven.org/maven2/org/artifact, I want coursier to use ~/.local/share/mellite/coursier/org/artifact instead. Is that possible?
Hanns Holger Rutz
@Sciss
How can I turn a FileCache into a Repository? Like I'm fetching artifacts into a custom directory ~/.local/share/mellite/coursier/, how can I make a Repository from that location so that Versions can report which versions have been downloaded?
4 replies
Hanns Holger Rutz
@Sciss
Can I run Versions and get the corresponding .pom files of each version? I can see that they are cached as part of the action. But is there a way to quickly access those poms? I need to read meta-data associated with each version.
10 replies
Hanns Holger Rutz
@Sciss
btw I had trouble importing the project to IntelliJ - the not found: value sbtCoursierVersion error mentioned here occurs. I didn't bother to try to instruct IntelliJ to use different ./sbt, but adding something like def sbtCoursierVersion = "1.2.3" to build.sbt made the problem go away apparently. Might be worth looking into fixing for "standard sbt".
I'm working on a desktop application launcher, using Coursier as a library. Works great so far.
1 reply
Hanns Holger Rutz
@Sciss

Here is a solution for obtaining the pom file that works with maven repositories - I basically peeked into MavenRepository:

      val cacheArt  = cache.FileCache[Task](cfg.artDir)

      val appDepPOM = appDep.withTransitive(false)
      val resolvePOM = Resolve(cacheResolve).addDependencies(appDepPOM).withRepositories(repos)
      resolvePOM.future().foreach { resolution =>
        println("---- RESOLVED ARTIFACTS ----")
        resolution.artifacts().foreach { a =>
          println(s"url = ${a.url}") // ; extra = ${a.extra}")
        }
        println("----")
        val artifacts = Artifacts(cacheArt).withResolution(resolution).addTransformArtifacts { sq =>
          sq.map { case (dependency, _ /*pub*/, art0) =>
            // cf. MavenRepository - metadataArtifact
            val metadataPub = Publication(dependency.module.name.value, Type.pom, Extension.pom, Classifier.empty)
            val metadataURL = {
              val u = art0.url
              assert (u.endsWith(".jar"))
              s"${u.substring(0, u.length - 4)}.${metadataPub.ext.value}"
            }
            val metadataArtifact  =
              Artifact(
                metadataURL,
                Map.empty,
                Map.empty,
                changing = false, // XXX TODO what is this?,
                optional = true,
                authentication = art0.authentication
              ).withDefaultChecksums.withDefaultSignature

            (dependency, metadataPub, metadataArtifact)
          }
        }
        val fetch = new Fetch(resolvePOM, artifacts, None)
        fetch.futureResult().foreach { res =>
          println("---- FETCHED ARTIFACTS ----")
          res.artifacts.foreach { case (_, f) =>
            println(f)
          }
          println("----")
        }
      }
---- RESOLVED ARTIFACTS ----
url = https://repo1.maven.org/maven2/de/sciss/mellite-app_2.13/2.48.0/mellite-app_2.13-2.48.0.jar
----
---- FETCHED ARTIFACTS ----
/home/hhrutz/.local/share/mellite/default/cs/https/repo1.maven.org/maven2/de/sciss/mellite-app_2.13/2.48.0/mellite-app_2.13-2.48.0.pom
----

is there a public API to achieve this? Also, this fails for local ivy repository, because the .pom is in a different directory. How do I get the Repository belonging to each artifact in a Resolution?

4 replies
Guillaume Galy
@guilgaly
Hello,
I recently tried using Coursier's cs tool to setup my Scala dev env (JDK, SBT, etc.), but I found an issue when installing SBT this way. I have a situation where SBT gets executed with the -batch flag; this flag is correctly recognized by SBT installed via Homebrew, but not by SBT installed via Coursier.
  • I think the difference is because the sbt command installed by cs is actually from coursier/sbt-runner while the one installed by Homebrew probably comes from sbt/sbt-launcher-package; does that sound right?
  • if so, should that be considered a bug in sbt-runner?
    (I have to say that it's quite confusing that the same option might be either accepted or rejected depending on how you install SBT... 😅)
5 replies
nafg
@naftoligug:matrix.org
[m]
Is this supposed to work? cs launch scala3-compiler:3.0.0-RC1
2 replies
nafg
@naftoligug:matrix.org
[m]
Hi, how can I do the equivalent of cs launch from code, capturing stdout and stderr?
1 reply
Chris Kipp
@ckipp:matrix.org
[m]
I'm having a hard time understanding why this doesn't work
cs complete -r sonatype:snapshots org.scalameta:metals_2.12:
4 replies
this still just prints out all of the Metals stable versions and doesn't capture what I'd expect it to from here: https://oss.sonatype.org/content/repositories/snapshots/org/scalameta/metals_2.12/maven-metadata.xml
I believe I even asked this before, but I've never successfully been able to list out the actual snapshot versions of Metals that exist here, are able to be pulled, but never show up in complete
any idea how to see these or what I'm doing wrong here?
Simon Parten
@Quafadas
Can anyone see anything I'm doing obviously wrong here?
simon@Simons-Mac-mini formula-example % coursier launch ammonite
Loading...
Welcome to the Ammonite Repl 2.3.8-56-2be2b739 (Scala 2.13.5 Java 15.0.2)
@ val s = "1.0" 
scala.reflect.internal.MissingRequirementError: object java.lang.Object in compiler mirror not found.
  scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:24)
  scala.reflect.internal.Mirrors$RootsBase.$anonfun$getModuleOrClass$6(Mirrors.scala:66)
9 replies
ritschwumm
@ritschwumm
pray tell - is there a way to print each and every http request coursier issues from inside sbt (preferrable 1.4.9, i have some other issue with 1.5.0 i don't want to deal with right now)?
i have interesting issues with a locally hosted artifactory which gives me quite unexpected 403 forbidden responses, and i need more input to think about.
2 replies
ritschwumm
@ritschwumm
another question: am i right in guessing that OkHttpDownload is the one used in sbt by default, and it does send basic authentication headers right from the beginning, without waiting for a status 401 first? if that's the case, it would be worth a comment in sbt/sbt#5556
2 replies