fix: nodejs: strict-builder: patch shebangs - #510
Conversation
|
@hsjobeki I wonder why the we even produce node_modules that contain broken shebangs. Usually patchShebang is executed automatically in the fixup phase of each individual derivation, so there shouldn't be any corrupt shebangs. |
|
Strange. I‘d need to investigate this. questions:
|
It wasn't straightforward to only patch what's in
No, there can be a cleaner operation for the runnables. Any suggestions?
I can do it there instead. Sorry, still not completely familiar with this builder |
|
Thanks for your efforts. I appreciate it. |
Oh, I suppose since the tree is built fully with python, there's not a fixup phase that the derivation goes into at that time. As far as I understand, anyways. I don't know what that would entail to run the nix path substitution from within the python builds
Sounds good! no problem |
Oh yeah, I forgot about the node-modules-tree.nix
Note that patchShebangs can only substitute paths in shebangs for known buildInputs. The runCommandLocal which is used to execute the python builder probably needs nodejs as a build input and any other things that are expected to appear in shebangs. |
For the scenario where the installed
node_moduleswere used for building (nestjs in my situation), the shebangs were not patched for build time in the strict-builder. That lead tono such file or directoryin the sandbox.reference: https://matrix.to/#/!PrIEtcffTLLzUWvJOS:matrix.org/$zslZWYi4HF0xramEQum6xf808-VQbbJIkN4kbgGFqt0?via=nixos.org&via=matrix.org&via=nixos.dev
Also, the bins weren't runnable permissions.
This didn't seem like an issue within the granular builder, but maybe you all would know better than I if a similar fix is needed there as well.
@hsjobeki @DavHau