nix: only use rust-src in devShell toolchain
Some checks are pending
binaries / Build binary artifacts (linux-aarch64-gnu, ubuntu-24.04, aarch64-unknown-linux-gnu) (push) Waiting to run
binaries / Build binary artifacts (linux-aarch64-musl, ubuntu-24.04, aarch64-unknown-linux-musl) (push) Waiting to run
binaries / Build binary artifacts (linux-x86_64-gnu, ubuntu-24.04, x86_64-unknown-linux-gnu) (push) Waiting to run
binaries / Build binary artifacts (linux-x86_64-musl, ubuntu-24.04, x86_64-unknown-linux-musl) (push) Waiting to run
binaries / Build binary artifacts (macos-aarch64, macos-14, aarch64-apple-darwin) (push) Waiting to run
binaries / Build binary artifacts (macos-x86_64, macos-13, x86_64-apple-darwin) (push) Waiting to run
binaries / Build binary artifacts (win-x86_64, windows-2022, x86_64-pc-windows-msvc) (push) Waiting to run
nix / flake check (macos-14) (push) Waiting to run
nix / flake check (ubuntu-latest) (push) Waiting to run
build / build (, macos-13) (push) Waiting to run
build / build (, macos-14) (push) Waiting to run
build / build (, ubuntu-latest) (push) Waiting to run
build / build (, windows-latest) (push) Waiting to run
build / build (--all-features, ubuntu-latest) (push) Waiting to run
build / Build jj-lib without Git support (push) Waiting to run
build / Check protos (push) Waiting to run
build / Check formatting (push) Waiting to run
build / Check that MkDocs can build the docs (push) Waiting to run
build / Check that MkDocs can build the docs with Poetry 1.8 (push) Waiting to run
build / cargo-deny (advisories) (push) Waiting to run
build / cargo-deny (bans licenses sources) (push) Waiting to run
build / Clippy check (push) Waiting to run
Codespell / Codespell (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-latest) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run

See the included comment. This helps avoid a large dependency on the rustc
toolchain and helps reduce closure size for Nix users.

Partial revert of 749481e552.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
This commit is contained in:
Austin Seipp 2024-10-17 16:46:48 -05:00
parent 4187847c60
commit 4a2983b77e

View file

@ -34,7 +34,7 @@
pkgs.lib.all (re: builtins.match re relPath == null) regexes; pkgs.lib.all (re: builtins.match re relPath == null) regexes;
}; };
ourRustVersion = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.complete); ourRustVersion = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default);
ourRustPlatform = pkgs.makeRustPlatform { ourRustPlatform = pkgs.makeRustPlatform {
rustc = ourRustVersion; rustc = ourRustVersion;
@ -147,7 +147,16 @@
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [ buildInputs = with pkgs; [
ourRustVersion # NOTE (aseipp): explicitly add rust-src to the rustc compiler only in
# devShell. this in turn causes a dependency on the rust compiler src,
# which bloats the closure size by several GiB. but doing this here
# and not by default avoids the default flake install from including
# that dependency, so it's worth it
#
# relevant PR: https://github.com/rust-lang/rust/pull/129687
(ourRustVersion.override {
extensions = [ "rust-src" ];
})
# Foreign dependencies # Foreign dependencies
openssl zstd libgit2 libssh2 openssl zstd libgit2 libssh2