Fork me on GitHub
#cursive
<
2019-10-21
>
vikeri12:10:49

I have a problem with (System/getenv) only returning like 9 env vars in the REPL. As opposed to the 30 or something I have set. I have the following setup: Local nREPL Run with Leiningen OSX Catalina fish shell Intellij Community 2019.2 Cursive 1.8.2 - 2019.2

Alex Miller (Clojure team)13:10:36

on mac, I think apps are run without hitting your .bashrc and all that stuff

sooheon14:10:57

I went into a bottomless rabbit hole because of this, when AWS credentials weren’t being picked up. Wonder what the fix is…

tony.kay18:10:51

So, I use .profile (and bash) as my shell. When I set up a run config I use the “Include system env vars” and it picks them up fine. NOTE: .bashrc is NOT where you should put env vars (ever). I’m not sure how IntelliJ picks up the vars, which is why I mention that I have mine in .profile and use bash.

tony.kay18:10:25

These are definitely from my .profile…

tony.kay18:10:44

NOTE: I have to restart IntelliJ for it to pick up new changes, but it does pick them up from .profile when I do.

Alex Miller (Clojure team)18:10:18

(sorry, I didn't actually mean literally bashrc earlier :)

vikeri18:10:28

I tried adding vars to .profile too with no avail…

tony.kay18:10:30

@vikeri Here are some things to consider: IntelliJ is going to have to run a shell in order to get the env vars. Not sure at what layer. Might require the terminal plugin to work, and it might also require that you’re using bash. Additionally, bash can look at .bash_profile and .profile…but not both…I think it prefers the former

jumar20:10:49

I was talking about GUI apps in general. Perhaps it's a bit different in this case. Sorry if that was confusing

vikeri06:10:41

@U0CKQ19AQ The terminal plugin works fine and reads the env vars correctly. And it has worked previously when I used fish shell. Strangely enough if I open the app from the terminal in the directory: /Applications/IntelliJ IDEA http://CE.app/Contents/MacOS then it works…

tony.kay15:10:30

@vikeri That’s how UNIX processes and env work: the shell passes env vars to the next process. In OSX when you start an app normally, IT is the process that has to pass along the vars…which is why it is an OS-level tweak in general to get the env to change that way….However, IntelliJ must be doing some extra work (forking an addl process so it can add to env vars) because I see my .profile updates when I restart IntelliJ. The actual mechanism is trivial: parent process passes env vars to child process…that’s really all there is to it. So, when you start an app from terminal, the terminal is the parent process and of course it works. When the OS starts it…well, then it is a bit opaque. You have to either find in docs how they’re doing it (unlikely) or derive it by watching what happens…You can use terminal ps to trace through parent processes, look at man pages for those things, etc etc. It isn’t technically challenging to figure out…it’s just opaque as hell once you have GUIs starting GUIs starting processes.

tony.kay15:10:32

Which is why I have no idea of how IntelliJ is finding my .profile changes….I know how it has to pass them to the child process, but I can find no docs on how it derives them…but since changes to env that OSX recognizes (i.e. it has to put env vars into the GUI parent process…what do they call it? Aqua?) typically require a reboot I do not suspect it is OS level…could be wrong

vikeri15:10:14

Yeah it’s opaque for sure… Thanks for the help though!

Alex Miller (Clojure team)13:10:05

there is a way to make that happen, but I do not remember the details

vikeri13:10:09

Must have been a Catalina change then, things that previously worked are not working anymore.

Alex Miller (Clojure team)13:10:01

certainly not the first time that's happened :)

gibb13:10:34

Can I set up a REPL to shadow-cljs and evaluate expressions from a cljs file from Cursive? I get the following error when I tried:

gibb13:10:25

I’m pretty new with how the REPL works and with clj / cljs and the tooling. The way I would like it to work is the way the REPL works when I use it in a lein new project that only uses Java: i.e I can evaluate expressions and load files via the REPL.

gibb13:10:38

Ah I was supposed to switch it to cljs mode (shadow.cljs.devtools.api/repl :app)

dazld18:10:13

I’m still having trouble getting autocomplete to work with deps.edn - is this a known issue..?

kwladyka18:10:05

deps.edn works fine for me

dazld18:10:09

must be something in my local setup.

dazld18:10:18

maven, or … :mystery:

dazld18:10:02

loving the label telling you which ns you are in bottom right of the repl ❤️

cfleming22:10:02

@dazld Yes, this is still happening to some people, unfortunately I can’t reproduce it to debug it.

cfleming22:10:32

Can you check which repositories you have under Preferences | Build, Execution, Deployment | Build Tools | Maven | Repositories?

tap02:10:38

It's been happening for me for many months now. This is a leiningen project. I kind of already give up deps autocomplete at this point.

cfleming02:10:33

@U05111TCS Do you get completion for artifacts from Clojars?

cfleming02:10:57

Ok, thanks. I’m going to put some debug logging in the next EAP to see if we can figure this out.

👍 4
tap02:10:18

Ok. Thanks.

dazld05:10:49

My repo list is almost the same, just clojars and datomic.

sogaiu22:10:52

@vikeri not related to zsh being default in catalina by any chance?