node2nix icon indicating copy to clipboard operation
node2nix copied to clipboard

help/how-to fix build-time downloaded file in dependent npm package?

Open colemickens opened this issue 4 years ago • 0 comments

Describe the bug

vscode-ripgrep tries to download a binary at runtime: https://github.com/microsoft/vscode-ripgrep/blob/master/lib/postinstall.js#L50

I'd like to pre-link the ripgrep binary into place in the bin directory before postInstall runs to avoid this issue entirely.

However, I absolutely cannot figure out how to do this. I have a package.json that includes some theia components, which in turn, then include vscode-ripgrep.

I've tried overriding hte package per the instructions in the readme, but I don't see how that's even supposed to work. This seems to have just generated one single huge nodeDependencies that just includes every single dependent tarball unpacked. I don't see how I'm supposed to hook into just vscode-ripgrep to fix it.

I've also tried just like this, but nothing has worked:

        mkdir -p $out/lib/node_modules/theia-nix-test/node_modules/vscode-ripgrep
        ln -s ${ripgrep}/bin/rg $out/lib/node_modules/theia-nix-test/node_modules/vscode-ripgrep/rg

before the call to:

        ${prepareAndInvokeNPM { inherit packageName bypassCache reconstructLock npmFlags production; }}

colemickens avatar Oct 28 '20 06:10 colemickens