Fork me on GitHub
#clojure
<
2021-07-16
>
borkdude08:07:09

clojure-lsp can also do it from your editor: lsp-organize-imports (in emacs), also without a REPL, but it now also offers a command line interface

Chandru16:07:24

Is there a good library to draw colorful rectangles on terminal? sort of like a HUP but not real-time. just static.

phronmophobic16:07:48

From java, there's https://github.com/mabe02/lanterna. There's some clj wrappers: • https://github.com/multimud/clojure-lanterna/ • my library, https://github.com/phronmophobic/membrane I think there's also some pretty good cljs options: • https://github.com/eccentric-j/cljs-tui-template • or you can interop with the https://github.com/chjj/blessed node library.

Chandru16:07:10

Thank you for this! I will take a look 🙂

denik16:07:53

just tried the new build tools but couldn’t run them from the command line even though I’m using the newest version of clojure tools

clj -T:build jar                  
-T is no longer supported, use -A with repl, -M for main, or -X for exec
clj --version
Clojure CLI version 1.10.3.855
Any ideas?

noisesmith16:07:44

did you try clj -X:build jar ?

noisesmith16:07:54

I mean given that message that's the first thing I'd try

hiredman16:07:48

that is what you get with a non-latest

hiredman16:07:00

-T is supported and does the tool thing now

hiredman16:07:13

it may be that you have the latest released version, and the -T stuff is in the prerelease, but I haven't been paying close attention to the version numbers

Chase16:07:16

Yep, you want 1.10.3.905 for all the new goodness

👍 2
hiredman16:07:42

I think there is even another pre-release after that

hiredman17:07:05

1.10.3.912 is the latest pre-release

👍 2
seancorfield17:07:59

@denik If you're interested in following the tools.deps/CLI developments, there's #tools-deps

👍 2
hiredman18:07:15

the consumer should be using some build tool that pulls it out of something like a maven repo where it has a pom that lists all its dependencies

hiredman18:07:57

if you are already pulling from a maven repo, and still need to list all the deps, that means when you publish your jar to the maven repo you are not providing the list of its deps

aaron5118:07:22

We are using mvn deploy:deploy-file to push to maven. Maybe that has an option to specify dependencies… thanks3

hiredman18:07:46

yes, you'll need to pass it a pom file

hiredman18:07:48

if you are using a lien project, I would look at using lein's deploy task instead

aaron5118:07:53

It worked! Thank you. I used lein pom; lein jar; mvn -DpomFile=pom.xml ... I’ll try lein deploy next.

seancorfield18:07:44

(and maybe these questions are better suited to #beginners?)

aaron5119:07:43

@U0NCTKEV8 Thanks for your help, we have a working lein deploy command now (also using lein-gitlab-wagon & lein-sha-version)

Chandru18:07:33

So I’m trying to compile a small clj file that makes use of sqlite via org.xerial/sqlite-jdbc … All works good as long as I’m in the REPL and running it through clj. I compile the file into a binary through GraalVM native-image utility. It compiles fine but when I run, I get this issue:

Caused by: java.lang.Exception: No native library is found for os.name=Mac and os.arch=x86_64. path=/org/sqlite/native/Mac/x86_64
I’m completely new to Clojure (and have no knowledge of Java/JDBC etc) so wondering if anyone has compiled a clj+sqlite to binary and got it to work .. and if yes, how?

Chandru18:07:35

I’m reading in Java-specific troubleshooting mechanisms that I need to include the xerial-sqlite JAR file in the classpath .. but how would I do that in clojure and would that help?

hiredman18:07:23

that error means sqlite-jdbc is already on your classpath

hiredman18:07:38

but sqlite-jdbc depends on a native code library, and it needs a different native code library for everything os/achitecture, and it is distributed with a bunch of a prebuilt native code for different platforms, and when it loads it looks for in the one it needs for your platform

hiredman18:07:02

and that is the error thrown when it cannot find pre-built native code for your platform

hiredman18:07:04

I generally prefer something like apache-derby for this reason (the sqlite drivers all need whacky native code)

hiredman18:07:33

I do see the code for that platform in the latest sqlite jar

% jar -tf sqlite-jdbc-3.36.0.1.jar |grep org/sqlite/native/Mac/x86_64
org/sqlite/native/Mac/x86_64/
org/sqlite/native/Mac/x86_64/libsqlitejdbc.jnilib
%
so you may need to move to a newer version or something

hiredman18:07:05

oh, sorry, I missed the graalvm part of your question

hiredman18:07:04

there is a #graalvm channel, and you should ask there, but I suspect building the graalvm image will need some special flag or something to tell it you are are going to be linking with some other native code

👍 2
Chandru19:07:37

Thanks for the pointers! I’ll ask in the GraalVM chanel