question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reducing coursier dependencies

See original GitHub issue

This issue is going to be highly controversial and may not even be considered due to the conflict of some of the design aims of coursier, essentially the issue is about removing dependencies which are either very large (scalaz) or create circular dependencies with libraries that may want to use coursier (ammonite-terminal, @lihaoyi is considering making ammonite use coursier)

If coursier’s aims are to be included in tools like SBT/ammonite (and others) by default, the dependencies need to be made as small as possible. Scalaz unfortunately, due to its monolithic design, weighs in at around 10mb.

There are obviously replacements for Scalaz (the other extreme would be just using the stdlib, which has Future), but this obviously means that the core of coursier isn’t going to be completely “pure” (from a pure functional programming POV), i.e.

The cache module handles caching of the metadata and artifacts themselves, and is less so pure than the core module, in the sense that it happily does IO as a side-effect (always wrapped in Task, and naturally favoring immutability for all that’s kept in memory).

Other solutions can include using cats instead of Scalaz (cats core is currently much smaller, weighing at 2.7mb currently). Either that, or using an internal solution to replace the areas that Scalaz is being used for (i.e. Task)

Also using Future instead of Task can possibly provide performance improvements since a lot of high performance HTTP libraries (dispatch with netty or akka-http) are backed by Future’s

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:4
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
alexarchambaultcommented, Oct 29, 2018

coursier 1.1.x (only released via milestones) doesn’t depend on scalaz anymore. The coursier and coursier-cache modules should basically only depend on scala-library and scala-xml.

0reactions
alexarchambaultcommented, Feb 7, 2018

@leonardehrenfried I’ll handle that issue. For the core module, I’ll likely use SHIMs for Monad, EitherT, maybe Nondeterminism, with the bare minimum methods (I tried some time ago, it seemed to work fine…).

Then maybe a type class in cache abstracting over Task, and, if possible, a Future-backed implementation of it. And cats-effect and scalaz-concurrent modules with cats / scalaz implementations for it too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Version handling - Coursier
Version reconciliation happens when two or more of your direct or transitive dependencies depend on different versions of the same module.
Read more >
Twitter's Coursier Migration - Pants build
This post discusses why and how Twitter adopted another 3rdparty resolve tool called Coursier to replace Ivy and how much impact it made....
Read more >
semantics of dependency resolvers - eed3si9n
A dependency resolver, or package manager, is a program that determines a consistent set of modules based on a set of constraints provided...
Read more >
how to speed up dependencies downloads in sbt 1.x projects ...
The next build will download dependencies in parallel, which should significantly reduce your project's build time. Adding Coursier into the ...
Read more >
lihaoyi/mill - Gitter
Mill uses coursier for dependency resolution of libraries, which puts all ... adding any code to the build, to reduce the maintainance for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found