Fork me on GitHub
#leiningen
<
2022-07-13
>
mikerod03:07:38

@colinkahn there can be subtle issues with this due to timing of compilation and when the global-vars are actually set. Where are you trying the (println "*assert* =" *assert*) ?

mikerod03:07:22

I’ve seen a problem come up frequently if you have a user.clj ns that does any sort of :require of your own ns’s, like:

(ns user (:require [one.of.your.nses]))

mikerod03:07:49

If you do something like that in the user ns, those require/loads will be done before lein has a chance to actually set hte :global-vars.

colinkahn19:07:04

@U0LK1552A yes, it's possible that is happening with. I had put the println in the top of a namespace that could have been loaded by user.clj. I tried putting it instead in a function that is called during an api call, but I still see *assert* having the value true. Just to clarify, I can put :global-vars at the top level or within a profile?

mikerod19:07:41

It can be top level or profile. Shouldn't matter assuming you are actually using the profile

mikerod19:07:09

What lein task are you running when you do not see the assert value you expect?

colinkahn19:07:02

I'm doing lein run

mikerod14:07:36

I don’t know of anything special for run. You could try another task to see if you see the same - like test

mikerod14:07:00

I think I’d need to see your project structure + code that you were trying to println with to have much more understanding of your situation

colinkahn16:07:41

@U0LK1552A sorry I haven't replied. I'll see if I can narrow down the issue this week. It could just be something about our setup, it's quite a complicated project.clj as is now.

mikerod16:07:28

Ok. Yeah, no problem. Just let me know if you end up having any details that are shareable.