Fork me on GitHub
#deps-new
<
2020-12-19
>
runjorel01:12:18

Hi all. i have a fresh install of clj tool and clj-new but I am getting this error Unqualified function can't be resolved: create

runjorel01:12:31

I've followed the instructions on the github readme

runjorel01:12:05

clj --help
Version: 1.10.1.754

seancorfield02:12:25

@runjorel What exact command are you running and how are any aliases you're using defined?

runjorel02:12:12

in my ~/.clojure/deps.edn is this (and only this)

{
    :aliases
     {:new {:extra-deps {seancorfield/clj-new
                         {:mvn/version "1.1.228"}}
            :ns-default clj-new
            :exec-args {:template "app"}}}
    
}

runjorel02:12:49

This is what I am running: clojure -X:new create :name sandbox/oscad-sandbox

runjorel02:12:14

I also tried this:

clojure -X:new clj-new/create :name sandbox/oscad_sandbox
Execution error (FileNotFoundException) at clojure.run.exec/requiring-resolve' (exec.clj:31).
Could not locate clj_new__init.class, clj_new.clj or clj_new.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.

runjorel02:12:28

just to see if qualifying the call would do anything

seancorfield02:12:38

Is there a deps.edn file in directory where you are running this command?

runjorel02:12:56

I am also running this in Java 11

java --version
openjdk 11.0.7 2020-04-14 LTS
OpenJDK Runtime Environment Zulu11.39+15-CA (build 11.0.7+10-LTS)
OpenJDK 64-Bit Server VM Zulu11.39+15-CA (build 11.0.7+10-LTS, mixed mode)
Dont know if that makes a difference

seancorfield02:12:36

I just copied your ~/.clojure/deps.edn file over mine, and ran that command in an empty folder and it worked fine.

seancorfield02:12:52

seanc@DESKTOP-30ICA76:~/clojure$ cat > ~/.clojure/deps.edn
{
    :aliases
     {:new {:extra-deps {seancorfield/clj-new
                         {:mvn/version "1.1.228"}}
            :ns-default clj-new
            :exec-args {:template "app"}}}
}
seanc@DESKTOP-30ICA76:~/clojure$ clojure -X:new create :name sandbox/oscad-sandbox
Generating a project called oscad-sandbox based on the 'app' template.
seanc@DESKTOP-30ICA76:~/clojure$ rm -rf oscad-sandbox/
seanc@DESKTOP-30ICA76:~/clojure$ clojure -X:new clj-new/create :name sandbox/oscad-sandbox
Generating a project called oscad-sandbox based on the 'app' template.
seanc@DESKTOP-30ICA76:~/clojure$

seancorfield02:12:33

@runjorel I can't reproduce your problem.

runjorel02:12:52

lol, yea 😄

seancorfield02:12:53

(I'm running CLI 1.10.1.763 but there's almost no differences -- and nothing that would affect that)

runjorel02:12:25

Alright, i'll keep tracking down what I am doing wrong.

runjorel02:12:40

And given the day/hour thank you so much for your help!

seancorfield02:12:24

Oh, it's early here... I'm going to be online for hours 🙂

seancorfield02:12:55

Out of curiosity, what does clojure -Sdescribe show (in full)?

runjorel02:12:34

clojure -Sdescribe
{:version "1.10.1.763"
 :config-files ["/usr/local/lib/clojure/deps.edn" "/home/thefluxlife/.config/clojure/deps.edn" ]
 :config-user "/home/thefluxlife/.config/clojure/deps.edn"
 :config-project "deps.edn"
 :install-dir "/usr/local/lib/clojure"
 :config-dir "/home/thefluxlife/.config/clojure"
 :cache-dir "/home/thefluxlife/.config/clojure/.cpcache"
 :force false
 :repro false
 :main-aliases ""
 :repl-aliases ""}

runjorel02:12:59

oooo wait a darn minute. I have not been editing .config/clojure/deps.edn. I created my own .clojure/deps.edn

seancorfield02:12:03

That says your "dot-clojure" file is /home/thefluxlife/.config/clojure/deps.edn

seancorfield02:12:38

Maybe you have the CLJ_CONFIG environment variable set?

runjorel02:12:31

I'd be surprised if I do as I am working on a fresh machine

runjorel02:12:00

regardless, I edited the deps.edn in the .config folder and now everything is working as expected

runjorel02:12:14

I didn't know about -Sdescribe!

runjorel02:12:28

This is also on a linux-enabled Chromebook. I thought it would just be stock-debian but maybe there are some other customizations I dont know about.

seancorfield02:12:51

Interesting. I suspect if you ask in #tools-deps someone will know why your user-level deps.edn file is in .config/clojure instead of .clojure

👍 3
seancorfield02:12:25

Ah, check XDG_CONFIG -- I think that's it.

runjorel02:12:32

Yes, that XDG_CONFIG_HOME is set to that location.

seancorfield02:12:37

In clojure it has this:

# Determine user config directory
if [[ -n "$CLJ_CONFIG" ]]; then
  config_dir="$CLJ_CONFIG"
elif [[ -n "$XDG_CONFIG_HOME" ]]; then
  config_dir="$XDG_CONFIG_HOME/clojure"
else
  config_dir="$HOME/.clojure"
fi

runjorel02:12:59

Ah! Nice! That's actually very thoughtful

runjorel03:12:29

Well not only have you helped with the task at hand but helped me learn a thing or 2 🙂. Thank you sir and I hope you have an awesome morning/day.

seancorfield03:12:56

I run Ubuntu and it has XDG_DATA_DIRS but not XDG_CONFIG but I'm not any sort of expert on Linux distros 🙂

seancorfield03:12:17

You're only two hours ahead of me 🙂

runjorel03:12:28

Oh my goodness, I thought you said something about the morning earlier in the backscroll. Clearly I am the one who needs rest facepalm

runjorel03:12:18

So on that note, good night 😄

3
seancorfield03:12:31

I've updated most of my repos to note that the user deps.edn can be in ~/.clojure/ or ~/.config/clojure/ -- hopefully that will help future users 🙂

👍 3
practicalli-johnny08:12:40

@seancorfield Debian Linux sets environment variable XDG_CONFIG_HOME to $HOME/.config and over-rides the default location of the user level config, e.g. $HOME/.config/.clojure

practicalli-johnny08:12:45

I added this to the Practicalli deps.edn config after a Debian user raised the same issue a few weeks ago. Sorry, I should have mentioned it to you at that time.

seancorfield17:12:41

@jr0cket I opened an issue on your repo because I didn't see that mentioned in the README. It is mentioned in the CLI/deps reference but it's very much "in passing" and not when ~/.clojure/deps.edn is first mentioned 😐

practicalli-johnny23:12:39

I'll remove the location in the first paragraph of the practicalli/clojure-deps-edn . Then the alternative location is mentioned clearly when the location is discussed https://github.com/practicalli/clojure-deps-edn#install-practicalli-clojure-deps-edn