Fork me on GitHub
#leiningen
<
2019-02-26
>
lspector13:02:33

just did lein upgrade and it said it was successful but then gave me an error stack trace, and now my whole universe is broken 😞

lspector13:02:12

grabbed the script afresh from http://leiningen.org, and it's still broken in a new way

lspector13:02:53

MacBook-Pro:~ leespector$ lein
sum: /project.clj: No such file or directory
sum: /leiningen-core/project.clj: No such file or directory
Recalculating Leiningen's classpath.
sum: /project.clj: No such file or directory
sum: /leiningen-core/project.clj: No such file or directory
mkdir: /target/classes: Permission denied
/Users/leespector/bin/lein: line 205: add_path: command not found
/Users/leespector/bin/lein: line 211: add_path: command not found
/Users/leespector/bin/lein: line 213: syntax error near unexpected token `else'
/Users/leespector/bin/lein: line 213: `else # Not running from a checkout'
sum: /project.clj: No such file or directory
sum: /leiningen-core/project.clj: No such file or directory
mkdir: /target/classes: Permission denied
/Users/leespector/bin/lein: line 205: add_path: command not found
/Users/leespector/bin/lein: line 211: add_path: command not found
/Users/leespector/bin/lein: line 213: syntax error near unexpected token `else'
/Users/leespector/bin/lein: line 213: `else # Not running from a checkout'

lspector13:02:38

This is in MacOS

Alex Miller (Clojure team)13:02:04

don't know but sometimes sh -x lein will help diagnose

Alex Miller (Clojure team)13:02:27

you can also install leiningen via brew, just fyi

lspector13:02:29

Just tried renaming everything in my home directory starting with .lein but it didn't change things

Alex Miller (Clojure team)13:02:06

are you running in a dir with a project.clj?

Alex Miller (Clojure team)13:02:25

not that you need to be

lspector13:02:50

I tried both in a project with a project.clj and not.

lspector13:02:16

Here's what I get from that sh command (note that my .lein stuff is still renamed:

+ export LEIN_VERSION=2.9.0
+ LEIN_VERSION=2.9.0
+ case $LEIN_VERSION in
+ SNAPSHOT=NO
+ [[ '' != '' ]]
++ cat /.lein-project-checksum
+ LAST_PROJECT_CHECKSUM=
++ sum /project.clj /leiningen-core/project.clj
sum: /project.clj: No such file or directory
sum: /leiningen-core/project.clj: No such file or directory
+ PROJECT_CHECKSUM=
+ '[' '' '!=' '' ']'
+ '[' '!' -r /.lein-classpath ']'
+ '[' '' '!=' classpath ']'
+ msg 'Recalculating Leiningen'\''s classpath.'
+ echo 'Recalculating Leiningen'\''s classpath.'
Recalculating Leiningen's classpath.
+ ORIG_PWD=/Users/leespector/bin
+ cd ''
+ LEIN_NO_USER_PROFILES=1
+ lein classpath .lein-classpath
sum: /project.clj: No such file or directory
sum: /leiningen-core/project.clj: No such file or directory
mkdir: /target/classes: Permission denied
/Users/leespector/bin/lein: line 205: add_path: command not found
/Users/leespector/bin/lein: line 211: add_path: command not found
/Users/leespector/bin/lein: line 213: syntax error near unexpected token `else'
/Users/leespector/bin/lein: line 213: `else # Not running from a checkout'
+ sum /project.clj /leiningen-core/project.clj
sum: /project.clj: No such file or directory
sum: /leiningen-core/project.clj: No such file or directory
+ cd /Users/leespector/bin
+ mkdir -p /target/classes
mkdir: /target/classes: Permission denied
+ export 'LEIN_JVM_OPTS= -Dclojure.compile.path=/target/classes'
+ LEIN_JVM_OPTS=' -Dclojure.compile.path=/target/classes'
+ add_path CLASSPATH /leiningen-core/src/ /leiningen-core/resources/ /test:/target/classes /src :/resources
lein: line 205: add_path: command not found
+ '[' -r /.lein-classpath ']'
++ cat /leiningen-core/.lein-bootstrap
+ add_path CLASSPATH ''
lein: line 211: add_path: command not found
lein: line 213: syntax error near unexpected token `else'
lein: line 213: `else # Not running from a checkout'

lspector13:02:50

I've had issues with brew in the past but would like to try it... but don't see instructions for that on leiningen.org... What command would I use?

Alex Miller (Clojure team)13:02:37

if you don't use brew regularly you might also need to brew doctor and/or brew update

Alex Miller (Clojure team)13:02:35

it's not obvious to me what's wrong from the script above

lspector13:02:17

Sigh... here's the brew problem:

lspector13:02:29

MacBook-Pro:bin leespector$ brew install leiningen
Error: /usr/local is not writable. You should change the ownership
and permissions of /usr/local back to your user account:
  sudo chown -R $(whoami) /usr/local
Warning: You are using OS X 10.14.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.
Error: Unrecognized Mach-O load command: 0x32
MacBook-Pro:bin leespector$ sudo chown -R $(whoami) /usr/local
Password:
chown: /usr/local: Operation not permitted

lspector14:02:31

will try brew doctor and brew update

Alex Miller (Clojure team)14:02:52

the latter updates brew, the former diagnoses any issues

lspector14:02:24

Alas, both give me the same error about /usr/local, the suggest fix for which is "not permitted" when I try

lspector14:02:45

thanks. guess I will try to restore an old lein script from a backup and see if I can at least get back to work (though not on the thing that said it needed lein upgrade)

lspector14:02:03

Restored my previous lein... whew, it works. Can't do the new stuff though!

lspector14:02:02

And now lein upgrade works, whereas it didn't before... Not clear why! But I'm happy, I think. My brew mystery is still unresolved, and if anyone has insight into that I'd appreciate it.

xiongtx19:02:15

I've forgotten how leiningen handles uberjar-ing when trying to generate classes. E.g. I've a generated class SomeType in SomeType.clj that I'm requiring in core.clj. When I lein uberjar I get a ClassNotFound exception. I've got an {:uberjar {:aot :all}} profile. What's the solution here?

xiongtx19:02:05

Seems to have been an issue w/ 2.8.3. Upgrading to 2.9.0 seems to have solved the problem.