-
Notifications
You must be signed in to change notification settings - Fork 9
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
Document alternative Clojure CLI usage #48
Comments
Yes please! I use the clojure CLI and would be keen to try this feature out |
Thanks for the interest! This repo bundles clojure.sh. If you use CIDER, it's also always bundled with each release and can be found in e.g. So you can download it, or reference it (the latter is recommended for always having the latest version) Now, asuming
Where The usage is simple: it has the same arguments as What the script does is:
You can create a utility function that wraps the pattern above, adding it to your bash/zsh init file: enrich(){
~/.emacs.d/elpa/cider*/clojure.sh clojure "$@"
}
# Usage:
# enrich foo bar baz # pass any argument you'd normally pass to `clojure` That's about it - please let me know how it works for you, and I'll add it all to the README. Cheers - V |
Thanks @vemv - I tried it out and successfully started my program as usual. However when I use
|
Thanks! For discarding possibilities, it would be useful to try a minimal local project first? |
Sure, I've created https://github.com/anonimitoraf/barebones-clojure and did the same steps as in your recording (I think) Screen.Recording.2023-11-10.at.9.38.11.pm.mov |
Nice, thank you! Could you share your JVM process classpath? As found with |
No worries
|
Got it, you need to install the JDK sources in Ubuntu https://docs.cider.mx/cider/troubleshooting.html#navigation-to-jdk-sources-doesnt-work (as you can see those instructions are for JDK17; if you're using something newer, I'd appreciate a docs update) |
...At this point, given that Enrich wraps both Lein and tools.deps, we could proactively ensure that those sources are there e.g. fail-fast when not found. (Users can always disable Enrich if that requirement cannot be immediately satisfied) |
Great, installing |
Cheers, enjoy! Any kind of feedback always welcome. There's a small refinement coming clojure-emacs/cider#3576 |
Oh yea, regarding docs, how can I do the same for third-party libs? For example: https://stripe.dev/stripe-java ? |
Yes, if you depend on a given Maven library, they always include (per the Maven rules) a "sources" jar. enrich-classpath fetches those. |
I see. I can see that Stripe, for example indeed do have docs and sources:
but I'm not seeing docs in CIDER inspector 🤔 |
Will try soon! Sometimes it happens that there's some issue in the .java files that makes them unparseable (example) |
Actually, my bad, I should've checked if this is the case without Yep same issue with just invoking I don't get this issue with my minimal project https://github.com/anonimitoraf/barebones-clojure so it might be something specific with my proper project |
The simplest explanation is that it's performing this one-off job. On my machine (which as mentioned can be very noisy) it never hogs the CPU and it completes reasonably fast. It also completes quickly on cider-nrepl's CI matrix. Are you sure that the 100% lasts more than a few minutes? |
Regarding Stripe, the underlying parsing errors come from the fact that is uses Lombok at build time, but it's not a Maven dependency. So without it in the classpath, the Java parser will complain. They even had some historical issues related to Lombok. It's a plugin which has a mixed fame. https://github.com/stripe/stripe-java/issues?q=is%3Aissue+lombok Note that, however, jump-to-definition works. |
Cool thanks for the info. I'll send through peofiling results tonight. From my observation, CPU usage hangs around at 100% for a few minutes after the program has finished startup, I'll check later if this goes on for longer Re: Stripe - I see, no worries! |
Cheers. clojure-emacs/orchard#211 would solve all issues (Stripe parsing and CPU hogging - assuming we've guessed the cause correctly). It might become a reality before the year wraps up! |
Besides from the suggested makefile, one could use clojure.sh directly (at the cost of losing some caching).
This is worth documenting, maybe with a suggested accompanying bash/zsh helper to use it concisely.
The text was updated successfully, but these errors were encountered: