clj-on-windows

For those interested in making clj on Windows https://dev.clojure.org/jira/browse/TDEPS-67. Also see https://github.com/littleli/scoop-clojure.
nori 2019-08-25T23:17:46.399200Z

Hi, I'm encountering an issue when using lein from any directory outside ~

nori 2019-08-25T23:20:28.401Z

I'm getting the error message "java.io.IOException: Cannot run the program clojure in directory /_dev/overtone. CreateProcess error=2The system cannot find the file specifiedat java.lang.ProcessBuilder.start (ProcessBuilder.java:1128)Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specifiedat java.lang.ProcessImpl.create (ProcessImpl.java:-2)" when I attempt lein deps or lein repl outside of . I can access clojure via clj, but lein can't.

seancorfield 2019-08-25T23:21:42.401600Z

Are you running Leiningen in Powershell or regular Windows cmd?

nori 2019-08-25T23:21:56.401900Z

Powershell.

seancorfield 2019-08-25T23:24:06.402500Z

And you're using some sort of plugin in Leiningen that tries to run the CLI/`deps.edn` clojure command?

nori 2019-08-25T23:27:26.403200Z

lein deps is core functionality of leiningen. https://stackoverflow.com/questions/28225791/how-does-lein-deps-work

seancorfield 2019-08-25T23:27:50.404100Z

I know what lein deps is. I have no idea why it would be trying to run the clojure command tho'.

nori 2019-08-25T23:27:51.404300Z

I get the same error if I try 'lein repl' from any directory besides ~

seancorfield 2019-08-25T23:28:22.404900Z

And that's the standard lein.bat shell script, installed from the <http://leiningen.org|leiningen.org> site?

nori 2019-08-25T23:28:28.405200Z

Yes.

nori 2019-08-25T23:29:01.406100Z

