-
Notifications
You must be signed in to change notification settings - Fork 42
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
Fails to connect to a Agda Language Server running on NixOS on WSL #183
Comments
On the other end of the complexity spectrum, I have this error on stock Ubuntu 23.10, loading the language server through VSCode (1.87.0) and this extension. The steps I took:
The only difference I'm seeing is restarting does not give me a different error. I can reproduce this every time I open VSCode and Edit: I also seem to be experiencing #139 |
I believe the NixOS issue is happening because The alternative is to use something like nix-ld to add the dependencies to your environment, but I couldn't get this to work cause VSCode/agda-mode-vscode (not sure which) doesn't seem to be respecting the environment variables I've set before launching VSCode. My temporary workaround is to launch the downloaded (unpatched) {
description = "agda-env";
inputs = {
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils }: utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) agda gmp icu70 lib libz mkShell ncurses stdenv vscode;
in
{
devShells.default = mkShell {
packages = [ agda vscode ];
NIX_LD_LIBRARY_PATH = lib.makeLibraryPath [
gmp
icu70
libz
ncurses
];
NIX_LD = builtins.readFile "${stdenv.cc}/nix-support/dynamic-linker";
};
});
} ...by running: Agda_datadir=$HOME/.config/Code/User/globalStorage/banacorn.agda-mode/v0.2.6.4.0.3-linux/data/ $HOME/.config/Code/User/globalStorage/banacorn.agda-mode/v0.2.6.4.0.3-linux/als -p (You may need to adjust some paths.) Edit: after using this some more, I'm having trouble with imports, and I haven't figured out why yet. So even this workaround doesn't appear to be a complete solution. |
You can instead try to install the standard library manually as described here, which should work. |
I am on Windows 10 and I want to write some Agda code.
The HoTT Game recommends that I install NixOS on WSL2 and run Agda there.
So I installed NioOS using
wsl --import NixOS .\NixOS\ nixos-wsl.tar.gz --version 2
as described in NixOS-WSL.Now, the current version of NixOS-WSL does not support VS Code out of the box (issue here), so I used this flake to fix that, as recommended in the issue.
That means that my current configuration is as follows:
NixOS in WSL2 on Windows 10 with
/etc/nixos/
containing:flake.nix
:configuration.nix
:Additionally, I have a project folder
~/agda-test
containing:flake.nix
:AgdaTest.agda
with some Agda code.Now, in this folder (
~/agda-test
) I run:nix develop
code .
This opens the folder in VS Code in Windows, as intended.
I open
AgdaTest.agda
in this VS Code instance, goC-c C-l
and it fails.I initially got this error:
I tried doing
chmod a+x als
, but this had no effect - the error persisted as it was despite the added permission, and I subsequently reversed that change.Now, writing this issue, I restarted everything and seemingly spontaneously got a different error after
C-c C-l
:The text was updated successfully, but these errors were encountered: