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

vscode-extensions: fix aliases #104796

Merged
merged 1 commit into from Nov 25, 2020
Merged

Conversation

jonringer
Copy link
Contributor

@jonringer jonringer commented Nov 24, 2020

Motivation for this change

closes #104783

I converted it over to an overlay, in case we ever want to also implement an overrides.nix, which would be necessary for doing an auto-update script

$ nix-instantiate --eval -E "with import ./. {}; lib.attrNames vscode-extensions.ms-vscode"
[ "Go" "cpptools" "recurseForDerivations" ]
$ nix-instantiate --eval -E "with import ./. { config = { allowAliases = false; }; }; lib.attrNames vscode-extensions.ms-vscode"
[ "cpptools" "recurseForDerivations" ]

cc @buckley310 @priegger

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@jonringer jonringer changed the title vscode-extensions: fix alliases vscode-extensions: fix aliases Nov 24, 2020
@priegger
Copy link
Contributor

Thanks!

I used an overlay with rev 348ffdf. I installed vscode-with-extensions with vscodium, some extensions from nixpkgs (some regular, the ms-vscode.Go alias, ms-vscode.cpptools which were removed by the old alias logic) as well as some extensions from the vscode marketplace.

The extensions seem to be ok. I can jump to function definitions in go files, I can jump to variable definitions in c files.

@buckley310
Copy link
Contributor

I can confirm, this closes #104783 for me.

ms-vscode.Go = golang.Go;
}
);
ms-vscode = lib.recursiveUpdate super.ms-vscode { inherit (super.golang) Go; };
Copy link
Contributor

@priegger priegger Nov 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me this approach feels a little fragile:

  • If all ms-vscode extensions are dropped, the aliases need to be changed, because super.ms-vscode does not exist anymore. Right?
  • If then a ms-vscode extension is added again, it is not there until the aliases overlay is adjusted again.

Is it possible to use mkMerge or something like this here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you did exactly that in the other PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • If all ms-vscode extensions are dropped, the aliases need to be changed, because super.ms-vscode does not exist anymore. Right?

  • If then a ms-vscode extension is added again, it is not there until the aliases overlay is adjusted again.

This shouldn't be too much of an issue, because this is all co-located within the same file. The more elegant implementation is in the other PR, but it might be "controversial" to add a recursiveExtends function.

@jonringer
Copy link
Contributor Author

I was able to rebuild my home-manager config which included the old ms-vscode.cpptools extension by doing home-manager -I nixpkgs=$PWD switch. I think this is good to merge

@jonringer jonringer merged commit bd11afe into NixOS:master Nov 25, 2020
@jonringer jonringer deleted the fix-vscode-extensions branch November 25, 2020 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vscode-extensions.ms-vscode.cpptools is missing
3 participants