Open kanielrkirby opened 1 month ago
Thanks for letting me know this doesn't work.
Is there a reason this might not be supported / currently work?
Yes. Right now, inside the nix derivation, the binary is compiled using Deno. And deno definitely doesnt have a static linking option. So the final executable links to a bunch of standard Linux shared object files (probably). And thats what NixOS is complaining about.
Theres probably a way to patch it with patchelf but I'm not sure how much elbow greese thats going to need. I'll need to find equivalent .so files inside the nix store, add those as runtime dependencies, and patch the binary so it dynamically links to them instead of standard Linux ones.
Usually this would be handled by autoPatchElf in mkDerivation, but mkDerivation breaks the deno executable, so I have to call derivation manually, which means I also need to manually do the Patchelf steps.
Ah, I see. I was going to ask if deno2nix
would be a solution, but it seems to be unmaintained unfortunately, with no definitive fork.
There's a few (very few) deno
packages in NixOS/nixpkgs
that could potentially be some inspiration as well, if you end up wanting to solve this. Unfortunately, systems with Deno are a bit outside my expertise, or I'd happily mess with it a bit / make a PR.
I don't think this is a deno specific problem, I just need to patch the dynamic links. I appreciate the effort to help though!
I found theres 4 dynamic links, all go to the nix store, but 3 are not hardcoded to the nix store so I'm assuming those are the ones I need to fix with patchelf
I find this to be strange behavior from a
nix
focused project. Is there a reason this might not be supported / currently work?