Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 2.0.461 of Calva breaks deps.edn jack-in on some Windows machines #2592

Closed
PEZ opened this issue Jul 3, 2024 · 3 comments
Closed

Comments

@PEZ
Copy link
Collaborator

PEZ commented Jul 3, 2024

See also:

So when we fixed the jack-in issue for some Windows users, we broke it for others. It seems the quoting works differently between different versions of Windows (in cmd.exe) and different versions of Powershell too.

Powershell versions

On the Windows machine I have for testing things, Calva 2.0.461 works. Also, the command line fails when run in Powershell and succeeds when run in cmd.exe:

image

That looks like Powershell has problem with the & separating the steps in the command line. Apparently because I am using an old version of Powershell, 5.1:

image

However, it is also a problem with the quoting:

image

cmd.exe

The problem goes beyond Powershell versions. A Calva user using the exact same version of Windows as I do reports the quoting not working in cmd.exe:

pushd d:\D\autoapi\autoapi_v1 & java -jar c:\Users\xingquan\.vscode\extensions\betterthantomorrow.calva-2.0.461\deps.clj.jar -Sdeps "{:deps {nrepl/nrepl {:mvn/version,""1.1s {nrepl/nrepl {:mvn/version,""1.1.1""},cider/cider-nrepl {:mvn/version,""0.47.1""}}}" -M:dev:scratch -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]" & popd
Error while parsing option "--config-data {:deps {nrepl/nrepl {:mvn/version,\"1.1s {nrepl/nrepl {:mvn/version,\"1.1.1\"},cider/cider-nrepl {:mvn/version,\"0.47.1\"}}}": java.lang.NumberFormatException: Invalid number: 1.1.1
@PEZ
Copy link
Collaborator Author

PEZ commented Jul 3, 2024

Here’s a build of Calva with a tiny change that probably won’t fix the issue, but it doesn’t break things on my Windows machine either. https://output.circle-artifacts.com/output/job/267f9241-e643-4beb-a526-9c660eff5d8c/artifacts/0/tmp/artifacts/calva-2.0.462-2592-win-jack-in-take-one-trillion-e284cf25.vsix I’m curious if it may fix things on your machines, dear Calva Windows users. To install this package:

  1. Download from the link and rename the .zip files to .vsix (if it’s not already named correctly)
  2. From the VS Code Extensions pane, use the meatballs menu at the top to Install from VSIX…
  3. Reload the VS Code window for good measure

Does jack-in still fail? In the same way as before?

@PEZ
Copy link
Collaborator Author

PEZ commented Jul 3, 2024

Here’s another VSIX that actually potentially fixes the problem (but let me admit that I have hoped that many times before with this issue).

This one skips even trying to quote for Powershell, and explicitly uses deps.clj instead of the “official” clojure in order to safely run shell-less (which I suspect somehow means it is executed by something akin to cmd.exe). Copying the command line will produce a command line that only works in cmd.exe.

@PEZ
Copy link
Collaborator Author

PEZ commented Jul 3, 2024

That build was tested by another user and didn't work:

pushd c:\Users\###\AppData\Local\Temp\betterthantomorrow.calva\ge1k1p & java -jar c:\Users\###\.vscode\extensions\betterthantomorrow.calva-2.0.462-2592-win-jack-in-take-one-trillion-90e84580\deps.clj.jar -Sdeps "{:deps {nrepl/nrepl {:mvn/version,\"1.1.1\"},cider/cider-nrepl {:mvn/version,\"0.47.1\"}}}" -M:test -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]" & popd
Error while parsing option "--config-data \"{:deps {nrepl/nrepl {:mvn/version,\\1.1.1\\},cider/cider-nrepl {:mvn/version,\\0.47.1\\}}}\"": java.lang.IllegalArgumentException: Invalid digit: .
Jack-in process exited. Status: 1

Here's yet another VSIX, where I try to run the jack-in command in a cmd.exe shell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant