Skip to content

Commit f15e455

Browse files
author
Cassandra Comar
committed
fakedir patch upstreamed
the null buffer issue has been resolved upstreamed with a PR. also, fix an issue with symlinks/shebangs not being rewritten for the initial program executed by the startup script -- we need to avoid that call to execvp happening in the process environment that existed prior to the injection of the fakedir libraries. to do that, run a new shell where the exported env vars are set and avoid that shell just execing by first testing if the fakedir library is present and loaded, then running the specified executable.
1 parent 8a9cac1 commit f15e455

File tree

3 files changed

+6
-28
lines changed

3 files changed

+6
-28
lines changed

fakedir-null-buffer.patch

Lines changed: 0 additions & 23 deletions
This file was deleted.

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
bundlers = {
99
nix-bundle = { program, system }: let
1010
nixpkgs' = nixpkgs.legacyPackages.${system};
11-
fakedir = fakedir-pkgs.packages.${system}.fakedir.overrideAttrs (old: { patches = [./fakedir-null-buffer.patch]; });
11+
fakedir = fakedir-pkgs.packages.${system}.fakedir-universal;
1212
nix-bundle = import self { nixpkgs = nixpkgs'; inherit fakedir; };
1313
script-linux = nixpkgs'.writeScript "startup" ''
1414
#!/bin/sh
@@ -23,7 +23,8 @@
2323
export FAKEDIR_PATTERN=/nix
2424
export FAKEDIR_TARGET="''${__TMPX_DAT_PATH}/nix"
2525
26-
exec "''${__TMPX_DAT_PATH}$(dirname ${program})/$(basename "$0")" "$@"
26+
# make sure the fakedir libraries are loaded and avoid sh execing without the libraries loaded first
27+
sh -c "test -e $DYLD_INSERT_LIBRARIES && ''${__TMPX_DAT_PATH}$(dirname ${program})/$(basename "$0") $@"
2728
'';
2829
script = if nixpkgs'.stdenv.isDarwin then script-darwin else script-linux;
2930
in nix-bundle.makebootstrap {

0 commit comments

Comments
 (0)