-
Notifications
You must be signed in to change notification settings - Fork 53
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
feature request: lein plugin for capsule #39
Comments
There's https://github.com/circlespainter/lein-capsule, it's 3rd-party for now and needs to be updated to the latest capsule versions but it might work for you. |
that looks promising, any plans to support it officially? |
There aren't official support plans about it at the moment. |
Seeing how there's already a working plugin it would be nice to provide it officially as pretty much anybody working with Clojure is likely to be using Leiningen. The fact that you have to use a separate build tool is a big deterrent. |
Keeping it working and regularly updated is definitely important. Have you tried it anyways? Does it work for you? |
Doesn't appear to work no, it compiles and generates a jar, but running it produces:
Which I'm assuming means the agent is not being injected. Also, out of curiosity why is it not possible to build pulsar with plain Leiningen as it allows specifying java agents, is there something else that happens during capsule packaging? |
Hi.
Again: Pulsar and Capsule are completely orthogonal, and none of them requires the other. |
Thanks for the explanation, I guess the question is then if there is a concrete example available of a pulsar application packaged with Leiningen if that's possible. The official docs show how to use |
No, we don't have an example (we'll add one). The only "special" thing you need to pay attention to is adding the javaagent to the command line (pointing to the quasar-core jar). If packing into an uberjar (haven't tried this myself), you'll be able to point the javaagent flag to the uberjar itself, but then you'll need the uberjar's manifest to specify that it contains an agent:
|
thanks that makes sense |
So, I tried creating an uberjar that contains the above properties in the manifest, however I still get I added the manifest properties in :manifest {"Premain-Class" "co.paralleluniverse.fibers.instrument.JavaAgent"
"Agent-Class" "co.paralleluniverse.fibers.instrument.JavaAgent"
"Can-Retransform-Classes" "true"
"Can-Redefine-Classes" "true"} Extracting the jar built using
the sample project can be found here everything works fine when using |
Have you added |
ah thanks that works
|
You don't need the quasar-core JAR anymore, now that you have the manifest entries (or, alternatively, you don't need the manifest entries if you're using the quasar-core JAR). Try:
Now capsule indeed lets you embed the command line flags (for the agent or anything else) in the JAR file, and it also prevents other collisions that may (and do) happen when building a fat JAR. You might want to try the leningen plugin with Capsule 0.10.0 or 0.9.0 until it is updated. |
Yeah, I updated to add |
@pron Here's the sample project All I see is
the same happens when I do
This is on OS X 10.10.3 and JDK 1.8.0, is there something obvious I'm missing here? |
This was caused by an AOT-related bug which has now been fixed. Thanks for reporting. |
@yogthos You should also join the actors before returning from the main thread, else you risk exiting before they complete. |
Great thanks for the quick response, and I updated the example to use join. Are you releasing the fix to Clojars? |
A new Quasar/Pulsar bug-fix version will be released in a few days. If you want, you can try |
excellent, and can confirm everything is working as excpeted |
@yogthos The current master of |
Great thanks, I'll let you know if I run into anything funky. |
There's now |
This is an example application using it: https://github.com/circlespainter/capsule-1.0-sample/tree/master/clj-lein |
Since Leiningen is the de facto build tool for Clojure, it would be nice if there was a plugin for packaging capsule jars.
The text was updated successfully, but these errors were encountered: