Fork me on GitHub
#calva
<
2022-04-14
>
manas_marthi04:04:37

$ npm run release

...
> npx shadow-cljs release :calva-lib :test

shadow-cljs - config: /home/manas/calva/shadow-cljs.edn
[:calva-lib] Compiling ...
------ WARNING #1 -  -----------------------------------------------------------
 File: ~/.m2/repository/org/babashka/sci/0.2.8/sci-0.2.8.jar!/sci/impl/analyzer.cljc:1129:40
--------------------------------------------------------------------------------
1126 |                         throw (analyze-throw ctx expr)
1127 |                         declare (expand-declare ctx expr)
1128 |                         expand-dot* (expand-dot* ctx expr)
1129 |                         . (expand-dot** ctx expr)
----------------------------------------------^---------------------------------
 variable $ctx is undeclared
--------------------------------------------------------------------------------
1130 |                         expand-constructor (expand-constructor ctx expr)
1131 |                         new (analyze-new ctx expr)
1132 |                         ns (analyze-ns-form ctx expr)
1133 |                         var (analyze-var ctx expr)
--------------------------------------------------------------------------------
nil
[:calva-lib] Build completed. (195 files, 153 compiled, 0 warnings, 345.28s)
[:test] Compiling ...
------ ERROR -------------------------------------------------------------------
 File: jar:file:/home/manas/.m2/repository/org/babashka/sci/0.2.8/sci-0.2.8.jar!/sci/impl/analyzer.cljc:179:1
--------------------------------------------------------------------------------
 176 |                ~'expr)])))))
 177 | 
 178 | (declare return-and) ;; for clj-kondo
 179 | (gen-return-and)
-------^------------------------------------------------------------------------
Syntax error macroexpanding cljs.core/and.

 

🧵 2
pez06:04:50

Please try to use thread to keep your questions together. I'm finding a bit of troubles knowing where I should answer this.

manas_marthi04:04:05

Ran into my first compilation problem 🙂 How to set up dev environment, locally test calva? I looked through the package.json. Do I set up a local VSCODE update site and point my VSCODE to download update snapshots from local server?

pez06:04:10

Have you found https://github.com/BetterThanTomorrow/calva/wiki/How-to-Hack-on-Calva ? The basic workflow is to run Calva in dev mode. There is a main build task that should start it all for you. cmd+shit+b on Mac.

manas_marthi09:04:17

Thank you. I will try

manas_marthi04:04:04

Am I missing setting up any environment variables ? Looks like I am having some setup issues

🧵 3
pez07:04:13

Dear Calva friends. Good news in #announcements!

💜 8
❤️ 4
💯 1
leifericf13:04:46

I’m following https://github.com/BetterThanTomorrow/calva/wiki/How-to-Hack-on-Calva. Step 3 says, “When all watchers are stable […]” Everything seems to be working well so far, but how can I tell that “all watchers are stable?” I don’t know where to look for that in the VS Code interface.

❤️ 1
leifericf13:04:16

Oh… Each of the terminal tabs represents one “watcher,” maybe? :thinking_face:

all-clear 1
pez13:04:43

Yeah, They sure look stable to me. 😃 Please update the wiki to be clearer about where to see the watchers.

👍 1
leifericf14:04:21

There is another thing I’m a bit confused about. I’m not sure if I’m able to explain it well, but I’ll try: I now have Calva running in debug mode, and I have used “Start or Connect to a Clojure REPL” from within the Calva project (root directory), which seems to be working. But how can I use the dev version of Calva I have running in debug mode from a different “window/instance” of VS Code? So that I can use Calva in debug mode when working on a different Clojure project, outside of the Calva project itself. I can’t tell whether my Clojure project (a different root folder, opened in a different VS Code “window/instance”) is using the production version of Calva (the one installed as an Extension) or the dev version of Calva I have running in debug mode in the other “window/instance” of VS Code. Does that make sense?

leifericf15:04:33

Also, when I ran the VS Code command “Developer: Restart Extension Host,” I got an error in the “Calva Watch CLJS” console. (No code changes.) See the detailed error message below. Perhaps I’ve done something wrong when I started/connected to the REPL; I’m not sure. :thinking_face:

