Open nrdxp opened 3 years ago
@pikpikpikpik-123, this actually doesn't work. During a build, its still referencing the old version somewhere that I can't seem to override. Following the threads advice the following overlay should work, but doesn't:
final: prev:
let
pname = "pijul";
version = "1.0.0-alpha.48";
name = "${pname}-${version}";
src = prev.fetchCrate {
inherit version pname;
sha256 = "sha256-L9LoyZ3wrEYJq/W8bL7RfGTc+IIlGdHvlUJyW4wpXyc=";
};
in
{
pijul = prev.pijul.overrideAttrs (drv: {
inherit src version;
cargoDeps = drv.cargoDeps.overrideAttrs (prev.lib.const {
inherit src;
name = "${name}-vendor.tar.gz";
outputHash = "sha256-PmlZFT+E/NGDq0EneImwoZr7qyp+ptlxH/dabGeZDjQ=";
});
});
}
It fails with the following:
error: --- Error ----------------------------------------------------------------- nix
builder for '/nix/store/g82pqh35r3wblfy9pw59qlxddfwiz2qm-pijul-1.0.0-alpha.48.drv' failed with exit code 1; last 7 log lines:
unpacking sources
unpacking source archive /nix/store/5px1np78xvckbj7yp5a4zvmjvarl983g-pijul-1.0.0-alpha.48.tar.gz
source root is pijul-1.0.0-alpha.48.tar.gz
unpacking source archive /nix/store/41a7lm0ibji2jgp3fnx8kgg0d1igmqlm-pijul-1.0.0-alpha.48-vendor.tar.gz
setting SOURCE_DATE_EPOCH to timestamp 1615263615 of file pijul-1.0.0-alpha.48.tar.gz/src/repository/unix_lock.rs
patching sources
/nix/store/npdq5pilrfsklvhx0ws44lykc1rl1i66-stdenv-linux/setup: line 81: pushd: ../pijul-0.12.0-vendor.tar.gz/thrussh/: No such file or directory
The last line shows a reference to the previous version 0.12.0 even though the version has been overriden to v1.0.0-alpha.48
This workaround worked for me: https://discourse.nixos.org/t/is-it-possible-to-override-cargosha256-in-buildrustpackage/4393/4
Example usage in my overlay:
let
nixpkgs-unstable-for-bupstash-source = super.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
rev = "29b0d4d0b600f8f5dd0b86e3362a33d4181938f9";
sha256 = "sha256:10cafssjk6wp7lr82pvqh8z7qiqwxpnh8cswnk1fbbw2pacrqxr1";
};
nixpkgs-unstable-for-bupstash = import nixpkgs-unstable-for-bupstash-source {};
in
# This override incantation is from https://discourse.nixos.org/t/is-it-possible-to-override-cargosha256-in-buildrustpackage/4393/4.
bupstash_unstable = super.callPackage (nixpkgs-unstable-for-bupstash-source + "/pkgs/tools/backup/bupstash/default.nix") {
rustPlatform = super.rustPlatform // {
buildRustPackage = args:
(super.rustPlatform.buildRustPackage (args // {
src = self.fetchFromGitHub {
owner = "andrewchambers";
repo = "bupstash";
rev = "b719a11b3f9f3e6f2f2cf077a5d05d3f63166f0f"; # update `version` accordingly if you change this
sha256 = "0ik8zg0798qk5w07kwgaw79gzppdx09jwjw4snd1ahc6igyhl81f";
};
cargoSha256 = "0bliiap4n2nrwf0mh028q0cqr2vhk9k9sjvnsm1cz9swqx6xrn8f";
})).overrideAttrs (old: {
patches = (old.patches or []) ++ [
# TODO Remove once https://github.com/andrewchambers/bupstash/pull/108 is merged and available.
(self.fetchpatch {
name = "bupstash-Retry-without-O_NOATIME-when-lacking-permission-for-it.patch";
url = "https://github.com/nh2/bupstash/commit/119bbca9d36a9cf57a07f0e9710f1b87ed0966f4.patch";
sha256 = "078r9b13nq55na9p2fray2njb4yi8hnkiama0ffsckclcwjycd8m";
})
];
});
};
};
I marked this as stale due to inactivity. → More info
This is still an issue for me!
A small comment regarding people encountering this message and just wanting to rebuild a package in an overlay: embedding the whole package definition (e.g. mypackage = pkgs.rustPlatform.buildRustPackage { … }
instead of mypackage = super.mypackage.overrideAttrs (old: rec { … })
and replacing the cargoSha256 = "sha256-...";
with cargoSha256 = "";
to get the new value works. Ugly, but it works.
Describe the bug I am currently on the latest stable relese 20.09. Used to be able to pull the correct cargoSha256 from a failed build. After recently trying to override
rnix-lsp
to the latest git commit, when the build fails, there is no correct cargoSha256 value to paste into the overlay. All it says is:However, after reviewing the entire failed build log, there is no longer a line containing the proper hash as their used to be. Even if I follow the instructions above and replace the full hash with 0's, still there is no proper hash in the build log.
To Reproduce Steps to reproduce the behavior: Use this overlay in a NixOS 20.09 configuration:
Attempt to build rnix-lsp, and review the build log. Notice how there is no cargoSha256 to be found anywhere in the log.
I have also attached the build log so you can skip the above steps and see for yourself that the hash is nowhere in the log. log.gz
Expected behavior On 20.03, it was quite simple to simply pull the proper hash from the failed build log and copy and paste it into the overlay for rust packages.
Notify maintainers @andir