Skip to content

Commit

Permalink
nix: Update nix flake (#23343)
Browse files Browse the repository at this point in the history
Closes #23342 

Ran `nix flake update` and did some cleanup in shell.nix to follow nix
[best
practices](https://discourse.nixos.org/t/how-to-solve-libstdc-not-found-in-shell-nix/25458/6).

Prior to running `nix flake update`
`strings "$(echo "$LD_LIBRARY_PATH" | tr : "\n" | grep
"gcc")/libstdc++.so.6" | grep "CXXABI_1.3.15" CXXABI_1.3.15`
Does not find `CXXABI_1.3.15`

After running `nix flake update`

`strings "$(echo "$LD_LIBRARY_PATH" | tr : "\n" | grep
"gcc")/libstdc++.so.6" | grep "CXXABI_1.3.15" CXXABI_1.3.15`
Finds `CXXABI_1.3.15`

Launching Zed 0.168.3 inside Zed's nix development shell now launches
with no errors.

Release Notes:

- N/A
  • Loading branch information
AidanV authored Jan 19, 2025
1 parent 1d5499b commit 35dad05
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 5 additions & 7 deletions nix/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pkgs.mkShell rec {
pkgs.libgit2
pkgs.openssl
pkgs.sqlite
pkgs.stdenv.cc.cc
pkgs.zlib
pkgs.zstd
pkgs.rustToolchain
Expand All @@ -42,17 +43,14 @@ pkgs.mkShell rec {
]
++ lib.optional pkgs.stdenv.hostPlatform.isDarwin pkgs.apple-sdk_15;

LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib";
LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs;

PROTOC="${pkgs.protobuf}/bin/protoc";

# We set SDKROOT and DEVELOPER_DIR to the Xcode ones instead of the nixpkgs ones,
# because we need Swift 6.0 and nixpkgs doesn't have it.
# Xcode is required for development anyways
shellHook =
''
export LD_LIBRARY_PATH="${lib.makeLibraryPath buildInputs}:$LD_LIBRARY_PATH"
export PROTOC="${pkgs.protobuf}/bin/protoc"
''
+ lib.optionalString pkgs.stdenv.hostPlatform.isDarwin ''
shellHook = lib.optionalString pkgs.stdenv.hostPlatform.isDarwin ''
export SDKROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk";
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer";
'';
Expand Down

0 comments on commit 35dad05

Please sign in to comment.