I'm working on a clojure project that needs to include a single Java file. For simplicity I'd like to put them all in the same folder. Is there a way to do this with deps.edn? The only project I can find that does smth like this is byte-streams, but that uses Leningen
I have a deps.edn project that compiles java files. I just use a https://github.com/phronmophobic/clj-cef/blob/main/javac.sh that calls javac
:
#!/bin/bash
find javasrc -name '*.java' -print0 | xargs -0 javac -target 1.8 -source 1.8 -d classes -cp `clj -Spath
`
The java files are in javasrc
and the class files are put in the folder classes
which I add :paths
in deps.edn
https://github.com/phronmophobic/clj-cef/blob/main/deps.edn#L1Thanks, I'll try that!
Is there a way to bring in test sources from a deps.edn
project brought in via :local/root
to another deps.edn
project?
Hi,
I’m using deps.edn
I’m trying to run my tests using a test-runner
and indeed it executes the tests, and afterwards main
thread exits ok (I see it via jstack),
however process is still running.
Does anyone has an idea?
probably (shutdown-agents)
is needed somewhere
You can Ctrl+\
and see what each thread is doing
I’m trying to setup CI so I can’t do that.. I had some excepion somewhere that maybe caused some “future” threads , which are non-daemon threads, to keep on running.
So @borkdude you were right, but this function was already called in the test-runner. Thanks
https://www.isitdownrightnow.com/clojurians-log.clojureverse.org.html Hi, the clojurians-log seems to be down right now
@dimitar.ouzounoff you can post in #clojureverse-ops or #lambdaisland
Maybe bisecting the set of tests? (admittedly, not super practical).
I recall something similar to this when using clojure.shell.sh
to invoke some external utility
This was my issue, by the way: > As noted in the http://clojuredocs.org/clojure.java.shell/sh#example-542692d6c026201cdc3270e7, `sh` uses futures. This means that if your program uses `sh` and then finishes its execution it will unexpectedly hang and not terminate/exit. The `sh` future will still be alive in the background and will be holding up the program. > This is a bit confusing when you first try to use Clojure for scripting as it looks like your script doesn’t exit naturally. Furthermore, when you run `sh` in the REPL the background futures aren’t apparent to the user and everything works as-expected > To fix the situation you can either run `(System/exit 0)` to terminate your program explicitly. Or you can run `(shutdown-agents)` to kill the background future and then the program will exit naturally > For a discussion of this strange behavior see: https://clojureverse.org/t/why-doesnt-my-program-exit/3754/2 https://clojuredocs.org/clojure.java.shell/sh
hello, about git deps on deps.edn
, does the commit needs to be merged on master to work? I’m trying to use a SHA that’s in a branch (and pushed), but when I try to add this dep Clojure says it can’t realize it (using the SHA from master works fine)
no, any sha will work
there have been some issues with the clojure CLI and git deps lately, upgrading to the newest and blowing out ~/.gitlibs
usually works
that did the trick, thanks!
Yeah, 1.10.3.822 contained a bug fix for the situation of switching to a new SHA that is on a branch, ahead of the last SHA you used. I kept running into that bug while working with Polylith (since I’m tracking their issue-66
branch via git/deps).
I remember a Blog post on reading greater than and less than as “increasing” and “decreasing” respectively - anyone got the link?
it's how I learned them as a kid - <
and >
are graphs of magnitude
I never saw a blog post on it though
@martinklepsch That’s how they are described here: https://clojuredocs.org/quickref
It’s also in the docstring: https://clojuredocs.org/clojure.core/%3C
(`<` means monotonically increasing, >
means monotonically decreasing)
So “reading greater than and less than as decreasing and increasing respectively” — the opposite of what you have…
I wrote a piece on bug reporting. Some of it is Clojure and/or Datomic specific but much is general. I am interested in feedback, additional resources, war stories if you have any. Thanks! https://docs.datomic.com/cloud/tech-notes/writing-a-problem-report.html
I’m not that much into demunging (that was a possible direction for solution search that I noted I’m not sure it’s worth pursuing) as my main concern is duplicates of unreachable (?) runtime-generated code with inaccurate lines..
@hiredman interesting remarks about invokeStatic
, I didn’t know some info might be extracted from that
I like it. If you're open to suggestions i would suggest adding a bit of explainer to the section "A report is also noticeable for what it does not contain: ". I think I know what you're getting at but it might seem bewildering to others who haven't absorbed some of this. possible suggestions - wrong analysis can cause wasted time going down rabbit holes - "right" analysis presupposes there's only one alternative or fix, can cause fixation on the first considered fix, prevents looking more broadly for other fixes, etc
Thanks @dpsutton! I think the entire things stands to be fleshed out with examples
Seems timely, given this on Ask: https://ask.clojure.org/index.php/10470/stacktraces-clojure-functions-contain-irrelevant-information 🙂
@dpsutton (how) would you like to be credited?
no need. just happy to have a good document to refer myself and others to
but thanks for offering
@seancorfield re: stacktraces there are many contextual reasons to summarize/elide detail. All such contexts are well served by having the original detail to summarize from. 🙂
The two main issues in Vlaaad’s post on Ask are things I’ve certainly wondered about myself in the past, namely: is there a need to have both the invoke
frame and the invokeStatic
frame, and could the stacktrace be demunged for Clojure code? That said, I’ve certainly had stacktraces where the invokeStatic
line either doesn’t match my code or is missing and at least the invoke
line points to the correct function (definition). As for demunging, I’m probably too used to Clojure’s name-munging to really benefit from it now but I can see the benefit for new-to-Clojure folks.
But all of that could be wrapped up in a “beginner REPL” vs “regular REPL” I suppose.
or a help-me API in a REPL
stack traces are a deep dive anyway, most beginner-level troubleshooting is better off ignoring them
> or a help-me API in a REPL
i was thinking the other day of how repls could provide this. making a history saving repl. the best i've come up with so far is symbols with a leading question mark to indicate the repl should interpret it. (?grepl/root let)
. and was thinking would be interesting if repls should provide a standardized (?help)
to give information
I haven’t had a chance to play with clem
yet but it sounds interesting.
coincidentally I was just responding to Vlaaad