From 20b99d1ac5bf498663c9da4eea2ef6ad2810e33e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Natalie=20Klestrup=20R=C3=B6ijezon?= Date: Tue, 5 Nov 2024 12:27:31 +0100 Subject: [PATCH] Update Nix dependencies to accomodate for the current MSRV (#329) --- Cargo.nix | 81 +++++++++++++++++++++--------------------------- nix/sources.json | 18 +++++------ 2 files changed, 44 insertions(+), 55 deletions(-) diff --git a/Cargo.nix b/Cargo.nix index f0436bac..0439afdf 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -14770,52 +14770,41 @@ rec { testPostRun ]); in - pkgs.runCommand "run-tests-${testCrate.name}" - { - inherit testCrateFlags; - buildInputs = testInputs; - } '' - set -e - - export RUST_BACKTRACE=1 - - # recreate a file hierarchy as when running tests with cargo - - # the source for test data - # It's necessary to locate the source in $NIX_BUILD_TOP/source/ - # instead of $NIX_BUILD_TOP/ - # because we compiled those test binaries in the former and not the latter. - # So all paths will expect source tree to be there and not in the build top directly. - # For example: $NIX_BUILD_TOP := /build in general, if you ask yourself. - # NOTE: There could be edge cases if `crate.sourceRoot` does exist but - # it's very hard to reason about them. - # Open a bug if you run into this! - mkdir -p source/ - cd source/ - - ${pkgs.buildPackages.xorg.lndir}/bin/lndir ${crate.src} - - # build outputs - testRoot=target/debug - mkdir -p $testRoot - - # executables of the crate - # we copy to prevent std::env::current_exe() to resolve to a store location - for i in ${crate}/bin/*; do - cp "$i" "$testRoot" - done - chmod +w -R . - - # test harness executables are suffixed with a hash, like cargo does - # this allows to prevent name collision with the main - # executables of the crate - hash=$(basename $out) - for file in ${drv}/tests/*; do - f=$testRoot/$(basename $file)-$hash - cp $file $f - ${testCommand} - done - ''; + pkgs.stdenvNoCC.mkDerivation { + name = "run-tests-${testCrate.name}"; + + inherit (crate) src; + + inherit testCrateFlags; + + buildInputs = testInputs; + + buildPhase = '' + set -e + export RUST_BACKTRACE=1 + + # build outputs + testRoot=target/debug + mkdir -p $testRoot + + # executables of the crate + # we copy to prevent std::env::current_exe() to resolve to a store location + for i in ${crate}/bin/*; do + cp "$i" "$testRoot" + done + chmod +w -R . + + # test harness executables are suffixed with a hash, like cargo does + # this allows to prevent name collision with the main + # executables of the crate + hash=$(basename $out) + for file in ${drv}/tests/*; do + f=$testRoot/$(basename $file)-$hash + cp $file $f + ${testCommand} + done + ''; + }; in pkgs.runCommand "${crate.name}-linked" { diff --git a/nix/sources.json b/nix/sources.json index 74ab9a47..b1071336 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -5,10 +5,10 @@ "homepage": "", "owner": "kolloch", "repo": "crate2nix", - "rev": "a6ca1e58132bab26fc08572f22a34bbb86f4d91d", - "sha256": "009m6xxz5ckq4is4rlwsmxyb09dap49yzxm34qc0pnvwvlklhx9g", + "rev": "151122427d030874ebef3517cda766a6984e6ed6", + "sha256": "0clqy88nhd0w316957scnczzwrklazkfxbycxf0h17z7jrw1px6a", "type": "tarball", - "url": "https://github.com/kolloch/crate2nix/archive/a6ca1e58132bab26fc08572f22a34bbb86f4d91d.tar.gz", + "url": "https://github.com/kolloch/crate2nix/archive/151122427d030874ebef3517cda766a6984e6ed6.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "gomod2nix": { @@ -17,10 +17,10 @@ "homepage": "", "owner": "nix-community", "repo": "gomod2nix", - "rev": "7b8ef0d5fdc09b3a7acb27f1e6c168888947f364", - "sha256": "0bcgv4zc6121y030mnqn3s0vw82m6n19rwxnm47k2ys2v5arr36c", + "rev": "5d387097aa716f35dd99d848dc26d8d5b62a104c", + "sha256": "1mdwyjz43nnh7gfq4rc54kql6fy65hw17w0p4gwklnfqciwrkax2", "type": "tarball", - "url": "https://github.com/nix-community/gomod2nix/archive/7b8ef0d5fdc09b3a7acb27f1e6c168888947f364.tar.gz", + "url": "https://github.com/nix-community/gomod2nix/archive/5d387097aa716f35dd99d848dc26d8d5b62a104c.tar.gz", "url_template": "https://github.com///archive/.tar.gz", "version": "1.5.0" }, @@ -42,10 +42,10 @@ "homepage": "", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2122a9b35b35719ad9a395fe783eabb092df01b1", - "sha256": "0n2mfyakhpirbrv06qs5rd174f7nmnjmy7vkd1dim7sh340711fd", + "rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc", + "sha256": "0ha2a6j3y4dbclcw7s6p473fcrzxhn4yap4wbm8s4jg7v6wal0ph", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/2122a9b35b35719ad9a395fe783eabb092df01b1.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } }