leiningen

N.B. The maintainers are on #leiningen on Libera chat IRC. Go there for direct support/bug reports.
lspector 2019-02-26T13:48:33.026300Z

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 😞

lspector 2019-02-26T13:49:12.026800Z

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

lspector 2019-02-26T13:49:53.027100Z

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'

lspector 2019-02-26T13:50:38.027300Z

This is in MacOS

alexmiller 2019-02-26T13:52:04.028100Z

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

alexmiller 2019-02-26T13:52:27.028900Z

you can also install leiningen via brew, just fyi

lspector 2019-02-26T13:52:29.029100Z

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

alexmiller 2019-02-26T13:53:06.029400Z

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

alexmiller 2019-02-26T13:53:25.029600Z

not that you need to be

lspector 2019-02-26T13:53:50.029900Z

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

lspector 2019-02-26T13:54:16.030500Z

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'

lspector 2019-02-26T13:54:50.031200Z

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?

alexmiller 2019-02-26T13:56:53.031600Z

brew install leiningen

lspector 2019-02-26T13:57:11.031800Z

great...

alexmiller 2019-02-26T13:57:37.032200Z

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

alexmiller 2019-02-26T13:58:35.032600Z

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

lspector 2019-02-26T13:59:17.033Z

Sigh... here's the brew problem:

lspector 2019-02-26T13:59:29.033300Z

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

lspector 2019-02-26T14:00:31.033900Z

will try brew doctor and brew update

alexmiller 2019-02-26T14:00:34.034100Z

doh

alexmiller 2019-02-26T14:00:52.034400Z

the latter updates brew, the former diagnoses any issues

lspector 2019-02-26T14:01:24.035100Z

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

alexmiller 2019-02-26T14:01:31.035300Z

hrm

alexmiller 2019-02-26T14:01:43.035500Z

sorry, gotta run

lspector 2019-02-26T14:02:45.036300Z

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)

lspector 2019-02-26T14:15:03.037Z

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

lspector 2019-02-26T14:18:02.038Z

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.

xiongtx 2019-02-26T19:15:15.040600Z

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?

xiongtx 2019-02-26T19:25:05.040900Z

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