+4
-1
doc/stdenv/stdenv.chapter.md
+4
-1
doc/stdenv/stdenv.chapter.md
···If dependencies should be resolved at runtime, use `--suffix` to append fallback values to `PATH`.-There’s many more kinds of arguments, they are documented in `nixpkgs/pkgs/build-support/setup-hooks/make-wrapper.sh` for the `makeWrapper` implementation and in `nixpkgs/pkgs/build-support/setup-hooks/make-binary-wrapper/make-binary-wrapper.sh` for the `makeBinaryWrapper` implementation.+There’s many more kinds of arguments, they are documented in `nixpkgs/pkgs/build-support/setup-hooks/make-wrapper.sh` for the `makeWrapper` implementation and in `nixpkgs/pkgs/by-name/ma/makeBinaryWrapper/make-binary-wrapper.sh` for the `makeBinaryWrapper` implementation.`wrapProgram` is a convenience function you probably want to use most of the time, implemented by both `makeWrapper` and `makeBinaryWrapper`.Using the `makeBinaryWrapper` implementation is usually preferred, as it creates a tiny _compiled_ wrapper executable, that can be used as a shebang interpreter. This is needed mostly on Darwin, where shebangs cannot point to scripts, [due to a limitation with the `execve`-syscall](https://stackoverflow.com/questions/67100831/macos-shebang-with-absolute-path-not-working). Compiled wrappers generated by `makeBinaryWrapper` can be inspected with `less <path-to-wrapper>` - by scrolling past the binary data you should be able to see the shell command that generated the executable and there see the environment variables that were injected into the wrapper.+Use `makeWrapper` if you need the wrapper to use shell features (e.g. look up environment variables) at runtime.### `remove-references-to -t` \<storepath\> [ `-t` \<storepath\> ... ] \<file\> ... {#fun-remove-references-to}
+12
-2
pkgs/build-support/setup-hooks/make-wrapper.sh
+12
-2
pkgs/build-support/setup-hooks/make-wrapper.sh
···+# --add-flags ARGS : prepend ARGS verbatim to the Bash-interpreted invocation of the executable+# --append-flags ARGS : append ARGS verbatim to the Bash-interpreted invocation of the executable···
+34
-25
pkgs/by-name/ma/makeBinaryWrapper/make-binary-wrapper.sh
+34
-25
pkgs/by-name/ma/makeBinaryWrapper/make-binary-wrapper.sh
···+# --add-flags ARGS : prepend the whitespace-separated list of arguments ARGS to the invocation of the executable+# --append-flags ARGS : append the whitespace-separated list of arguments ARGS to the invocation of the executable·········-[[ -z "$flagsBefore" && -z "$flagsAfter" ]] || main="$main"${main:+$'\n'}$(addFlags "$flagsBefore" "$flagsAfter")$'\n'$'\n'+(( ${#flagsBefore[@]} + ${#flagsAfter[@]} > 0 )) && main="$main"${main:+$'\n'}$(addFlags flagsBefore flagsAfter)$'\n'$'\n'···printf '%s\n' "char **$var = calloc(${#before[@]} + argc + ${#after[@]} + 1, sizeof(*$var));"···
+11
-7
pkgs/test/make-binary-wrapper/add-flags/add-flags.c
+11
-7
pkgs/test/make-binary-wrapper/add-flags/add-flags.c
···
+4
-1
pkgs/test/make-binary-wrapper/add-flags/add-flags.cmdline
+4
-1
pkgs/test/make-binary-wrapper/add-flags/add-flags.cmdline
+4
pkgs/test/make-binary-wrapper/add-flags/add-flags.env
+4
pkgs/test/make-binary-wrapper/add-flags/add-flags.env
+28
-5
pkgs/test/make-wrapper/default.nix
+28
-5
pkgs/test/make-wrapper/default.nix
······+echo "test failed: the output of ${cmd} was '$output', expected ${lib.escapeShellArg toExpect}"······