From 5f99e96fbb7964c94f465897ebb59964db76628e Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Tue, 10 Dec 2024 00:05:40 +0100 Subject: [PATCH 1/3] only ignore `{flake,default}.nix` and `{.envrc,.direnv/}` in the root this makes it so files in `src/nix-dev-shell` are *not* ignored, as they should not be. note that `flake.lock` is still ignored globally. --- .gitignore | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index ce9db8b861d04..f84a3704ca900 100644 --- a/.gitignore +++ b/.gitignore @@ -88,12 +88,12 @@ package.json tests/rustdoc-gui/src/**.lock ## direnv -.envrc -.direnv/ +/.envrc +/.direnv/ ## nix -flake.nix +/flake.nix flake.lock -default.nix +/default.nix # Before adding new lines, see the comment at the top. From 6058cdcccc4fcfa3c2ae2ce878cf229dae776041 Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Tue, 10 Dec 2024 00:09:40 +0100 Subject: [PATCH 2/3] remove instructions to git exclude files in `src/nix-dev-shell/envrc-*` this is no longer needed as `.gitignore` contains both `/.envrc` and `flake.lock` (and also `/.direnv/`) --- src/tools/nix-dev-shell/envrc-flake | 2 +- src/tools/nix-dev-shell/envrc-shell | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/nix-dev-shell/envrc-flake b/src/tools/nix-dev-shell/envrc-flake index 9def420f05cb4..849ed1f4fc56d 100644 --- a/src/tools/nix-dev-shell/envrc-flake +++ b/src/tools/nix-dev-shell/envrc-flake @@ -1,7 +1,7 @@ # If you want to use this as an .envrc file to create a shell with necessery components # to develop rustc, use the following command in the root of the rusr checkout: # -# ln -s ./src/tools/nix-dev-shell/envrc-flake ./.envrc && nix flake update --flake ./src/tools/nix-dev-shell && echo .envrc >> .git/info/exclude +# ln -s ./src/tools/nix-dev-shell/envrc-flake ./.envrc && nix flake update --flake ./src/tools/nix-dev-shell if nix flake show path:./src/tools/nix-dev-shell &> /dev/null; then use flake path:./src/tools/nix-dev-shell diff --git a/src/tools/nix-dev-shell/envrc-shell b/src/tools/nix-dev-shell/envrc-shell index fb7231a6c30ce..d8f900fe86a6d 100644 --- a/src/tools/nix-dev-shell/envrc-shell +++ b/src/tools/nix-dev-shell/envrc-shell @@ -1,7 +1,7 @@ # If you want to use this as an .envrc file to create a shell with necessery components # to develop rustc, use the following command in the root of the rusr checkout: # -# ln -s ./src/tools/nix-dev-shell/envrc-shell ./.envrc && echo .envrc >> .git/info/exclude +# ln -s ./src/tools/nix-dev-shell/envrc-shell ./.envrc use nix ./src/tools/nix-dev-shell/shell.nix From 05d83185c3faac682a8a1d8a674a58afa180f292 Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Tue, 10 Dec 2024 00:19:29 +0100 Subject: [PATCH 3/3] provide `libz.so.1` in the `nix-dev-shell` `libz.so.1` is needed for some (?) things... i personally found myself in need of it when running `x t linkchecker`, which failed when running cargo build script or something. although there are also mentions of rustc itself needing it: --- src/tools/nix-dev-shell/flake.nix | 5 ++--- src/tools/nix-dev-shell/shell.nix | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/tools/nix-dev-shell/flake.nix b/src/tools/nix-dev-shell/flake.nix index 8ab5e097427d6..1b838bd2f7b37 100644 --- a/src/tools/nix-dev-shell/flake.nix +++ b/src/tools/nix-dev-shell/flake.nix @@ -24,9 +24,8 @@ # Avoid creating text files for ICEs. RUSTC_ICE = "0"; # Provide `libstdc++.so.6` for the self-contained lld. - LD_LIBRARY_PATH = "${with pkgs; lib.makeLibraryPath [ - stdenv.cc.cc.lib - ]}"; + # Provide `libz.so.1`. + LD_LIBRARY_PATH = "${with pkgs; lib.makeLibraryPath [stdenv.cc.cc.lib zlib]}"; }; } ); diff --git a/src/tools/nix-dev-shell/shell.nix b/src/tools/nix-dev-shell/shell.nix index 8a5cbb7c89e47..a3f5969bd812d 100644 --- a/src/tools/nix-dev-shell/shell.nix +++ b/src/tools/nix-dev-shell/shell.nix @@ -13,7 +13,6 @@ pkgs.mkShell { # Avoid creating text files for ICEs. RUSTC_ICE = "0"; # Provide `libstdc++.so.6` for the self-contained lld. - LD_LIBRARY_PATH = "${with pkgs; lib.makeLibraryPath [ - stdenv.cc.cc.lib - ]}"; + # Provide `libz.so.1` + LD_LIBRARY_PATH = "${with pkgs; lib.makeLibraryPath [stdenv.cc.cc.lib zlib]}"; }