Fork me on GitHub
#tools-deps
<
2020-02-13
>
rberger05:02:43

Does seancorfield/clj-new have a way to specify copying a binary file from the template source dir to the target dir? The doc kind of says that the render function without a data argument would do that, but it looks like it treats the file as text with linefeeds and corrupts the binary data. Is there a way to do this that still fits into the ->files body?

seancorfield17:02:51

@rberger That sounds like a nice enhancement! Feel free to open a GitHub issue. Do you know if either lein-new or boot-new support such a thing? (`boot-new` was originally based on lein-new and clj-new was forked from boot-new but I haven't tracked their progress much since).

rberger18:02:05

I haven't used the others {lein,boot}-new I'll open a github issue. I guess in the short term I could create another renderer for binary files that would do the copy

seancorfield18:02:51

Feel free to provide a PR with that enhancement too.

seancorfield18:02:25

@rberger Just looked in the code and there's a raw-resourcer which I suspect can be used to copy binary files. I can't say I remember trying that but it's worth a shot.

rberger18:02:11

It wasn't clear to me when I looked at that, but will look at it today. Thanks!

seancorfield18:02:58

https://github.com/search?q=raw-resourcer&amp;type=Code -- looks like quite a few Leiningen templates use that so that should point you in the right direction

rberger21:02:47

Looks like the raw-resourcer does the trick! No need for any changes in clj-new. Just a couple of lines in my template code (https://github.com/omnyway-labs/chromex-shadow-template) By the way for some reason https://cljdoc.org/d/seancorfield/clj-new is having problems building the docs for the most recent couple of releases of clj-new.

seancorfield21:02:44

Thanks for the heads up. Weird error Failed to read artifact descriptor for com.fasterxml.jackson.core:jackson-databind:jar:2.7.5

seancorfield21:02:30

Hmm, it's leftover in the pom.xml by accident šŸ˜ž

seancorfield21:02:07

I've pushed 0.9.0 with that fix but the doc system build process is broken right now (by changes to Clojars CDN setup). Once that's fixed, I'll rebuild the clj-new docs.

Andreas S.13:02:13

Hello I try to run clj on windows in cygwin but I get:

Andreas S.13:02:16

$ clojure Error: Could not find or load main class clojure.main Caused by: java.lang.ClassNotFoundException: clojure.main

delaguardo13:02:20

try clojure -Spath you should get a string with all the jars including clojure-%version%.jar then go check if this jar is actualy available

Andreas S.13:02:13

If I run "clojure -Spath" I get the same error

borkdude13:02:53

@andreas.scheinert We had someone here a while ago who has an older version of clojure on his path. What do you see when you type clojure -h

Andreas S.13:02:05

I have a file here: /usr/local/lib/clojure/libexec ==> clojure-tools-1.10.1.507.jar*

Andreas S.13:02:21

borkdude here is version "clojure -h" print out

Andreas S.13:02:23

Version: 1.10.1.507

borkdude13:02:34

that's good then

Andreas S.13:02:30

I know its a bit side stepping but, ok I took the effort and installed it on powershell

Andreas S.13:02:47

clj and clojure give me now a REPL

Andreas S.13:02:18

how do I run the deps code from here in powershell? https://github.com/clj-python/clj-template

Andreas S.13:02:25

clj -Sdeps '{:deps {seancorfield/clj-new {:mvn/version "0.8.6"}}}' \
  -m clj-new.create \
   \
  appcompany.funapp

Andreas S.13:02:31

I figured I remove all the \ and create a long single line of command, but then that still gives me:

Andreas S.13:02:32

Error while parsing option "--config-data {:deps {seancorfield/clj-new {:mvn/version 0.8.6}}}": java.lang.NumberFormatException: Invalid number: 0.8.6

seancorfield17:02:51

@rberger That sounds like a nice enhancement! Feel free to open a GitHub issue. Do you know if either lein-new or boot-new support such a thing? (`boot-new` was originally based on lein-new and clj-new was forked from boot-new but I haven't tracked their progress much since).

dominicm17:02:28

I notice that resolve-deps doesn't mention that it will be concurrent even if :threads isn't provided. Should it?

seancorfield17:02:40

Even following that Windows guide didn't work for me šŸ˜ž

dominicm17:02:18

make-classpath-roots mentions the system separator, but it doesn't really make sense in the context.

seancorfield17:02:32

@andreas.scheinert This worked for me:

> clj -Sdeps '{:deps {seancorfield/clj-new {:mvn/version ""0.8.6""}}}' -m clj-new.create   appcompany.funapp
So, double "" inside '

seancorfield17:02:19

(that said, even with Python 3.7 installed from the Windows Store, I can't actually get the new project to run but that should be taken up in #libpython-clj at this point)

Andreas S.11:02:50

Thank you sean for replying! Yes the quoting did the trick but I am stuck kat the same point as you I couldn't get windows python to work with libpython-clj

sam20:02:03

For private git repo deps on Windows, is only Pageant supported as the ssh agent for authentication or can OpenSSH also work?

Alex Miller (Clojure team)21:02:38

I know that pageant works, don't know about openssh

sam21:02:30

@alexmiller I have been trying. It seems to be attempting to use OpenSSH. I can tell because the specific error message I get changes depending on whether github is added to .ssh/known_hosts. However, even though I can use git on Powershell to clone a private git repo, I get an error when trying to run clj with a private github dep. The lowest part of the stack trace is just:

Caused by: com.jcraft.jsch.JSchException: Auth fail
        at com.jcraft.jsch.Session.connect(Session.java:519)
        at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:126)
        ... 45 more
which doesnā€™t give me a ton to go on. Itā€™s been really painful to debug.

Alex Miller (Clojure team)21:02:57

well I think I would say, no it doesn't work then

sam21:02:36

Itā€™s been finicky to get it working even with Pageant. So Iā€™m never sure whether something just doesnā€™t work, or if Iā€™m just doing something slightly wrong

Alex Miller (Clojure team)21:02:38

ssh is generally tricky, particularly with access to the wide world of credential providers

Alex Miller (Clojure team)21:02:03

there are some options (including shelling out to just use git) which we have explored. newer versions of jgit use apache mina instead of jsch. I have spent some time working on evaluating these alternatives but haven't had time to really get to the end of that process

Alex Miller (Clojure team)21:02:29

another option would be to clone, then use as a local repo instead

Alex Miller (Clojure team)21:02:10

or to clone, build and install a local artifact, then use that

sam21:02:09

Okay, thanks. One other question for you. Iā€™ve resorted to trying OpenSSH on one of our devā€™s windows machines only because we couldnā€™t get deps working with Pageant on that machine. I have no idea why itā€™s not working because weā€™ve been able to get it working on other Windows machines. Based on your experience, do you have any idea of any ā€œgotchasā€ we might be running into? The error message is the same as above.

sam21:02:05

If not, thatā€™s okay, I know thatā€™s a very vague question. Just wondering if anything comes to mind of the top of your head

Alex Miller (Clojure team)21:02:57

I don't unfortunately. the jsch stuff is a bit flaky

sam21:02:23

Okay, well thanks anyway. Btw, just wanted to say I was at StrangeLoop in September and really enjoyed it. Thanks for doing that.

ghadi21:02:53

if you're using any ssh agent, make sure the SSH_AUTH_SOCK variable is set so that Clojure (via JSch) knows where the agent is

sam21:02:15

cool, thank you, Iā€™ll look into that.

sam22:02:48

Are you sure this is applicable for Windows? I canā€™t find much information about it in the context of Windows, and Clojure seems to work fine on my windows machine using Pageant as the ssh-agent without this env variable being set.

ghadi22:02:56

ssh clients discover where an agent is running by consulting that environment variable

ghadi22:02:52

that's what jsch does, too.... sorry Windows just adds a lot of extra wildcards because of all the various linux-y environments

ghadi22:02:04

just in case he knows

seancorfield22:02:49

I know nothing about ssh on windows, sorry

seancorfield22:02:57

I only ever use ssh stuff via Ubuntu / WSL on windows šŸ˜

sam22:02:00

Thanks anyway!