Bug with Git when LD_LIBRARY_PATH env variable set in Nix

Problem description:
The Git extension provides the following error if I in replit.nix I have the env variable LD_LIBRARY_PATH set to a value

Git error: There was an unrecognized fatal error with Git. This is probably a bug in the app.

Replit.nix:

{ pkgs }: {
	deps = [
		pkgs.nodejs-18_x
    pkgs.nodePackages.typescript-language-server
    pkgs.yarn
    pkgs.replitPackages.jest
    pkgs.openssl_1_1
	];
  env = { 
    LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ pkgs.openssl_1_1.out ]; 
  };
}

Expected behavior:
Expected Git to continue working

Actual behavior:
Git fails and logs the error provided.

Steps to reproduce:
Specify environment variable in replit.nix shown.

Bug appears at this link:

Browser:
OS: Macos Ventura 13.4.1
Device (Android, iOS, n/a leave blank): Mac
Plan (Free, Hacker, Pro Plan):
Pro

I imagine that the fact that you have to manually set LD_LIBRARY_PATH instead of just adding to the deps shows that Nix is trying to prevent unwanted breakages caused by adding openssl.
Instead, set PRYBAR_LD_LIBRARY_PATH in replit.nix, and, in .replit file, add this in the interpreter.command section.

env = { LD_LIBRARY_PATH = "$PRYBAR_LD_LIBRARY_PATH" }

Then, it’ll only be in the library path for the program, where it’s needed.

1 Like