Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makeBinaryWrapper: create binary wrappers #95569

Closed
wants to merge 2 commits into from

Commits on Aug 16, 2020

  1. makeBinaryWrapper: create binary wrappers

    When packaging programs we often need to change the environment the program is run in.
    Typically this is done using wrappers. Thus far, the wrappers produced were typically
    shell scripts, thus interpreted, and with a shebang. This is an issue on e.g. Darwin,
    where shebangs cannot point at interpreted scripts.
    
    This commit introduces a new program for creating binary wrappers. The program, written
    currently in Python, produces an instruction in JSON which is loaded into a Nim program
    and then compiled into a binary.
    
    With interpreted wrappers one can easily check the code to see what it is doing, but with
    a binary that is more difficult. To that end, an environment variable `NIX_DEBUG_WRAPPER`
    is introduced which, when set, causes an executed wrapper to print the embedded JSON
    instead of exec'ing into the wrapped executable.
    
    The Python program aims to be compatible with the existing `makeWrapper` but is lacking
    features, mostly because of difficulties with implementing them using `argparse`.
    FRidh committed Aug 16, 2020
    Configuration menu
    Copy the full SHA
    64062c9 View commit details
    Browse the repository at this point in the history
  2. nim: add minimal option that is stripped of its dependencies

    For `makeBinaryWrapper` we preferably keep the closure small so it can
    be used early on during bootstrapping.
    FRidh committed Aug 16, 2020
    Configuration menu
    Copy the full SHA
    da5f535 View commit details
    Browse the repository at this point in the history