Skip to content

Instantly share code, notes, and snippets.

@aaronjanse
Created September 20, 2021 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronjanse/0b6145784fcb1aa6ee1419248ae53872 to your computer and use it in GitHub Desktop.
Save aaronjanse/0b6145784fcb1aa6ee1419248ae53872 to your computer and use it in GitHub Desktop.
rnix-lsp with rnix-parser patched for memory leak bug
diff --git a/Cargo.lock b/Cargo.lock
index 05ad0a9..1b77af8 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,5 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
+version = 3
+
[[package]]
name = "aho-corasick"
version = "0.7.18"
@@ -420,8 +422,7 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
[[package]]
name = "rnix"
version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b37f8af07a0354606141df076458660af7e22238e4117a041c21c548080addd"
+source = "git+https://github.com/nix-community/rnix-parser?branch=fix-memleak#0f383bef353a639be97d2ab56f91eb07f2ad0c7e"
dependencies = [
"cbitset",
"rowan",
diff --git a/Cargo.toml b/Cargo.toml
index 258c9e9..b3e978b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,3 +24,6 @@ rnix = "0.9.0"
rowan = "0.12.6"
serde = "1.0.104"
serde_json = "1.0.44"
+
+[patch.crates-io]
+rnix = { git = "https://github.com/nix-community/rnix-parser", branch = "fix-memleak" }
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1630481079,
"narHash": "sha256-leWXLchbAbqOlLT6tju631G40SzQWPqaAXQG3zH1Imw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "110a2c9ebbf5d4a94486854f18a37a938cfacbbb",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-21.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"utils": "utils"
}
},
"utils": {
"locked": {
"lastModified": 1629481132,
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "997f7efcb746a9c140ce1f13c72263189225f482",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
{
inputs = {
utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixos-21.05";
};
outputs = { self, nixpkgs, utils }:
utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}";
in {
defaultPackage = pkgs.rustPlatform.buildRustPackage {
name = "rnix-lsp";
src = pkgs.fetchFromGitHub {
owner = "nix-community";
repo = "rnix-lsp";
rev = "ab9c26a903846fc6712b811bdb32a2539ed3a42d";
hash = "sha256-hlJ0FYaxUGpFqAuhB+Fde7ydxJQXV3NIwKQ8rW85gc8=";
};
cargoPatches = [ ./cargo.patch ];
checkInputs = [ pkgs.nixUnstable ];
cargoSha256 = "sha256-4vVVPOJaTZF1xsHNDkK9UFofqUjJqahkesqikWLYYlk=";
};
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment