diff --git a/pkgs/tools/package-management/nix-doc/default.nix b/pkgs/tools/package-management/nix-doc/default.nix index ba5da3595657..f3983b0cd760 100644 --- a/pkgs/tools/package-management/nix-doc/default.nix +++ b/pkgs/tools/package-management/nix-doc/default.nix @@ -1,14 +1,14 @@ -{ lib, rustPlatform, fetchFromGitHub, boost, nix, pkg-config }: +{ lib, stdenv, rustPlatform, fetchFromGitHub, boost, nix, pkg-config }: rustPlatform.buildRustPackage rec { pname = "nix-doc"; - version = "0.5.9"; + version = "0.5.10"; src = fetchFromGitHub { rev = "v${version}"; owner = "lf-"; repo = "nix-doc"; - sha256 = "sha256-uilVJz1MnMF3i/ZXY0bIoSK3uAzfxWuHfhoOSmQgY/I="; + sha256 = "sha256-+T4Bz26roTFiXTM8P8FnJLSdFY2hP26X4nChWWUACN8="; }; doCheck = true; @@ -16,7 +16,20 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config nix ]; - cargoSha256 = "sha256-02noJcbtml4MxRCjaWtjOWLTUNOQnKy3GCsil31J6F8="; + # Packaging support for making the nix-doc plugin load cleanly as a no-op on + # the wrong Nix version (disabling bindnow permits loading libraries + # requiring unavailable symbols if they are unreached) + hardeningDisable = [ "bindnow" ]; + # Due to a Rust bug, setting -Z relro-level to anything including "off" on + # macOS will cause link errors + env = lib.optionalAttrs stdenv.isLinux { + # nix-doc does not use nightly features, however, there is no other way to + # set relro-level + RUSTC_BOOTSTRAP = 1; + RUSTFLAGS = "-Z relro-level=partial"; + }; + + cargoSha256 = "sha256-GylSWo4LIsjKnJE9H6iJHZ99UI6UPhAOnAGXk+v8bko="; meta = with lib; { description = "An interactive Nix documentation tool";