Closed kjx closed 4 years ago
Yes, I am facing the same issue on VSCode 1.47.3 as well as 1.48.
In a class I'm teaching, we found that this was a problem for many students on Windows and macOS.
Our workaround on Windows was:
%HOMEPATH%\.vscode\extensions\correctnesslab.dafny-vscode-0.17.2\dafny
, if any.dafny
folder so that it becomes %HOMEPATH%\.vscode\extensions\correctnesslab.dafny-vscode-0.17.2\dafny\dafny
.%HOMEPATH%\.vscode\extensions\correctnesslab.dafny-vscode-0.17.2\dafny\dafny
(filling in %HOMEPATH%
with the actual absolute path to your home directory).Similarly, our workaround on macOS was:
~/.vscode/extensions/correctnesslab.dafny-vscode-0.17.2/dafny
, if any.dafny
folder so that it becomes ~/.vscode/extensions/correctnesslab.dafny-vscode-0.17.2/dafny/dafny
.~/.vscode/extensions/correctnesslab.dafny-vscode-0.17.2/dafny/dafny
(replacing ~
with the actual absolute path to your home directory).so I've tried that just now - I'm glad it works for you but it doesn't work for me.
I can unpack the dafny.zip myself alright, or copy from the main installation zip either way, when I restart VS Code, I get asked to install dafny again. If I say yes, we're back to where we started; if I say no, the highlighting works but not the actual checking. I'm on VScode 1.48 and macos 10.15.6 - J
Thanks for your reports!
I assume this is related to the release of the latest preview release of Dafny and the automatic downloader. We will look into pinning the version to the latest stable release for the time beeing...
Related Issue: #29
@fabianhauser - no problem, it's a great tool, and we have 90 students depending on it in our course in NZ. It's worked out really well so far!
I assume this is related to the release of the latest preview release of Dafny and the automatic downloader. > We will look into pinning the version to the latest stable release for the time beeing..
yes that seems to be it. ideally Rustan would have a "stable" release branch or whatever git does for that.
the right thing™ is probably to make ReleaseURL an extension setting like the existing Dafny path etc; that way people can point the plugin at whichever release they need...
@RustanLeino is it okay if I mark the 3.0.0 release on in the dafny-lang/dafny Repo as a "Preview Release"? We could filter out pre-releases on our part. (This is a checkbox on the Github Releases page).
the right thing™ is probably to make ReleaseURL an extension setting like the existing Dafny path etc; that way people can point the plugin at whichever release they need...
@kjx Absolutely, I agree. We are currently working on a major new release of the plugin, were this should be supported 🙂
@kjx I failed to mention that we were downloading version 2.3.0, not the prerelease. Sorry about that. Given the discussion above, perhaps my omission was why the workaround didn't work for you?
pretty sure I tried with both 2.3.0 & 3.0.0 pre. the problem seems to be that VS doesn't recognise that the installation is complete, even after I manually replace the subdirectory. So it just asks me to install Dafny again.
I can verify that the solution @brady-ds suggested does work on Ubuntu versions 16.04, 18.04, and 20.04! Thanks!
I bet it's Mac weirdness I don't have time to hunt down now.
there seems to be stuff in ~/Library/Application Support/Code/User/ too, but I don't know how that works, nor why that would let restoring a .vscode directory works but patching it doesn't.
I can restore from a time machine backup, or a cp -r of that backup of the whole vscode. I haven't managed to slice individual extensions.
I'm on VScode 1.48 and macos 10.15.6. I had a student say a version of that workaround did work OK, but he was on 10.12.something. Dunno if I'm just missing something, or what.
@kjx For one of my students on macOS just now we had to
$ cd ~/.vscode/extensions/correctnesslab.dafny-vscode-0.17.2/dafny/dafny
$ ./dafny /?
$ # Click "Cancel" on the popup and allow z3 to run in "System Preferences" → "Security and Privacy".
$ ./dafny /?
$ # Click "Open" on the popup.
and then restart VSCode. Maybe worth trying?
@brady-ds 's solution worked for me with Dafny 3.0.0 pre-release 0a on macOS 10.15.6.
Note that ./dafny /?
fails in macOS 10.15's zsh because it tries to parse the /?
as a wildcard. ./dafny
and ./dafny "/?"
worked for me.
For completeness, I also tried directing the Dafny Extension's path to a Dafny 2.3.0 installed by Homebrew. It didn't work, no idea why.
Correction: Dafny 3.0.0. pre-release seems to work, but looks like there is some weirdness going on - proofs that worked now fail. I'm too newbie to make sense of it.
Dafny 2.3.0 doesn't show that weirdness. VSCode will suggest updating on startup, but you can just answer "no".
So I tried again on a fresh account; same problem. I unpack dafny but the extension still doesn't recognise dafny is there. dunno why
@hmijail I also tried to point to other dafnys - also didn't work.
So: I'm back going again! Reinstalling VS Code or just the plugin doesn't seem to work on the Mac, but this worked repeatably for me, based on https://www.thetopsites.net/article/53839847.shtm, and having a working dafny installed somewhere else (2.3.0 from home-brew, or 3.0.0.20820 from GitHub zip)
I just released Dafny-VSCode v1.18.0 with a pinned Dafny Version 2.3.0 (and created an issue to remove the fix once 3.0.0 is stable: #67).
That should suffice to fix the error for the time being - when we release the new language server / vscode plugin, this will be solved differently either way.
@kjx @prashantbarca @hmijail @brady-ds could you try if that solved the error for you? It's possible you have to roll back some manual changes you did to the extension configuration (and/or reinstall the extension.)
@fabianhauser @RustanLeino I've tried this in several different ways across two mac accounts. seems to work every time - even managing to unwedge the schrödinger's installation (both installed and not installed...) although I had to muck around a bit first to get back to the wedged configuration...
trick for young players is that at least half the time it upgrades the VS extn without asking first which isn't great if things somehow end up wedged again, but should be great to get us out of this mess
Dafny-VScode will no longer install. On MacOS at least, it stops at 4% "Extracting Dafny" with the following error - Seems related to #29. With no option to specify a different Dafny, there's no way to get a working system, or get back a working system after agreeing to an "upgrade".
Extracting files... Error extracting /Users/kjx/.vscode/extensions/correctnesslab.dafny-vscode-0.17.2/dafny.zip: Error: Unsupported file type "undefined" Error: Unsupported file type "undefined" at DecompressZip.extractFile (/Users/kjx/.vscode/extensions/correctnesslab.dafny-vscode-0.17.2/server/node_modules/decompress-zip/lib/decompress-zip.js:320:11) at /Users/kjx/.vscode/extensions/correctnesslab.dafny-vscode-0.17.2/server/node_modules/decompress-zip/lib/decompress-zip.js:253:28 at Array.forEach ()
at DecompressZip.extractFiles (/Users/kjx/.vscode/extensions/correctnesslab.dafny-vscode-0.17.2/server/node_modules/decompress-zip/lib/decompress-zip.js:252:11)
at /Users/kjx/.vscode/extensions/correctnesslab.dafny-vscode-0.17.2/server/node_modules/decompress-zip/lib/decompress-zip.js:132:21
at _fulfilled (/Users/kjx/.vscode/extensions/correctnesslab.dafny-vscode-0.17.2/server/node_modules/q/q.js:854:54)
at /Users/kjx/.vscode/extensions/correctnesslab.dafny-vscode-0.17.2/server/node_modules/q/q.js:883:30
at Promise.promise.promiseDispatch (/Users/kjx/.vscode/extensions/correctnesslab.dafny-vscode-0.17.2/server/node_modules/q/q.js:816:13)
at /Users/kjx/.vscode/extensions/correctnesslab.dafny-vscode-0.17.2/server/node_modules/q/q.js:624:44
at runSingle (/Users/kjx/.vscode/extensions/correctnesslab.dafny-vscode-0.17.2/server/node_modules/q/q.js:137:13)
errrroooorrr: Error: Unsupported file type "undefined"