nix-doc: 0.5.9 -> 0.5.10

Fixes https://github.com/NixOS/nixpkgs/issues/237637 and its entire
class of problems by making nix-doc save the version it was built for in
the library and then bail harmlessly if it is mismatched.

```
dev/nixpkgs2 » nix-build -A nix-doc
/nix/store/wv9nm47lplyz4b0pa4549zwrnsp3zvaf-nix-doc-0.5.10
dev/nixpkgs2 » nix-build -A nixVersions.nix_2_14 -o result2
/nix/store/ka0ygdzl9jd0j77y7ls6shngdz9vvqpn-nix-2.14.1
dev/nixpkgs2 » ./result2/bin/nix --plugin-files ./result/lib/libnix_doc_plugin.so repl
nix-doc warning: mismatched nix version, not loading
Welcome to Nix 2.14.1. Type :? for help.

nix-repl>
```

authored by Jade Lovelace and committed by zowoq 2501addf 156e0714

+17 -4
+17 -4
pkgs/tools/package-management/nix-doc/default.nix
··· 1 - { lib, rustPlatform, fetchFromGitHub, boost, nix, pkg-config }: 1 + { lib, stdenv, rustPlatform, fetchFromGitHub, boost, nix, pkg-config }: 2 2 3 3 rustPlatform.buildRustPackage rec { 4 4 pname = "nix-doc"; 5 - version = "0.5.9"; 5 + version = "0.5.10"; 6 6 7 7 src = fetchFromGitHub { 8 8 rev = "v${version}"; 9 9 owner = "lf-"; 10 10 repo = "nix-doc"; 11 - sha256 = "sha256-uilVJz1MnMF3i/ZXY0bIoSK3uAzfxWuHfhoOSmQgY/I="; 11 + sha256 = "sha256-+T4Bz26roTFiXTM8P8FnJLSdFY2hP26X4nChWWUACN8="; 12 12 }; 13 13 14 14 doCheck = true; ··· 16 16 17 17 nativeBuildInputs = [ pkg-config nix ]; 18 18 19 - cargoSha256 = "sha256-02noJcbtml4MxRCjaWtjOWLTUNOQnKy3GCsil31J6F8="; 19 + # Packaging support for making the nix-doc plugin load cleanly as a no-op on 20 + # the wrong Nix version (disabling bindnow permits loading libraries 21 + # requiring unavailable symbols if they are unreached) 22 + hardeningDisable = [ "bindnow" ]; 23 + # Due to a Rust bug, setting -Z relro-level to anything including "off" on 24 + # macOS will cause link errors 25 + env = lib.optionalAttrs stdenv.isLinux { 26 + # nix-doc does not use nightly features, however, there is no other way to 27 + # set relro-level 28 + RUSTC_BOOTSTRAP = 1; 29 + RUSTFLAGS = "-Z relro-level=partial"; 30 + }; 31 + 32 + cargoSha256 = "sha256-GylSWo4LIsjKnJE9H6iJHZ99UI6UPhAOnAGXk+v8bko="; 20 33 21 34 meta = with lib; { 22 35 description = "An interactive Nix documentation tool";