nix-community / napalm

Support for building npm packages in Nix and lightweight npm registry [maintainer=?]
MIT License
104 stars 18 forks source link

Use src as string and not store path to avoid IFD #5

Closed nmattia closed 4 years ago

hyperfekt commented 4 years ago

This breaks building from derivations (if they haven't already been realized) instead of existing paths, any way to get that behavior back?

nmattia commented 4 years ago

@hyperfekt can you give a code example? I'll try to come up with a solution

hyperfekt commented 4 years ago

I tried adding rust-analyzer to the buildInputs but it did not help.

rust-analyzer = pkgs.fetchFromGitHub {
    owner = "rust-analyzer";
    repo = "rust-analyzer";
    rev = "ac7daf9cb9f6fcab5e561de2a43c6704868021e9";
    sha256 = "1x2cpyiyz6y7i52vqh3nk24vslazwd7a86pfzbnbwk4w0xry9ln2";
  };

  rust-analyzer-code = (napalm.buildPackage "${rust-analyzer}/editors/code" {
    name = "ra-lsp-0.0.1.zip";
    npmCommands = [
      "npm install"
      "patchShebangs node_modules"
      "node_modules/.bin/vsce package"
    ];
    installPhase = ''
      cp ra-lsp-0.0.1.vsix $out
    '';
  });
hyperfekt commented 4 years ago

Actually, it seems like this patch alone is not the culprit, and this usecase was never supported - although I'm not sure why, as readDir should be realizing the path. Ergo this should probably be a feature request issue instead.