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 😞
grabbed the script afresh from http://leiningen.org, and it's still broken in a new way
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'
This is in MacOS
don't know but sometimes sh -x lein
will help diagnose
you can also install leiningen via brew, just fyi
Just tried renaming everything in my home directory starting with .lein
but it didn't change things
are you running in a dir with a project.clj?
not that you need to be
I tried both in a project with a project.clj and not.
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'
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?
brew install leiningen
great...
if you don't use brew regularly you might also need to brew doctor
and/or brew update
it's not obvious to me what's wrong from the script above
Sigh... here's the brew problem:
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
will try brew doctor
and brew update
doh
the latter updates brew, the former diagnoses any issues
Alas, both give me the same error about /usr/local
, the suggest fix for which is "not permitted" when I try
hrm
sorry, gotta run
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
)
Restored my previous lein
... whew, it works. Can't do the new stuff though!
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.
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?
Seems to have been an issue w/ 2.8.3
. Upgrading to 2.9.0
seems to have solved the problem.