Fork me on GitHub
#clj-on-windows
<
2022-04-13
>
leifericf11:04:26

Here’s a relevant ongoing discussion (see comments in that thread).

👀 1
borkdude11:04:46

@U03BMTULBSL deps.clj does not require you to install powershell

👍 1
Serafeim Papastefanos11:04:54

yes i know it however it's not mentioned at all on the getting started guide for windows usesr

Serafeim Papastefanos11:04:04

so how a new user is supposed to know about it ?

Serafeim Papastefanos11:04:30

also, there's no mention about how to create a new project there!

borkdude11:04:55

well, maybe add it?

Serafeim Papastefanos11:04:22

i can't take that decision myself

Serafeim Papastefanos11:04:33

if it's not there maybe there are reasons for not being there

borkdude11:04:31

I don't think anything will change on the windows side unless people will pro-actively report issues and submit PRs

👍 1
Serafeim Papastefanos12:04:08

yes you are right i guess ... where could I report an issue with these docs ?

👍 1
seancorfield16:04:04

(I have "Contrib" permission as a maintainer so I don't know if that wiki is restricted)

Serafeim Papastefanos16:04:46

Seems that I can edit it. I'll try to add some tips for new users from my experience

1
Serafeim Papastefanos06:04:05

Hey @U04V15CAJ @U04V70XH6 I've installed deps.exe (deps.clj - https://github.com/borkdude/deps.clj ) on my windows system and it seems to be working (i get a clojure rpl when I run deps). now I want to install deps.new (https://github.com/seancorfield/deps-new) to be able to create a new project.

Serafeim Papastefanos06:04:40

I tried this command for starters (to avoid the quoting problems): deps -Ttools install io.github.seancorfield/deps-new :as new and got: Key is missing value: new

Serafeim Papastefanos06:04:48

I also tried various other combinations i.e deps -Ttools install io.github.seancorfield/deps-new '{:git/tag "v0.4.9"}' :as new or deps -Ttools install io.github.seancorfield/deps-new '{:git/tag """v0.4.9"""}' :as new but always got the same error (Key is missing value: new

Serafeim Papastefanos06:04:53

when I run -Ttools install without parameters I get:

deps -Ttools install
Execution error (ExceptionInfo) at clojure.tools.tools.api/install (api.clj:37).
Missing required args, syntax: clj -Ttools lib-name coord :as tool-name

Serafeim Papastefanos06:04:02

any help would be welcome, thank you !

borkdude06:04:45

You are executing this from cmd.exe right?

Serafeim Papastefanos06:04:35

i only use cmd.exe i hate powershell

borkdude06:04:06

afaik cmd.exe doesn't support single quote for delimiting strings on the command line

Serafeim Papastefanos06:04:32

ok but shouldn't this thingie deps -Ttools install io.github.seancorfield/deps-new :as new work ?

borkdude06:04:27

I think so. I'm not near a Windows machine today (travelling) but I can try tomorrow

Serafeim Papastefanos06:04:25

can you explain me what "coord" is ? from this message: Missing required args, syntax: clj -Ttools lib-name coord :as tool-name

Serafeim Papastefanos06:04:50

is there a way to pass a coord in cmd.exe ?

borkdude06:04:58

coord is something like :mvn/version "1.0.0"

Serafeim Papastefanos06:04:42

hey i made it work !

Serafeim Papastefanos06:04:49

here's the command: deps -Ttools install io.github.seancorfield/deps-new "{:git/tag """v0.4.9"""}" :as new

Serafeim Papastefanos06:04:23

you helped my by pointing out that the ' aint' working in cmd.exe 🙂

👍 1
Serafeim Papastefanos06:04:38

yey deps -Tnew app :name spapas/newapp succeeds!

Serafeim Papastefanos06:04:14

now if i visit my newapp folder and run deps.exe i'll get a repl on my app ?

borkdude06:04:37

I wish there was a way to omit those quotes on the command line. It would cause less confusion between OSSes. This issue is about that. If you agree, please upvote it: https://ask.clojure.org/index.php/11585/consider-convention-for-bypassing-edn-parsing-in-x-usage /cc @U064X3EF3

1
borkdude06:04:40

Although in this case you would likely still need quotes since the coordinate map should be handled as one whole thing.

borkdude06:04:11

There is also a wiki where you can add helpful info about working on Windows: https://github.com/clojure/tools.deps.alpha/wiki/clj-on-Windows

Serafeim Papastefanos06:04:32

Yes I'll try; but will my changes be reviewed by somebody? I don't know what's the policy for writing stuff

borkdude06:04:07

Good question, maybe Alex can respond to that.

Serafeim Papastefanos06:04:33

I could write a small article on my blog instead (https://www.spapas.net/) ?

Serafeim Papastefanos06:04:17

cool I'll do that to be sure that I express my opinions 🙂 thanks

Serafeim Papastefanos08:04:43

Ok I've created a new project using the https://github.com/seancorfield/deps-new/ however when I try to run anything using deps -X I get: No function found on command line or in :exec-fn

Serafeim Papastefanos08:04:39

here's the deps.edn I have:

{:paths ["src" "resources"]
 :deps {org.clojure/clojure {:mvn/version "1.10.3"}}
 :aliases
 {:run-m {:main-opts ["-m" "depsapp.core"]}
  :run-x {:ns-default depsapp.core
          :exec-fn greet
          :exec-args {:name "Clojure"}}
  :build {:deps {io.github.seancorfield/build-clj
                 {:git/tag "v0.6.3" :git/sha "9b8e09b"
                  ;; since we're building an app uberjar, we do not
                  ;; need deps-deploy for  deployment:
                  :deps/root "slim"}}
          :ns-default build}
  :test {:extra-paths ["test"]
         :extra-deps {org.clojure/test.check {:mvn/version "1.1.1"}
                      io.github.cognitect-labs/test-runner
                      {:git/tag "v0.5.0" :git/sha "48c3c67"}}}}}

Serafeim Papastefanos08:04:07

now I'm running f.e deps -X:run-m`` and get No function found on command line or in :exec-fn``

borkdude08:04:17

You need run-x there probably

Serafeim Papastefanos08:04:30

yes you are right thank you

Serafeim Papastefanos09:04:33

i'm running deps.exe and getting a repl in the user namespace. is there a way to define the namespace before starting ?

borkdude09:04:53

@U03BMTULBSL You can do -i init.clj with some initialization code

borkdude09:04:26

echo '(ns dude) (clojure.main/repl)' > /tmp/init.clj
clj -M -i /tmp/init.clj
dude=>

Serafeim Papastefanos09:04:02

i've posted it on #beginners, shall i post it anywhere else ?

borkdude09:04:43

#news-and-articles is the channel for sharing posts

borkdude09:04:49

good post, that's really helpful for beginners

borkdude09:04:49

One piece of feedback: > To be able to create a new project you’ll need to use the https://github.com/seancorfield/deps-new project. I hardly use any such tool, I create my projects usually from scratch. I've also written a small #babashka script to add stuff to existing projects, like dependencies: https://github.com/babashka/neil

Serafeim Papastefanos09:04:24

you mean you create your project by creating the required folders and deps.edn by hand ?

borkdude09:04:07

clj-new / deps-new are convenient but manually it's not too hard to setup a project either

Serafeim Papastefanos09:04:43

yes you are right i'll rephrase that a bit

Serafeim Papastefanos09:04:11

it's just that for a newbie it's easier (and faster) to create the project skeleton through a tool instead of by hand