Repository navigation
codebase-memory-mcp: 0.11.0 -> 0.12.0 - #574836
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
This update is tough. On linux, it introduces an NPM dependency on I'll try to come up with a better alternative, but for now I'll also test this build to see whether it even works to begin with. |
14f05bc to
0e1cfa8
Compare
d3e4d22 to
244d5ee
Compare
|
|
|
0.12.1 is out in the meantime, I'll update this PR when I get the chance. |
blackheaven
left a comment
There was a problem hiding this comment.
Some proposal:
diff --git a/pkgs/by-name/co/codebase-memory-mcp/package.nix b/pkgs/by-name/co/codebase-memory-mcp/package.nix
index 5d4c6a9a1915..a5e8a593cc88 100644
--- a/pkgs/by-name/co/codebase-memory-mcp/package.nix
+++ b/pkgs/by-name/co/codebase-memory-mcp/package.nix
@@ -5,51 +5,20 @@
fetchNpmDeps,
nodejs,
npmHooks,
- onnxruntime,
- runCommand,
stdenv,
versionCheckHook,
zlib,
}:
-let
- onnxruntimeNodeVersion = "1.27.0";
- onnxruntimeNodeSupportedPlatform =
- stdenv.hostPlatform.isLinux && (stdenv.hostPlatform.isx86_64 || stdenv.hostPlatform.isAarch64);
-in
-# When updating nixpkgs onnxruntime major.minor, update onnxruntime-node and its package-lock integrity hashes together.
-assert lib.assertMsg (
- lib.versions.majorMinor onnxruntime.version == lib.versions.majorMinor onnxruntimeNodeVersion
-) "codebase-memory-mcp: onnxruntime-node and onnxruntime must share a major.minor version";
stdenv.mkDerivation (finalAttrs: {
pname = "codebase-memory-mcp";
version = "0.12.0";
- src =
- runCommand "codebase-memory-mcp-${finalAttrs.version}-source"
- {
- source = fetchFromGitHub {
- owner = "DeusData";
- repo = "codebase-memory-mcp";
- rev = "v${finalAttrs.version}";
- hash = "sha256-2pTxcHa4KHpfZnR7IBN0/WKsxqFhRzTXAscIuf2tdwc=";
- };
- }
- ''
- cp -r "$source" "$out"
- chmod -R u+w "$out"
-
- # Keep the Node binding compatible with the ONNX Runtime ABI used by nixpkgs.
- substituteInPlace "$out/graph-ui/package.json" \
- --replace-fail '"[email protected]": {' '"onnxruntime-node": { ".": "${onnxruntimeNodeVersion}",'
- substituteInPlace "$out/graph-ui/package-lock.json" \
- --replace-fail '"version": "1.24.3"' '"version": "${onnxruntimeNodeVersion}"' \
- --replace-fail 'onnxruntime-common-1.24.3.tgz' 'onnxruntime-common-${onnxruntimeNodeVersion}.tgz' \
- --replace-fail 'sha512-GeuPZO6U/LBJXvwdaqHbuUmoXiEdeCjWi/EG7Y1HNnDwJYuk6WUbNXpF6luSUY8yASul3cmUlLGrCCL1ZgVXqA==' 'sha512-3KxL5wIVqa8Ex08jxSzncm9CMgw8CjOFyOQ7SxvG9o0cVLlhTNKXyIQuTbtX4tGPJEf73OER2xrjt4HJSBL4ow==' \
- --replace-fail 'onnxruntime-node-1.24.3.tgz' 'onnxruntime-node-${onnxruntimeNodeVersion}.tgz' \
- --replace-fail 'sha512-JH7+czbc8ALA819vlTgcV+Q214/+VjGeBHDjX81+ZCD0PCVCIFGFNtT0V4sXG/1JXypKPgScQcB3ij/hk3YnTg==' 'sha512-QEzGwrvNBgv4uPVdnbHsOGG4G6T96mdlcFI8aAKPjMU8wOPpVocPXb6k3QGkaZagVTv2G9Bnnbo6Z3JdXr1fQw==' \
- --replace-fail '"global-agent": "^3.0.0"' '"global-agent": "^4.1.3"' \
- --replace-fail '"onnxruntime-common": "1.24.3"' '"onnxruntime-common": "${onnxruntimeNodeVersion}"'
- '';
+ src = fetchFromGitHub {
+ owner = "DeusData";
+ repo = "codebase-memory-mcp";
+ rev = "v${finalAttrs.version}";
+ hash = "sha256-2pTxcHa4KHpfZnR7IBN0/WKsxqFhRzTXAscIuf2tdwc=";
+ };
patches = [
./remove-install-update.diff
@@ -71,7 +40,7 @@ stdenv.mkDerivation (finalAttrs: {
npmDeps = fetchNpmDeps {
inherit (finalAttrs) src;
sourceRoot = "${finalAttrs.src.name}/${finalAttrs.npmRoot}";
- hash = "sha256-0zfsw4se2jF89PP3a0r5C3sHiZsSgOpmqQ6/HzoZEhM=";
+ hash = "sha256-MKXmiMUofKka1C1jwlm+Mq8X90cTMvipfTC3eX0iv60=";
};
npmRoot = "graph-ui";
@@ -81,11 +50,11 @@ stdenv.mkDerivation (finalAttrs: {
npmHooks.npmConfigHook
];
+ doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
buildInputs = [
bash
- onnxruntime
zlib
];
@@ -108,30 +77,10 @@ stdenv.mkDerivation (finalAttrs: {
"CFLAGS_EXTRA='-DCBM_VERSION=\"${finalAttrs.version}\"'"
];
- preBuild = lib.optionalString onnxruntimeNodeSupportedPlatform ''
- onnxruntimeNodeDir="graph-ui/node_modules/onnxruntime-node/bin/napi-v6/linux/${
- if stdenv.hostPlatform.isx86_64 then "x64" else "arm64"
- }"
-
- # The native binding looks up libonnxruntime.so.1 through its $ORIGIN RUNPATH.
- # The Nix-built core and providers retain their Nix store RUNPATHs for their
- # own dependency closures.
- rm -f "$onnxruntimeNodeDir"/libonnxruntime*.so*
- for library in ${onnxruntime}/lib/libonnxruntime*.so*; do
- ln -s "$library" "$onnxruntimeNodeDir/$(basename "$library")"
- done
- '';
-
installPhase = ''
runHook preInstall
install -Dm755 build/c/codebase-memory-mcp $out/bin/codebase-memory-mcp
- # Retain the N-API binding at its standard module-relative location. Its
- # libonnxruntime*.so* entries are Nix-store symlinks created in preBuild.
- install -d $out/lib/codebase-memory-mcp/node_modules
- cp -r graph-ui/node_modules/{onnxruntime-common,onnxruntime-node} \
- $out/lib/codebase-memory-mcp/node_modules/
-
runHook postInstall
'';
1a3710c to
77f605e
Compare
|
With your patches applied, it also builds after a |
blackheaven
left a comment
There was a problem hiding this comment.
Tested locally, LGTM, thanks a lot!
77f605e to
e6f9377
Compare
Diff: DeusData/codebase-memory-mcp@v0.11.0...v0.12.1 Do not globally interpose mimalloc on Linux: glibc-owned allocations can otherwise reach mi_free during startup and crash the process. Assisted-by: OpenCode (GPT-5.6 Terra) Co-authored-by: Gautier DI FOLCO <[email protected]>
e6f9377 to
af5ba05
Compare
|
Sorry for the post-LGTM pushes,
|
|
As a side note, with just two source lines changed, this builds on
|
|
PR is now merged so the URL will remain stable.
PR is now merged so the URL will remain stable.
* chore(deps): update flake * chore(deps): update flake * feat: install some formatters to the env * fix(llama-cpp): disable tests that are timing out consistently * chore(deps): update flake, disable failing llama-cpp tests * fix: backport patchelf fix Backport //github.com/NixOS/nixpkgs/pull/575979 to fix CUDA builds. * chore: update NixOS/nixpkgs#574836 patch PR is now merged so the URL will remain stable. * chore: add missing PR comment * fix: hplip build failure Backport NixOS/nixpkgs#575319. * chore(deps): update flake * chore(deps): update flake, remove applied patches
Diff: DeusData/codebase-memory-mcp@v0.11.0...v0.12.0
Major Web UI overhaul:
Screenshot above is from the Linux build with
onnxruntimeloaded via nix store symlinks. Packaging updated quite a bit to replace NuGetonnxruntimedependency with nixpkgs store paths.Things done
./result/bin/.nixpkgs-reviewon this PR. See nixpkgs-review usage.passthru.tests.