deps-new

practicalli-johnny 2020-12-19T08:09:40.037500Z

@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-johnny 2020-12-19T08:10:45.039200Z

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.

seancorfield 2020-12-19T17:24:41.040900Z

@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-johnny 2020-12-19T23:04:39.044200Z

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

2020-12-19T01:53:19.012400Z

@runjorel has joined the channel

2020-12-19T01:54:18.013Z

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

2020-12-19T01:54:31.013400Z

I've followed the instructions on the github readme

2020-12-19T01:55:05.013700Z

clj --help
Version: 1.10.1.754

seancorfield 2020-12-19T02:24:25.014500Z

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

2020-12-19T02:25:12.015100Z

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"}}}
    
}

2020-12-19T02:25:49.015400Z

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

2020-12-19T02:26:14.016Z

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.

2020-12-19T02:26:28.016400Z

just to see if qualifying the call would do anything

seancorfield 2020-12-19T02:26:38.016700Z

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

2020-12-19T02:26:42.016900Z

no

2020-12-19T02:28:56.017400Z

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

seancorfield 2020-12-19T02:30:36.018100Z

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

seancorfield 2020-12-19T02:31:52.018400Z

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$

seancorfield 2020-12-19T02:34:33.018800Z

@runjorel I can't reproduce your problem.

2020-12-19T02:35:52.019700Z

lol, yea 😄

seancorfield 2020-12-19T02:35:53.019900Z

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

2020-12-19T02:36:25.020600Z

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

2020-12-19T02:36:40.021200Z

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

seancorfield 2020-12-19T02:42:24.021600Z

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

seancorfield 2020-12-19T02:42:55.022100Z

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

2020-12-19T02:50:34.022400Z

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 ""}

2020-12-19T02:51:59.023700Z

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

seancorfield 2020-12-19T02:52:03.023900Z

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

seancorfield 2020-12-19T02:52:38.024200Z

Maybe you have the CLJ_CONFIG environment variable set?

2020-12-19T02:54:31.024500Z

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

2020-12-19T02:55:00.025Z

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

2020-12-19T02:55:14.025300Z

I didn't know about -Sdescribe!

2020-12-19T02:56:28.026400Z

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.

seancorfield 2020-12-19T02:57:51.027700Z

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

👍 1
seancorfield 2020-12-19T02:58:25.028200Z

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

2020-12-19T02:59:32.028900Z

Yes, that XDG_CONFIG_HOME is set to that location.

seancorfield 2020-12-19T02:59:37.029100Z

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

2020-12-19T02:59:59.029600Z

Ah! Nice! That's actually very thoughtful

2020-12-19T03:02:29.031300Z

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.

seancorfield 2020-12-19T03:02:56.031700Z

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

seancorfield 2020-12-19T03:03:17.032100Z

You're only two hours ahead of me 🙂

2020-12-19T03:04:28.032700Z

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

2020-12-19T03:05:18.032900Z

So on that note, good night 😄

👋🏻 1
seancorfield 2020-12-19T03:28:31.034100Z

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 🙂

👍 1