-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Nix resolver to SBT #7
Comments
So I don't think doing this for SBT is going to be quite as simple. A few options come to mind:
http://www.scala-sbt.org/0.13/docs/Proxy-Repositories.html Regardless of these options we would almost certainly need to keep a copy of the relevant ivy file (or equivalent) for each dependency to make the connection between Nix artifact and org/module/version. Suggestions welcome. |
Generate a heap of symlinks under the unmanaged jars directory. Skip Ivy. |
I was reading through the coursier resolver docs and source This has similar aspects that might be usable. In particular the cache only mode. From what I can read, Coursier uses this to implement a sandbox mode: isolated dependencies tree without requiring network access. At least "chances are" that's what it enables: "If all your dependencies are in cache, chances are coursier will not even try to connect to remote repositories" The layout of cache directory is a fairly obvious map of upstream / package / version. A quick hack might be:
|
@coreyoconnor Thanks for the suggestion. However, I feel like that would be more complicated than just generating the unmanaged jar symlinks like Brian suggested. Nix is doing the rest anyway. That said, it's not like I'm actually actively doing anything on this project, so feel free to ignore me. :) |
https://github.com/teozkr/Sbtix currently has an implementation that makes use of https://github.com/alexarchambault/coursier and pretty nearly does what coreyoconnor suggests. The coursier cache directory isn't populated with dependencies directly, instead sbt is given access to a local repo of dependencies which have been found by coursier and cached by |
So we can take advantage of all the goodies that SBT has, and in particular incremental compilation. Without this the initial dev experience is going to suffer in Nix (I suspect).
It's probably a good idea to look at how cabal2nix solves this with with
nix-shell
. It maybe easier than I think, but I'm not sure.The sooner we get this the better (and more useful) this plugin is going to be!
The text was updated successfully, but these errors were encountered: