Unverified Commit e2cb3b43 authored by Samuel Ainsworth's avatar Samuel Ainsworth Committed by GitHub
Browse files

Merge pull request #151918 from Enzime/vscode-use-system-rg

vscode: Don't use bundled ripgrep by default
parents 76e5d932 13b07c61
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@
# sourceExecutableName is the name of the binary in the source archive, over
# which we have no control
, sourceExecutableName ? executableName

, useVSCodeRipgrep ? false
, ripgrep
}:

let
@@ -131,10 +134,17 @@ let
      # and the window immediately closes which renders VSCode unusable
      # see https://github.com/NixOS/nixpkgs/issues/152939 for full log
      ln -rs "$unpacked" "$packed"

      # this fixes bundled ripgrep
      chmod +x resources/app/node_modules/@vscode/ripgrep/bin/rg
    '';
    '' + (let
      vscodeRipgrep = if stdenv.isDarwin then
        "Contents/Resources/app/node_modules.asar.unpacked/@vscode/ripgrep/bin/rg"
      else
        "resources/app/node_modules/@vscode/ripgrep/bin/rg";
    in if !useVSCodeRipgrep then ''
      rm ${vscodeRipgrep}
      ln -s ${ripgrep}/bin/rg ${vscodeRipgrep}
    '' else ''
      chmod +x ${vscodeRipgrep}
    '');

    inherit meta;
  };
+2 −1
Original line number Diff line number Diff line
{ stdenv, lib, callPackage, fetchurl
, isInsiders ? false
, commandLineArgs ? ""
, useVSCodeRipgrep ? false
}:

let
@@ -34,7 +35,7 @@ in
    executableName = "code" + lib.optionalString isInsiders "-insiders";
    longName = "Visual Studio Code" + lib.optionalString isInsiders " - Insiders";
    shortName = "Code" + lib.optionalString isInsiders " - Insiders";
    inherit commandLineArgs;
    inherit commandLineArgs useVSCodeRipgrep;

    src = fetchurl {
      name = "VSCode_${version}_${plat}.${archive_fmt}";
+2 −2
Original line number Diff line number Diff line
{ lib, stdenv, callPackage, fetchurl, nixosTests, commandLineArgs ? "" }:
{ lib, stdenv, callPackage, fetchurl, nixosTests, commandLineArgs ? "", useVSCodeRipgrep ? false }:

let
  inherit (stdenv.hostPlatform) system;
@@ -24,7 +24,7 @@ let
  sourceRoot = if stdenv.isDarwin then "" else ".";
in
  callPackage ./generic.nix rec {
    inherit sourceRoot commandLineArgs;
    inherit sourceRoot commandLineArgs useVSCodeRipgrep;

    # Please backport all compatible updates to the stable release.
    # This is important for the extension ecosystem.