Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

nix: Include corgi patches in build sources (#63644)

Jakub Konkacff4edce88d8
diff --git a/nix/build.nix b/nix/build.nix
index c01d869fddc..8abca4066aa 100644
--- a/nix/build.nix
+++ b/nix/build.nix
@@ -67,6 +67,7 @@ let
relPath = lib.removePrefix root path;
topLevelIncludes = [
"crates"
+ "corgi-patches"
"assets"
"extensions"
"script"
@@ -79,6 +80,10 @@ let
in
builtins.elem firstComp topLevelIncludes;
+ corgiPatches = builtins.path {
+ path = ../corgi-patches;
+ name = "corgi-patches";
+ };
craneLib = crane.overrideToolchain rustToolchain;
gpu-lib = if withGLES then libglvnd else vulkan-loader;
commonArgs =
@@ -305,7 +310,20 @@ let
drv;
};
};
- cargoArtifacts = craneLib.buildDepsOnly commonArgs;
+ cargoArtifacts = craneLib.buildDepsOnly (
+ builtins.removeAttrs commonArgs [ "src" ]
+ // {
+ dummySrc = craneLib.mkDummySrc {
+ inherit (commonArgs) src cargoLock;
+ # `scratch` is a local dependency of `cxx-build`, so its API is needed
+ # while Crane builds third-party dependencies.
+ extraDummyScript = ''
+ rm -rf $out/corgi-patches
+ cp --recursive ${corgiPatches} $out/corgi-patches
+ '';
+ };
+ }
+ );
in
craneLib.buildPackage (
lib.recursiveUpdate commonArgs {