nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

direnv: Disable Cgo to build a static executable

To fix segmentation faults happening because of an incompatible libc when setting `LD_LIBRARY_PATH`.

This was originally reported to pyproject.nix in https://github.com/pyproject-nix/pyproject.nix/issues/405 but is a nixpkgs issue.

(cherry picked from commit e9c060893ad966ba8803591a985cfdc10b610ffa)

authored by

adisbladis and committed by
github-actions[bot]
fce63b53 98bf8103

+3
+3
pkgs/by-name/di/direnv/package.nix
··· 25 25 # we have no bash at the moment for windows 26 26 BASH_PATH = lib.optionalString (!stdenv.hostPlatform.isWindows) "${bash}/bin/bash"; 27 27 28 + # Build a static executable to avoid environment runtime impurities 29 + env.CGO_ENABLED = 0; 30 + 28 31 # replace the build phase to use the GNUMakefile instead 29 32 buildPhase = '' 30 33 make BASH_PATH=$BASH_PATH