Fork me on GitHub
#calva
<
2022-01-03
>
Leif11:01:04

Hello, friends! I’m cross-posting https://clojurians.slack.com/archives/C0FM7N1SM/p1641201738016900, in hopes that someone here might now whether it’s possible to set up a smoother dynamic workflow for Quil via VS Code and Calva. It would be super awesome if it’s possible to render the output in a new tab within VS Code as well, but I’m not sure whether it’s possible to “embed” OpenGL in VS Code like that.

👀 1
punit-naik11:01:45

Hello all. Just wanted to notify that calva.jackInEnv setting is not working in the latest version 2.0.232. I just tested it by upgrading the extension. Had to downgrade to version 2.0.231 to get it to work. I don't know if it's just on my system though.

👀 1
pez12:01:04

Thanks for the heads-up! Can you file an issue about it? Preferrably from VS Code’s Help-menu, so that we get some system info from your machine with it.

👍 2
punit-naik13:01:29

@U0ETXRFEW I did some investigation and it turns out I was mistaken, the env vars do work. But the problem is with deps.edn projects. I have a main (mono) repo where all the deps and their versions are defined (in a particular profile called deps). I also add that profile as an alias in the calva.myCljAliases setting. Then I refer them in my sub-projects using :mvn/version "_" . But when I start my REPL by jacking in, that _ is not overridden to the version defined in the alias in the deps.edn file of the project path specified by the CLJ_CONFIG env var. Now I don't know where the problem is; in the alias setting or with calva+deps.edn project. Could you help me a little investigating this further?

pez14:01:40

I have not seen :mvn/version "_" before. What is it supposed to do?

pez14:01:05

Also, what is a “profile” in this context?

punit-naik16:01:18

Profile is an alias and the "_" for versions are resolved based on deps defined in the alias . More info here https://clojure.org/reference/deps_and_cli#_deps_edn_sources

pez16:01:43

I don’t see "_" mentioned there.

punit-naik16:01:19

Sorry, _ is just like a placeholder, which will be overridden with version defined inside the deps.edn (which will be contained in the project path specified by CLJ_CONFIG env var), in it's alias (which we are using to start the repl, while jacking in). So you could have anything in there as it'll be overridden.

seancorfield18:01:08

@U5BRU7X8Q FYI: You probably want to avoid an alias called :deps since that's a standard alias defined in the root deps.edn file (to bring in tools.deps.alpha).

👍 1
seancorfield18:01:03

Are you use :override-deps here? When we used to do that, we typically had {} for the coordinate -- we didn't even specify :mvn/version at all (since the overriding deps could be local or git deps). We gave up on that approach tho' and we stopped using CLJ_CONFIG too (because it prevents developers having their own additional dev-only aliases).

👍 1
seancorfield18:01:48

I don't know if you've seen my series of blog posts about our monorepo at World Singles Networks but I talk a lot in the early posts in that series about the various setups we tried and abandoned (and why).

seancorfield18:01:01

https://corfield.org if you're interested.

👍 1
punit-naik09:01:33

@U04V70XH6 Thanks a lot for the pointers! I'll read your blogs :thumbsup:

punit-naik07:01:42

@U0ETXRFEW Same issue with v2.0.233 as well.

pez08:01:29

@U5BRU7X8Q can you make a small repro project exposing this?

punit-naik08:01:30

@U0ETXRFEW Sure I can, please see the attached zip file. It contains a deps.edn file in the root-project folder, where all my deps are defined under the alias deps-override. Inside the folder there is a small project under sub-projects/hello-world which has it's own deps.edn file but I am using an underscore (`_`) as a placeholder to be replaced by the one defined in the root project folder. Now if you try to spin up a REPL using jack-in and select the deps-override profile (as it's defined in root-project/.vscode/settings.json), you'll be able to start it if you are on the version 2.0.231 of calva. But if you try to start it with 2.0.232 or 2.0.233, you'll see the error:

clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"0.9.0"},cider/cider-nrepl {:mvn/version,"0.27.4"}}}' -M:deps-override -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
Error building classpath. Could not find artifact org.clojure:clojure:jar:_ in central ()
Jack-in process exited. Status: 1
NOTE: I have added .vscode/settings.json file in multiple places (one in root and another in one of the sub projects) for your convenience. But please make sure you change the path value for CLJ_CONFIG env var in those files according to you. It should be equal to where you extract the project folder, like, <extracted-path>/root-project.

pez08:01:50

I’ll don’t have time to test this until tonight. But looking at the changelog for 232, I am suspecting this change: https://github.com/BetterThanTomorrow/calva/pull/1417

pez08:01:29

So if you use the Copy Jack-in command line (or something, I don’t recall the exact command name) to copy the command line and change -M to -A, does the command then work? (If so you can then use the Connect command to connect the REPL, until we have figured out what the fix for the issue is.)

punit-naik09:01:54

@U0ETXRFEW Yes, you are right. If I change the command from -M to -A, it works.

seancorfield17:01:35

If -A works and -M does not, I think you are running an old Clojure CLI and need to upgrade @U5BRU7X8Q -- run clojure -version and check that against https://clojure.org/releases/tools (if clojure -version doesn't work you have a very old version)

punit-naik17:01:03

@U0ETXRFEW @U04V70XH6 clojure -version didn't work as I had 1.10.1 version. I upgraded it and now my deps.edn project works with the latest calva. Thanks for all the help guys! 🙏

seancorfield17:01:01

I like to use brew (even on Linux) to help keep my clojure/tools/clojure CLI up-to-date. Something to consider.

👍 1
pez14:01:04

We haven’t added support for that yet. Please file an issue about it.

👍 1
ericdallo17:01:03

Important fix regarding some outdated analysis (including semantic-tokens) and some deadlocks

🙏 1
clojure-lsp 1