nix-community / nixos-vscode-server

Visual Studio Code Server support in NixOS
MIT License
412 stars 75 forks source link

Fix eval after nixpkgs#225748 #56

Closed SuperSandro2000 closed 1 year ago

SuperSandro2000 commented 1 year ago

see https://github.com/NixOS/nixpkgs/pull/225748

msteen commented 1 year ago

Isn't , buildFHSEnv ? buildFHSUserEnv dead code?

SuperSandro2000 commented 1 year ago

If I remove it eval fails like:

error: undefined variable 'buildFHSEnv'

       at /nix/store/95kdbql5bvjna2z05jvxjxabddnxnali-source/pkgs/auto-fix-vscode-server.nix:1:26:

            1| { lib, buildFHSUserEnv ? buildFHSEnv
             |                          ^
            2| , writeShellApplication, coreutils, findutils, inotify-tools, patchelf
msteen commented 1 year ago

@SuperSandro2000 Could you share with me on which exact nixpkgs commit this fails for you? I cannot reproduce it on a recent nixos-unstable?

I am not merging this PR, as it is the equivalent of this:

$ nix eval --expr '({ a, b ? c, c ? b }: a) { a = 1; }'
1

No problem, as b and c are not used. However once they are, since they are referencing each other, you obviously get a infinite recursion error:

$ nix eval --expr '({ a, b ? c, c ? b }: b) { a = 1; }'
error: infinite recursion encountered

       at «string»:1:18:

            1| ({ a, b ? c, c ? b }: b) { a = 1; }
             |   
SuperSandro2000 commented 1 year ago

Could you share with me on which exact nixpkgs commit this fails for you? I cannot reproduce it on a recent nixos-unstable?

I forgot to mention that I have aliases disabled,

msteen commented 1 year ago

Had to figure out what you meant with that, but that was the missing piece of information. You meant you have the allowAliases config option of nixpkgs set to false, and only in that case will it fail to evaluate, as this alias will not be used. Now that I know your PR is basically reintroducing this alias in the package itself, and that it should not harm any other setups, I have merged it. Thanks for your contribution!