Skip to content

add runtime shell as a build input to all derivations #3

Open
@illegalprime

Description

@illegalprime

fixing the patchShebangs script to respect cross compilation is incredibly important for reducing image size and build contamination. the script works by searching the build source for #! /path/to/binary in executable files and then replacing that binary with one from $PATH (which is populated with binaries from the nix store).

in this PR NixOS/nixpkgs#43833 (that was reverted) patchShebangs works by populating $PATH with binaries from buildInputs (to get host binaries and not build-time binaries). this works exactly the same except in the case of bash, which is never listed in buildInputs and is always implicitly in $PATH during non-cross builds (because of stdenv).

therefore we need to add the runtimeShell package as a buildInput to every derivation so patchShebangs can pick up on that package when doing its magic. this most likely means editing stdenv to include that package in its default list of buildInputs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingspotlightthis is the most important open issue right now

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions