Commit e9c06089 authored by adisbladis's avatar adisbladis
Browse files

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.
parent b9447e15
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -25,6 +25,9 @@ buildGoModule rec {
  # we have no bash at the moment for windows
  BASH_PATH = lib.optionalString (!stdenv.hostPlatform.isWindows) "${bash}/bin/bash";

  # Build a static executable to avoid environment runtime impurities
  env.CGO_ENABLED = 0;

  # replace the build phase to use the GNUMakefile instead
  buildPhase = ''
    make BASH_PATH=$BASH_PATH