Unverified Commit 041e1c03 authored by zowoq's avatar zowoq Committed by GitHub
Browse files

terraform: set CGO_ENABLED based on platform in env (#491724)

parents 5097fa07 89b9a4d9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -39,6 +39,12 @@ let
          inherit hash;
        };

        # Set CGO_ENABLED based on platform:
        # - Linux: CGO_ENABLED=0 for static linking (avoids LTO plugin issues)
        # - Darwin: CGO_ENABLED=1 to avoid DNS resolution issues
        # See: https://github.com/hashicorp/terraform/blob/main/BUILDING.md
        env.CGO_ENABLED = if stdenv.hostPlatform.isDarwin then "1" else "0";

        ldflags = [
          "-s"
          "-w"