ERROR: ERROR: Unhandled REPL handler exception processing messageUnhandled REPL handler exception processing message  {{:op:op  closeclose, , :session:session  752bc0a0-1fdc-413e-ba6e-620ef616d51d}
a9636dc5-52ed-4ab3-8452-9303a4395685}
java.net.SocketException: Socket closed
        at java.base/sun.nio.ch.NioSocketImpl.ensureOpenAndConnected(NioSocketImpl.java:165)
        at java.base/sun.nio.ch.NioSocketImpl.beginWrite(NioSocketImpl.java:366)
        at java.base/sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:411)
        at java.base/sun.nio.ch.NioSocketImpl.write(NioSocketImpl.java:440)
        at java.base/sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:826)
        at java.base/java.net.Socket$SocketOutputStream.write(Socket.java:1035)
        at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)
        at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142)
        at nrepl.transport$bencode$fn__5900.invoke(transport.clj:121)
        at nrepl.transport.FnTransport.send(transport.clj:28)
        at nrepl.middleware.print$send_nonstreamed.invokeStatic(print.clj:159)
        at nrepl.middleware.print$send_nonstreamed.invoke(print.clj:138)
        at nrepl.middleware.print$printing_transport$reify__6187.send(print.clj:174)
        at nrepl.middleware.session$close_session.invokeStatic(session.clj:269)
        at nrepl.middleware.session$close_session.invoke(session.clj:263)
        at nrepl.middleware.session$session$fn__6791.invoke(session.clj:306)
        at nrepl.middleware$wrap_conj_descriptor$fn__5986.invoke(middleware.clj:16)
        at nrepl.middleware.print$wrap_print$fn__6198.invoke(print.clj:234)
        at nrepl.middleware$wrap_conj_descriptor$fn__5986.invoke(middleware.clj:16)
        at shadow.cljs.devtools.server.nrepl$start$fn__7472.invoke(nrepl.clj:142)
        at nrepl.server$handle_STAR_.invokeStatic(server.clj:22)
        at nrepl.server$handle_STAR_.invoke(server.clj:19)
        at nrepl.server$handle$fn__7258.invoke(server.clj:39)
        at clojure.core$binding_conveyor_fn$fn__5772.invoke(core.clj:2034)
        at clojure.lang.AFn.call(AFn.java:18)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)
java.net.SocketException: Socket closed
        at java.base/sun.nio.ch.NioSocketImpl.ensureOpenAndConnected(NioSocketImpl.java:165)
        at java.base/sun.nio.ch.NioSocketImpl.beginWrite(NioSocketImpl.java:366)
        at java.base/sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:411)
        at java.base/sun.nio.ch.NioSocketImpl.write(NioSocketImpl.java:440)
        at java.base/sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:826)
        at java.base/java.net.Socket$SocketOutputStream.write(Socket.java:1035)
        at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)
        at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142)
        at nrepl.transport$bencode$fn__5900.invoke(transport.clj:121)
        at nrepl.transport.FnTransport.send(transport.clj:28)
        at nrepl.middleware.print$send_nonstreamed.invokeStatic(print.clj:159)
        at nrepl.middleware.print$send_nonstreamed.invoke(print.clj:138)
        at nrepl.middleware.print$printing_transport$reify__6187.send(print.clj:174)
        at nrepl.middleware.session$close_session.invokeStatic(session.clj:269)
        at nrepl.middleware.session$close_session.invoke(session.clj:263)
        at nrepl.middleware.session$session$fn__6791.invoke(session.clj:306)
        at nrepl.middleware$wrap_conj_descriptor$fn__5986.invoke(middleware.clj:16)
        at nrepl.middleware.print$wrap_print$fn__6198.invoke(print.clj:234)
        at nrepl.middleware$wrap_conj_descriptor$fn__5986.invoke(middleware.clj:16)
        at shadow.cljs.devtools.server.nrepl$start$fn__7472.invoke(nrepl.clj:142)
        at nrepl.server$handle_STAR_.invokeStatic(server.clj:22)
        at nrepl.server$handle_STAR_.invoke(server.clj:19)
        at nrepl.server$handle$fn__7258.invoke(server.clj:39)
        at clojure.core$binding_conveyor_fn$fn__5772.invoke(core.clj:2034)
        at clojure.lang.AFn.call(AFn.java:18)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)

