Fork me on GitHub
#tools-deps
<
2020-12-02
>
Alex Miller (Clojure team)03:12:36

can anyone give me a sanity check on installing clojure with the new version of homebrew from clojure tap? it is not working for me, trying to ensure it's not just me

Alex Miller (Clojure team)03:12:35

brew update
brew cleanup clojure
brew uninstall -f clojure
brew install clojure/tools/clojure

Alex Miller (Clojure team)03:12:15

ah, I had to brew untap clojure/tools before it worked

Alex Miller (Clojure team)03:12:38

they've got new shallow clone logic and I think it's just not finding new stuff because I had previously installed latest there

seancorfield03:12:24

It worked fine for me, using brew on Ubuntu, but (as usual) I had to manually run brew link --overwrite clojure afterwards.

seancorfield03:12:54

Now I have 1.10.1.739 installed as the stable version @alexmiller

Alex Miller (Clojure team)04:12:18

I assume if you brew -v you have 2.6.x ?

seancorfield04:12:11

[email protected]:~/oss$ brew -v
Homebrew 2.6.0
Homebrew/linuxbrew-core (git revision de4188; last commit 2020-12-01)
[email protected]:~/oss$

seancorfield04:12:35

(Ubuntu/WSL2 on Windows 10 -- I can try this on my Mac tomorrow)

seancorfield18:12:30

@alexmiller It worked on macOS 10.12 with a couple of caveats: the uninstall step refused:

Error: Refusing to uninstall /usr/local/Cellar/clojure/1.10.1.561
because it is required by unravel, which is currently installed.
and, as on Linux, I needed to run this afterwards:
brew link --overwrite clojure

seancorfield18:12:12

The install step worked fine (aside from the link).

Alex Miller (Clojure team)18:12:20

my tap was wholly borked, I had to untap before I got things working again, but I suspect the history of that on my machine was a unique journey :)

Alex Miller (Clojure team)04:12:47

just trying to get ahead of any possible breakage

flowthing05:12:10

Worked OK for me, FWIW.

socksy20:12:07

Today I discovered that clojure is not thread safe. I'm not sure if it's attempting to be or not, but just in case it is, it's because of the following lines:

if [[ ! -e "$config_dir/deps.edn" ]]; then
  cp "$install_dir/example-deps.edn" "$config_dir/deps.edn"
fi
If you run a clojure command in two subprocesses, e.g. clojure -M:slow-process-1 & clojure -M:slow-process-2 & on a fresh install (e.g. within a CI build image), then some of the time you'd get an error like cp: cannot create regular file '/home/circleci/.clojure/deps.edn': File exists. My attempt at a workaround right now is to run clojure at least once before running the subprocesses, to ensure that -e "$config_dir/deps.edn" will always return true

seancorfield20:12:11

For anyone using my dot-clojure repo, I just pushed an update that adds a :dev alias that mimics what we have at work for starting REBL or Reveal or Rebel Readline or a plain REPL (depending on what's on your classpath) as well as a Socket REPL (saved to .socket-repl-port so you get the same port number next time you start it in that directory); if it starts Reveal, it also adds in the auto-table-view stuff that I use at work. If adds a dev.clj file in ~/.clojure which is loaded via -e using (System/getProperty "user.home")

👍 6
nate16:12:59

This is amazing. Thanks for sharing. There's a lot too look at and learn from.

seancorfield17:12:28

The code in dev.clj could be cleaned up. It certainly needs a bit of refactoring after I added in the complexity needed to run Rebel and Reveal together!

borkdude20:12:56

@socksy that's just bash running in two different processes trying to create the file at the roughly the same time I think.

borkdude20:12:15

oh that was your point, sorry

socksy20:12:44

you're right, but it hadn't even occurred to me that that would be an issue when we made this regression. We had two slow code format checking tools which we were running in a bash script in parallel to speed up CI builds, and had just switched from lein to clojure to run them and suddenly half our CI builds were failing. Was quite a debug :)