leiningen

2022-07-13T03:17:38.211259Z

@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*) ?

2022-07-13T03:18:22.963419Z

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]))

2022-07-13T03:18:49.243179Z

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.

2022-07-14T14:07:36.537549Z

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

2022-07-14T14:08:00.043819Z

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

2022-07-18T16:10:41.849159Z

@mikerod 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.

2022-07-18T16:39:28.327989Z

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

2022-07-13T19:22:04.062839Z

@mikerod 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?

2022-07-13T19:24:41.539759Z

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

2022-07-13T19:25:09.776929Z

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

2022-07-13T19:27:02.759379Z

I'm doing lein run