pez15:04:06

Did you start the extension in debug mode as per step 3 (emphasis added)? It will open a new window where your development version of Calva is used. > 3. When all watchers are stable (look at the terminals) - Start the extension in debug mode (the Extension Host): F5. > I have used “Start or Connect to a Clojure REPL” Once the extension is running in that new window. You should go back to the Calva window and connect to (not start) the REPL. > 4. Back in the Calva window, connect the REPL, choosing the calva project root and then the Calva project type, accepting the host and port to connect to.

leifericf15:04:01

Ah! Yes, I did follow the guide. However, I thought the empty VS Code window was a window I had opened before, which I had forgotten to close, so I closed it by mistake. Notice that I also updated the Wiki page 🙂

leifericf15:04:27

I’m going to restart VS Code and do it again from scratch, to make sure I’m not messing anything up.

1
pez15:04:55

There are a few launch profiles defined so you can start the dev extension host in a few different scenarios. But once it's open you can just open any other non-opened folder from that window and it will still be using dev Calva.

👍 1
1
manas_marthi14:04:18

I am trying to build on windows WSL and code

manas_marthi14:04:19

While resolving: [email protected]
Found: [email protected]
node_modules/sass
  dev sass@"^1.18.0" from the root project

Could not resolve dependency:
peer sass@"1.0.0-beta.3" from [email protected]
node_modules/dart-sass-loader
  dev dart-sass-loader@"^1.0.0" from the root project

manas_marthi14:04:27

more errors 😞

manas_marthi14:04:03

I ran npm install --force this to get around the error. But I am not sure what it will lead to

manas_marthi14:04:43

There is no ':node-library' option shown when I press ctrl + shift + b

pez15:04:29

There's not supposed to be any such option. Run Build Task should just run the main build task, which when it is done should have build a dev Calva for you, which you can start using in a development extension host. Which you can launch via the launch tasks, the default of which can be started with F5.

pez15:04:28

If for some reason Run Build Task gives you that menu, then select the task Calva Watchers from it, and you should be good.

pez15:04:18

<!subteam^S03BGSAUPTQ|@calva-team>, I think the sass dependency here is a remnant from the old webview-based REPL/output window. At least I can't see another reason why we would need SASS for anything...

bringe15:04:22

Yeah, I don’t see any reason either.

Cora (she/her)15:04:22

let's remove it 🙂

manas_marthi16:04:48

I think I found the issue. My fork seems to be outdated. When I updated my fork. I updated master branch. Not dev branch. I just merged dev branch from main repo. I will do git pull and retry

👍 2
bringe16:04:58

Only the Calva Dev has isDefault set to true. You just need to run the build task from the command palette and the watchers will all be started.

manas_marthi16:04:26

It's running fine now after git pull. Thanks

manas_marthi16:04:02

1. "Back in the Calva window, connect the REPL, choosing the calva project root and then the Calva project type, accepting the host and port to connect to.

manas_marthi16:04:05

How to do this

manas_marthi16:04:19

I press ctrl+shit+p there is no option to connect

pez17:04:03

You do have a Calva installed, right? 😀

manas_marthi17:04:47

Ah. I uninstalled while struggling with this troubleshooting

😂 1
manas_marthi17:04:55

I will reinstall now

manas_marthi17:04:05

Launched the repl finally. I just gone through less than two hours of troubleshooting since yesterday. A lot better beginner experience than some of the other projects I tried to get working..

manas_marthi17:04:39

1)Generic repl looks for nrepl.port file. I was thinking it looks for .nrepl.port file. The reason I got the name wrong was that when I started nrepl programmatically from java, it was creating .nrepl.port file

pez20:04:41

Two hours is a lot. But you had some special circumstances there with the old fork and all, which is not typical for a first-time setup.

pez20:04:15

And the SASS-dependency-thing was because of that old (very old 😄) fork. I did find that one being extra peculiar.

leifericf06:04:56

I got my Calva dev environment set up from scratch in less than 15 minutes by carefully following the guide mentioned in my OP. It's relatively straightforward when starting with a clean slate.

3