Fork me on GitHub
#clojure
<
2022-12-31
>
quoll22:12:11

Say I'm on Windows, and would rather run bash (via WSL2) than PowerShell. In this scenario, Clojure is a much more manual process. (Yes, I can and have run apt install clojure which installs 1.10) Where do I find the appropriate scripts to run clj please? I can try to get onto other systems to look at what they're doing, but it will take a while to get onto those, so I'm hoping I can ask here. I'm setup to run clojure and get to 1.11.1, but options like -X or -T are not available. From memory those are processed in a shell script... except I don't know where to find it. (I can't compare to the Powershell setup, because that's all .exe files)

Ed22:12:24

I tend to use these instructions and manually upgrade clj whenever there's a new release. https://clojure.org/guides/install_clojure

hiredman22:12:00

What you get when you use apt-get on debian based stuff is impossibly old. I hate it, but I know some people use homebrew(on Linux vms, but I assume it would work under wsl) to keep an update version of clj installed

hiredman22:12:40

If you search in #C6QH853H8 for homebrew you can find chatter about homebrew and homebrew on Linux, particularly I think @U0CMVHBL2 has found it to be convenient

quoll22:12:34

I guess I'm just trying to work with the system that I have installed and working, but which doesn't come with a clj script

quoll22:12:19

I just went to the next room, booted up my work computer, (a mac... with an excessively long login process), and found the script there

quoll22:12:53

Took 10 minutes, but I think this might be the easiest approach

quoll22:12:12

Thanks everyone

chucklehead22:12:13

If you just need the bash scripts without an installer or anything, they are here: https://github.com/clojure/brew-install/tree/1.11.1/src/main/resources/clojure/install

👍 1
Alex Miller (Clojure team)22:12:09

Note those scripts have variable replacements in the build so you can’t just take those raw scripts from the repo

quoll22:12:40

Yup. That's what I'm tracing down right now 🙂

Alex Miller (Clojure team)22:12:25

The installer is mostly just download and untar a tar, then move files to places

quoll22:12:58

which installer is this?

quoll22:12:37

sorry... with homebrew, et al, there are lots of ways to install. I'm not really aware of the "raw" approach

Alex Miller (Clojure team)23:12:16

All of the installers are some flavor of that

Alex Miller (Clojure team)23:12:41

Homebrew is just a ruby script that puts things in brew places

Alex Miller (Clojure team)23:12:49

Whatever you’re doing seems harder than running the install script, not sure I understand

quoll23:12:05

well, apt installed a whole lotta stuff, and I didn't want to mess with any of it. Unfortunately, it doesn't have anything from tools.deps, but I had reasoned that this would be reasonably easy to add

quoll23:12:25

I was wrong though, since I don't even know how to find things like exec.jar

Alex Miller (Clojure team)23:12:30

Still not sure why not just run the Linux installer

quoll23:12:21

well, I didn't want to install yet another package manager (brew, in this case), but OK

skylize23:12:15

Under https://clojure.org/guides/install_clojure#_linux_instructions , the first 3 lines describes Brew install. Then the rest of that section describes the Linux install script. No package manager involved.

quoll23:12:27

I'm referring explicitly to brew, which you point out the instructions say to install

skylize23:12:28

Read my comment again. The Brew installation and the Linux Install Script installation are 2 completely different methods of installing.

skylize23:12:47

... That section of the docs could probably benefit from some kind of visual separator to make that more clear.

quoll23:12:38

OK, been through it more carefully. I see now. But I just spend the last 18 minutes installing brew, so I guess I can just use that now 🙂

lread05:01:53

I'm newish to using Linux as my dev OS. I do use brew to install some clojure things, but limit it to that. I started installing other things via brew and, well, I had dupe apt and brew installed things and that caused confusion.

armed07:01:12

I highly recommend using https://asdf-vm.com. It is used to manage almost everything which I need to upgrade or switch versions based on directory I’m in.

Ben Sless07:01:59

honorable mention of Nix and Guix which let you create isolated environments and install globally

2
practicalli-johnny13:01:27

The https://packages.ubuntu.com/jammy/clojure only has two dependencies, openjdk and rlwrap (reccommended), so removing the clojure package should have very little effect on packages installed. The openjdk package has many package dependencies, but removing clojure package would not remove openjdk package. https://clojure.org/guides/install_clojure#_linux_instructions is the simplest approach to installing Clojure CLI on linux (no additional package manager required)

curl -O 
chmod +x linux-install-1.11.1.1208.sh
sudo ./linux-install-1.11.1.1208.sh
I dont see rlwrap as an essential package to have. It does provide a basic REPL history, although if you need that then consider using https://github.com/bhauman/rebel-readline

practicalli-johnny13:01:35

The clj script is a wrapper around the clojure executable binary, using rlwrap to provide command history in the basic terminal REPL (and clj fails if rlwrap is not installed). I used to use clj when running a terminal REPL ui, although find rebel readline provides a far richer UI than rlwrap. https://github.com/practicalli/clojure-deps-edn/blob/live/deps.edn#L213-L221`:repel/rebel`https://github.com/practicalli/clojure-deps-edn/blob/live/deps.edn#L213-L221 which also starts an nREPL service and is called with clojure, so rlwrap and clj are not applicable to my specific workflow)

quoll13:01:29

I run things like clj -X:test all the time. Plus, I will frequently start a repl from the command line, either for Clojure or for ClojureScript (and occasionally for ClojureCLR)

clojure-spin 2
Emma Griffin15:01:00

@U051N6TTC you should join the #C060SFCPR channel if you haven't already

quoll15:01:12

What I should do is get better at C# 🙂

quoll15:01:31

Then the whole CLR story gets even more compelling

Emma Griffin15:01:59

A good way to start would be writing a ClojureCLR wrapper library for a C# library

Emma Griffin15:01:05

I don't like C# much at all, but I don't mind F#

quoll16:01:42

I have avoided F# mostly because I keep hearing that to use it well you really want to know C#. Which makes sense. I’m better at Clojure because I know Java.

Emma Griffin16:01:15

As someone who knows neither, I couldn't tell you. But I've heard F# is largely based on OCaml. I would think knowing how .NET works is more important than how C# works, per-say.

quoll16:01:31

Maybe a better conversation to have where it’s not off topic 🙂

yes 2
Thierry22:01:21

Why not just use leiningen? I have that on my Windows box, WSL1 and WSL2 distros and my Linux box.

quoll03:01:48

Because after 11 years of Leiningen I am trying to move my processes to deps.edn, since this is part of the new "batteries included" Clojure

clojure-spin 2
Thierry06:01:10

Good point indeed.