Open SevereOverfl0w opened 6 years ago
About this, I was successfully able to pack compliment using https://github.com/boot-clj/boot-sources, and I have a task that does that + topo order.
I am not sure this is still relevant because of the new sideloading thingie but I would "only" need to add the versioning to the namespace for preventing conflicts and it should be ready to go.
This works for me in master now:
unravel --method clojure --flag compliment --classpath ~/.m2/repository/compliment/compliment/0.3.5/compliment-0.3.5.jar
Next step: bundling
@pesterhazy are you planning to use mranderson
? I am still thinking boot has an edge for this kind of things, more flexibility and stuff. Let me know if you want me to modify this gist. In there I am creating the whole blob, probably at this point I would need to just copy the sources and change the namespaces, maybe copying some part of mranderson
.
Actually this needs to happen at runtime right?
I think it can happen at build time. Unravel (or other unrepl clients) ship with their "shaded" or "vendored" version of compliment. If you connect to the same repl using the same unravel version, you'll end up reusing the same NS, but that should be fine.
I was more thinking about this use case: "Please side load this library for me", but maybe I am overengineering this.
If you're sideloading your own library, you don't need to shade it, no? Or what would be the use case?
Thanks for the gist. I'm not sure how it would be used. Could you add instructions on how to shade/vendorize compliment?
There is an example at the bottom but again...that builds the entire blob so I need to change it.
Boot-sources downloads the :deps
and saves them in the :to-dir
.
If you're sideloading your own library, you don't need to shade it, no? Or what would be the use case?
Even with sideloading, we still need shading. Without it, you might end up with classpath conflicts if you don't shade. i.e. You sideload unravel's version of compliment "X.X.X" and the user wants to use compliment "Y.Y.Y"
@arichiardi for the record, I would like to do shading with boot instead of leiningen in SPIRAL, even though I don't have a really good reason for it except that I like boot better 😄
@volrath yeah I agree that sideloading and shading are complimentary (pun intended!)
My point was just when you're sideloading your own code, i.e. not something that ships with unravel/spiral, shading may not be as important.
@pesterhazy ah! got it, right!
I'll modify the gist and contribute it here ok? Let me take a crack at this.
@arichiardi great!
I would even say that implicit shading of user code is a bad idea.
As unrepl supports out-of-band classpath loading, it would be awesome if unravel responded to requests for compliment.core.
It would be even better if unravel used it's own vendored version of compliment (at
unravel_${unravel_version}.compliment.XXX
) for preventing conflicts with either other clients (multiple unravel versions might hit the same server) and the project (I might offer RPC form of compliment, because, reasons…)https://github.com/benedekfazekas/mranderson is particularly relevant to this.