This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-01
Channels
- # announcements (1)
- # babashka (73)
- # bangalore-clj (7)
- # beginners (295)
- # calva (128)
- # chlorine-clover (3)
- # cider (9)
- # cljsrn (10)
- # clojure (63)
- # clojure-europe (11)
- # clojurescript (1)
- # clojureverse-ops (3)
- # conjure (3)
- # emacs (7)
- # fulcro (13)
- # graalvm (8)
- # honeysql (16)
- # jobs-discuss (14)
- # malli (21)
- # meander (8)
- # onyx (1)
- # pathom (7)
- # portkey (2)
- # quil (3)
- # re-frame (4)
- # reagent (31)
- # reitit (2)
- # rewrite-clj (40)
- # shadow-cljs (29)
- # sql (20)
- # xtdb (13)
I tried to summarize some of what I know so far here https://github.com/BetterThanTomorrow/calva/issues/1162#issuecomment-830609242 Pasted it in this post too for easy access. @flowthing: Can you add the workaround that worked on your colleague’s machine to the issue?
I left a couple of hints here: https://github.com/BetterThanTomorrow/calva/issues/1162#issuecomment-830616904 Don't give up @pez, we will win the war on quoting.
@pez Could you explain what cmd.exe and Powershell have to do with this? Are users launching this getting started REPL manually from their shells?
I commented on that thing on the issue. Not sure it answers your question. Getting Started REPL is using Jack-in under the hood though. And almost the same thing happens when jacking in to a deps.edn
project. For the latter we quite often advice people who wan to start the REPL themselves and connect instead to copy the command line echoed. Calva even has a command for copying out the jack-in command line.
It is currently the only option where it works on my machines right now, so it will stay used until we have figured out the non-shell way of doing it.
It is currentl the only option where "the shell option" works on my machines right now?
Ah, so there are more its… Hmm. 1. The shell option 2. Getting Started REPL 3. The shell option 4. Getting Started REPL
The shell option launches the default system shell to run your command. This is not necessary when you launch an executable like java
. Moreover it will introduce these shell and platform-specific quoting issues, rather than solving them. But whatever you want :)
It is not a matter of what I want. Don’t you agree that I should keep doing something that works for 90% of the cases over something that works for 0%?
You want to launch a java subprocess. Not a shell subprocess which launches a java subprocess (with quoting issues).
Note that when you want to launch the official clojure CLI, then you do need the shell option, because powershell....
Here is an example of how to launch a binary: https://github.com/marcomorain/clojure-lint/blob/86f699258d7478d44237241ecf1f0be914170887/src/extension.ts#L55 and how to find it, in a cross platform way.
So, been at this a bit more now. I might have tried more quoting variants than any other coder ever existing. None of those worked. But all is not lost. I think I have found another solution. If I use CMD-style quoting and write the command line to a .cmd
file, then execute that file, the jack-in succeeds. OnMyMachine, yes, but I don’t see why that shouldn’t work on any machine, even in a world as crazy as Windows.
Here is VSIX using that ^ strategy: https://13275-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.195-1162-getting-started-repl-win-514800ae.vsix Can you test it @qmstuart and @stianalmaas?
> 01/05/2021 17:19:19 - Microsoft VSIX Installer > 01/05/2021 17:19:19 - ------------------------------------------- > 01/05/2021 17:19:19 - vsixinstaller.exe version: > 01/05/2021 17:19:19 - 16.9.1028 > 01/05/2021 17:19:19 - ------------------------------------------- > 01/05/2021 17:19:19 - Command line parameters: > 01/05/2021 17:19:19 - C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe,C:\Users\stuarts\Downloads\calva-2.0.195-1162-getting-started-repl-win-514800ae.vsix > 01/05/2021 17:19:19 - ------------------------------------------- > 01/05/2021 17:19:19 - Microsoft VSIX Installer > 01/05/2021 17:19:19 - ------------------------------------------- > 01/05/2021 17:19:25 - Initializing Install... > 01/05/2021 17:19:25 - Microsoft.VisualStudio.ExtensionManager.InvalidExtensionManifestException: Element 'Identity' has invalid value for attribute 'Version' ---> System.FormatException: Input string was not in a correct format. > at System.Version.VersionResult.SetFailure(ParseFailureKind failure, String argument) > at System.Version.TryParseComponent(String component, String componentName, VersionResult& result, Int32& parsedComponent) > at System.Version.TryParseVersion(String version, VersionResult& result) > at System.Version.Parse(String input) > at System.Version..ctor(String version) > at Microsoft.VisualStudio.ExtensionManager.ExtensionImpl.<>c.<ExtractManifestData>b__67_1(String s) > at Microsoft.VisualStudio.ExtensionManager.ExtensionImpl.VerifyStringValue[T](String value, ErrorInfo info, Func`2 selector, Boolean isRequired, Int32 maxLength, T defaultValue) > --- End of inner exception stack trace --- > at Microsoft.VisualStudio.ExtensionManager.ExtensionImpl.VerifyStringValue[T](String value, ErrorInfo info, Func`2 selector, Boolean isRequired, Int32 maxLength, T defaultValue) > at Microsoft.VisualStudio.ExtensionManager.ExtensionImpl.ExtractManifestData(PackageManifest manifest) > at Microsoft.VisualStudio.ExtensionManager.ExtensionImpl.ReadPackageManifest(XmlReader reader) > at Microsoft.VisualStudio.ExtensionManager.ExtensionImpl.ReadManifest(Stream manifestStream) > at Microsoft.VisualStudio.ExtensionManager.InstallableExtensionImpl.ReadVSIXManifestFromPackage(Stream stream, CultureInfo preferredCulture) > at Microsoft.VisualStudio.ExtensionManager.InstallableExtensionImpl..ctor(String path, CultureInfo preferredCulture) > at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.CreateInstallableExtension(String extensionPath, CultureInfo preferredCulture) > at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.CreateInstallableExtension(String extensionPath) > at VSIXInstaller.ExtensionService.GetInstallableData(String vsixPath, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData) > at VSIXInstaller.ExtensionPackService.IsExtensionPack(IStateData stateData, Boolean isRepairSupported) > at VSIXInstaller.ExtensionPackService.ExpandExtensionPackToInstall(IStateData stateData, Boolean isRepairSupported) > at VSIXInstaller.App.Initialize(Boolean isRepairSupported) > at VSIXInstaller.App.Initialize() > at System.Threading.Tasks.Task`1.InnerInvoke() > at System.Threading.Tasks.Task.Execute()
I don’t think so. Seen it before though. Let me see if it installs cleanly on my machine….
Hmmm, no problem here. As I said, I think I have seen similar before. Don’t remember who it was… Maybe try downloading it again?
ok, i think i did do somethign stupid. I think I have .vsix associated with visual studio
c:\Users\stuarts\AppData\Local\Temp\betterthantomorrow.calva\8mdqdl>java -jar .calva\deps.clj.jar -Sdeps "{:deps {nrepl/nrepl {:mvn/version,""0.8.3""},cider/cider-nrepl {:mvn/version,""0.25.11""}}}" -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
Error while parsing option "--config-data {:deps {nrepl/nrepl {:mvn/version,0.8.3},cider/cider-nrepl {:mvn/version,0.25.11}}}": java.lang.NumberFormatException: Invalid number: 0.8.3
Jack-in process exited. Status: 1
That doesn’t look like the new version. Which version does the Extension pane say you are using?
I believe you have to use triple double quotes in cmd.exe: https://github.com/BetterThanTomorrow/calva/issues/1162#issuecomment-830616904
if that doesn't work, can you also try execFile
like here?
https://github.com/marcomorain/clojure-lint/blob/86f699258d7478d44237241ecf1f0be914170887/src/extension.ts#L55
No processing of the args, just pass them raw
(off topic: Now that rewrite-clj also supports CLJS I guess we could also have a cljstyle that works in the browser and nodeJS)
@pez :) Then why does @qmstuart print output like 'c:\Users\stuarts\AppData\Local\Temp\betterthantomorrow.calva\8mdqdl>'. That looks like a shell to me
Ah, but now it is the right version at least. Just that it still doesn’t work even with this strategy. Very disappointing!
Hello guys. I have also tested the new version and I have exactly the same behaviour as Stuart. Which is good, I think. Our machines behave the same way.
.calva\jack-in.cmd
c:\Users\stian\AppData\Local\Temp\betterthantomorrow.calva\sqv3zo>java
-jar .calva\deps.clj.jar -Sdeps "{:deps {nrepl/nrepl {:mvn/version,""0.8.3""},cider/cider-nrepl {:mvn/version,""0.26.0""}}}" -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
Error while parsing option "--config-data {:deps {nrepl/nrepl {:mvn/version,0.8.3},cider/cider-nrepl {:mvn/version,0.26.0}}}": java.lang.NumberFormatException: Invalid number: 0.8.3
Jack-in process exited. Status: 1
The version numbers now have two double-quotes. As far as I can see everything is the same as for Stuart.
Thanks, @stianalmaas ! Yes, I find some comfort in that you two have the same resukt. 😀
New VSIX cookin’. Are you still awake, @qmstuart and @stianalmaas? 😃
Here it is, I give it a 100% success prediction: (Yeah, like with the last try, but anyway). https://13280-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.195-1162-getting-started-repl-win-076d5d2f.vsix
Going for it as well
Hmm, I'm afraid I'm getting the same result:
java -jar .calva\deps.clj.jar -Sdeps {:deps {nrepl/nrepl {:mvn/version,"0.8.3"},cider/cider-nrepl {:mvn/version,"0.26.0"}}} -m nrepl.cmdline --middleware [cider.nrepl/cider-middleware]
Error while parsing option "--config-data {:deps {nrepl/nrepl {:mvn/version,0.8.3},cider/cider-nrepl {:mvn/version,0.26.0}}}": java.lang.NumberFormatException: Invalid number: 0.8.3
Jack-in process exited. Status: 1
The version is v2.0.195-1162-getting-started-repl-win-076d5d2f
me too
java -jar .calva\deps.clj.jar -Sdeps {:deps {nrepl/nrepl {:mvn/version,"0.8.3"},cider/cider-nrepl {:mvn/version,"0.26.0"}}} -m nrepl.cmdline --middleware [cider.nrepl/cider-middleware]
Error while parsing option "--config-data {:deps {nrepl/nrepl {:mvn/version,0.8.3},cider/cider-nrepl {:mvn/version,0.26.0}}}": java.lang.NumberFormatException: Invalid number: 0.8.3
Jack-in process exited. Status: 1
Version: v2.0.195-1162-getting-started-repl-win-076d5d2f
I can see that you've commented on this already @pez, but it seems the same problem is there for cider as well: https://github.com/clojure-emacs/cider/issues/2963
But it may be a totally different use case since it uses leiningen...
I can see that you have been fighting this this for a long time @pez. Must be frustrating.
@stianalmaas Yeah, and I keep thinking I can win, and even that I have won, which of course helps adding frustration.
Welcome, @alexandergunnarson!
Thanks! 🙂
Haha yes 😂
I’m hoping so — it’s really quite a strange heisenbug
I’ve done literally the same steps 5 times in the past few minutes and have gotten different results each time. One time Calva spontaneously seemed to be doing just fine. The other times Calva broke in the places it has usually broken for me, but at different points
Trying to see if there’s some really subtle inconsistency on my end, like a timing issue or like having a file open in two places in VSCode or whatever
About 3-4x in CIDER, all consistently fine
About 15+ in VSCode integrated terminal with nREPL, also consistently fine
I’ll keep doing tests
Quite possible. Right now I’m thinking it’s a timing issue but I’ll keep you posted.
Better than doing all those tests would be if you added a missing feature to Calva, that CIDER has.
Which missing feature?
Ahh nice
How easy to add? I don’t have much time left today to spend on editor debugging issues unfortunately
Will be more free tomorrow
I think it should be reasonably easy. There is oen place where messages are sent, and one where they are received. CIDER prints it nicely with ->
and <-
markers.
Every time I’ve needed it I have debugged printed instead. But it would be so much better to be able to ask the users for a log like that instead.
Ah man, this really is a true heisenbug — this time I made sure to connect Calva only after the server-REPL finished evaluating and loading some stuff. Then I evaluated, using Calva commands, the same files as before (which are in the same position in the same VSCode windows), in the same order
I can’t imagine what’s going wrong or why it spontaneously is fine sometimes
Yeah probably time to debug this stuff using what you’re describing. I’m not sure how to hack on Calva or what’s involved. I’ll have to do some reading
See the wiki for “How to Hack on Calva”. It is quite easy, I think. (But I do it all the time, so maybe not the best judge)
I figured there’d be a wiki — thanks for putting it together 🙂
I’ll dive into it tomorrow, but for this REPL session the heisenbug has not surfaced and I’m just going to run with that for now 🤞
Ah dang it. Resurfaced. Back to VSCode integrated terminal till tomorrow 😞
I’ve just assumed from your name that you live in Sweden, but now checking, Slack tells me you are in the US?
(Checked because it seemed you were planning to work for a while longer even though it is late here. 😃 )
Oh haha yes, in the US 😄
My great-grandparents dropped the additional “s” from the name (Gunnarsson) when they immigrated :flag-se: → 🇺🇸
I’m sure Swedes everywhere are shocked at the name butchery 😂
Which java versions are you using, @qmstuart and @stianalmaas?
java version "16" 2021-03-16 Java(TM) SE Runtime Environment (build 16+36-2231) Java HotSpot(TM) 64-Bit Server VM (build 16+36-2231, mixed mode, sharing)
❯ java --version
java 15.0.2 2021-01-19
Java(TM) SE Runtime Environment (build 15.0.2+7-27)
Java HotSpot(TM) 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)
Success. (For some definition of success). With Java 16 I get the same error as @stianalmaas and @qmstuart get.