my :user profile calls one plugin, :plugins [[org.clojars.gmoe/overtone-template "1.0.1"

nori 2019-08-25T23:29:33.406600Z

It also calls two dependencies, :dependencies [[org.clojure/tools.nrepl "0.2.12"] [org.clojure/clojure "1.9.0"]

nori 2019-08-25T23:29:48.407Z

I added those while troubleshooting this issue.

seancorfield 2019-08-25T23:31:23.408700Z

Leiningen doesn't know anything about clojure (the CLI) so I've no idea why it would even try to run it...

nori 2019-08-25T23:31:25.408800Z

This error first arose when I called "lein repl" in ~/_dev/overtone. Because it was having a hard time finding clojure, I added it as a :user dependency.

seancorfield 2019-08-25T23:31:50.409400Z

You're misunderstanding the error.

seancorfield 2019-08-25T23:32:28.410200Z

Walk us through the exact steps you used to create ~/_dev/overtone -- did you just clone the overtone repo into there?

nori 2019-08-25T23:32:32.410500Z

Yup.

nori 2019-08-25T23:32:48.410900Z

git clone <overtone url>

seancorfield 2019-08-25T23:33:24.411400Z

Ah, so Overtone itself has middleware to try to get Leiningen to run clojure

seancorfield 2019-08-25T23:33:43.412Z

I bet it relies on the old (clojure-env) trick in tools.deps that never worked on Windows.

nori 2019-08-25T23:33:47.412200Z

The only middleware I'm using is cider-nrepl

seancorfield 2019-08-25T23:34:09.412500Z

If you cloned overtone, you're using this https://github.com/overtone/overtone/blob/master/project.clj#L48

nori 2019-08-25T23:34:25.412900Z

mhm

seancorfield 2019-08-25T23:34:39.413300Z

According to the overtone docs, you don't need to clone it to use it.

seancorfield 2019-08-25T23:35:04.414100Z

Just create a new project folder (empty) and add deps.edn per the instructions on the overtone repo...

nori 2019-08-25T23:35:42.414700Z

I've got one of those handy. I cloned it because I was having trouble getting it to work and I wanted to try and ascertain the source of the issue.

seancorfield 2019-08-25T23:37:23.415Z

"having trouble getting it to work" -- what problem were you having?

nori 2019-08-25T23:38:05.415600Z

My notes are scruplesome so I'm going to quickly test it again.

seancorfield 2019-08-25T23:38:23.415900Z

WARNING:
Aug 25, 2019 4:37:49 PM clojure.lang.Reflector invokeMatchingMethod
SEVERE: Unable to load native libs c and scsynth. Please try an external server with (use 'overtone.core)
--&gt; Booting internal SuperCollider server...
Exception in thread "Thread-3" java.lang.NullPointerException
-- that perhaps?

seancorfield 2019-08-25T23:39:16.416600Z

I seem to remember there were all sorts of software setup steps required before Overtone worked.

seancorfield 2019-08-25T23:40:28.417100Z

"If using a 64-bit version of Windows, you need to install SuperCollider manually and connect to an external server." -- so you need to install SuperCollider itself, separate from Overtone.

nori 2019-08-25T23:44:15.417600Z

I've got supercollider installed

nori 2019-08-25T23:44:29.418300Z

I guess you just have to use overtone.core instead of overtone.live

seancorfield 2019-08-25T23:44:38.418700Z

And you're using overtone.core per the instructions?

nori 2019-08-25T23:44:53.419Z

Whatever I was hung up on before I fixed in the process of debugging this other problem that you just sidestepped for me

nori 2019-08-25T23:45:12.419400Z

I'm still testing

seancorfield 2019-08-25T23:45:55.419900Z

If it works when using clj / clojure, I would say don't bother trying to use lein with it.

seancorfield 2019-08-25T23:50:41.420500Z

(I'm installing SuperCollider 3.10.2 on my Windows machine so I can help debug things 🙂 )

nori 2019-08-25T23:54:47.422200Z

Well thank you! I'm currently doing what debugging I can try before I ask questions.

seancorfield 2019-08-25T23:55:07.422600Z

OK, installed SC and checked the IDE runs. Used clj in Powershell to start a REPL with Overtone as a dependency. Ran (use 'overtone.core) and it complained about the lack of sc native libs (as expected) but then showed the commands to start a server, which I did, and the demos work...

seancorfield 2019-08-25T23:55:30.422900Z

SEVERE: Unable to load native libs c and scsynth. Please try an external server with (use 'overtone.core)
--&gt; Please boot a server to start making noise:
    * (boot-server)             ; boot default server (honours config)
    * (boot-internal-server)    ; boot an internal server
    * (boot-external-server)    ; boot an external server
    * (connect-external-server) ; connect to an existing external server

nil
user=&gt; (boot-external-server)
--&gt; Booting external SuperCollider server...
--&gt; Connecting to external SuperCollider server: 127.0.0.1:27435
--&gt; Connection established

    _____                 __
   / __  /_  _____  _____/ /_____  ____  ___
  / / / / | / / _ \/ ___/ __/ __ \/ __ \/ _ \
 / /_/ /| |/ /  __/ /  / /_/ /_/ / / / /  __/
 \____/ |___/\___/_/   \__/\____/_/ /_/\___/

   Collaborative Programmable Music. v0.10.6


Hey Sean, I feel something magical is only just beyond the horizon...

:happy-hacking
user=&gt; (demo (sin-osc))
#&lt;synth-node[loading]: user/audition-synth 33&gt;
user=&gt; (demo 7 (lpf (mix (saw [50 (line 100 1600 5) 101 100.5]))
                   (lin-lin (lf-tri (line 2 20 5)) -1 1 400 4000)))
#&lt;synth-node[loading]: user/audition-synth 34&gt;
user=&gt;

nori 2019-08-25T23:55:34.423100Z

Cool!

nori 2019-08-25T23:55:37.423400Z

I just got through

nori 2019-08-25T23:55:49.423700Z

What I was doing when I was being quiet was addressing uhh:

nori 2019-08-25T23:56:47.424700Z

SuperCollider was throwing a 'too many users' error so I threw up >s.options.maxLogins = 2; and restarted the whole shebang and I got 'happy hacking'

nori 2019-08-25T23:58:09.425300Z

This is my third day of setting up clojure 😄 I'm real excited

seancorfield 2019-08-25T23:58:26.425800Z

And you're tackling something pretty big and complex IMO (Overtone).

seancorfield 2019-08-25T23:59:31.426600Z

Glad the CLI/`deps.edn` tools on Powershell are working for you!