A fork of attic a self-hostable Nix Binary Cache server
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #123 from winterqt/fix-build-on-newer-nix

Fix build on Nix 2.19+

authored by

Zhaofeng Li and committed by
GitHub
4dbdbee4 6eabc3f0

+19 -19
+3
attic/build.rs
··· 24 24 .flag("nix/config.h") 25 25 .flag("-idirafter") 26 26 .flag(hacky_include.path().to_str().unwrap()) 27 + // In Nix 2.19+, nix/args/root.hh depends on being able to #include "root.hh" (which is in its parent directory), for some reason 28 + .flag("-I") 29 + .flag(concat!(env!("NIX_INCLUDE_PATH"), "/nix")) 27 30 .compile("nixbinding"); 28 31 29 32 println!("cargo:rerun-if-changed=src/nix_store/bindings");
+5 -9
crane.nix
··· 62 62 63 63 ATTIC_DISTRIBUTOR = "attic"; 64 64 65 - # Workaround for https://github.com/NixOS/nixpkgs/issues/166205 66 - env = lib.optionalAttrs stdenv.cc.isClang { 67 - NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; 68 - }; 65 + # See comment in `attic/build.rs` 66 + NIX_INCLUDE_PATH = "${lib.getDev nix}/include"; 69 67 70 68 # See comment in `attic-tests` 71 69 doCheck = false; ··· 135 133 136 134 nativeBuildInputs = nativeBuildInputs ++ [ jq ]; 137 135 138 - # Workaround for https://github.com/NixOS/nixpkgs/issues/166205 139 - env = lib.optionalAttrs stdenv.cc.isClang { 140 - NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; 141 - }; 142 - 143 136 doCheck = true; 144 137 145 138 buildPhaseCargoCommand = ""; 146 139 checkPhaseCargoCommand = "cargoWithProfile test --no-run --message-format=json >cargo-test.json"; 147 140 doInstallCargoArtifacts = false; 141 + 142 + # See comment in `attic/build.rs` 143 + NIX_INCLUDE_PATH = "${lib.getDev nix}/include"; 148 144 149 145 installPhase = '' 150 146 runHook preInstall
+6 -6
flake.lock
··· 53 53 }, 54 54 "nixpkgs": { 55 55 "locked": { 56 - "lastModified": 1702539185, 57 - "narHash": "sha256-KnIRG5NMdLIpEkZTnN5zovNYc0hhXjAgv6pfd5Z4c7U=", 56 + "lastModified": 1711401922, 57 + "narHash": "sha256-QoQqXoj8ClGo0sqD/qWKFWezgEwUL0SUh37/vY2jNhc=", 58 58 "owner": "NixOS", 59 59 "repo": "nixpkgs", 60 - "rev": "aa9d4729cbc99dabacb50e3994dcefb3ea0f7447", 60 + "rev": "07262b18b97000d16a4bdb003418bd2fb067a932", 61 61 "type": "github" 62 62 }, 63 63 "original": { ··· 69 69 }, 70 70 "nixpkgs-stable": { 71 71 "locked": { 72 - "lastModified": 1702780907, 73 - "narHash": "sha256-blbrBBXjjZt6OKTcYX1jpe9SRof2P9ZYWPzq22tzXAA=", 72 + "lastModified": 1711460390, 73 + "narHash": "sha256-akSgjDZL6pVHEfSE6sz1DNSXuYX6hq+P/1Z5IoYWs7E=", 74 74 "owner": "NixOS", 75 75 "repo": "nixpkgs", 76 - "rev": "1e2e384c5b7c50dbf8e9c441a9e58d85f408b01f", 76 + "rev": "44733514b72e732bd49f5511bd0203dea9b9a434", 77 77 "type": "github" 78 78 }, 79 79 "original": {
+3
flake.nix
··· 130 130 NIX_PATH = "nixpkgs=${pkgs.path}"; 131 131 RUST_SRC_PATH = "${pkgs.rustPlatform.rustcSrc}/library"; 132 132 133 + # See comment in `attic/build.rs` 134 + NIX_INCLUDE_PATH = "${lib.getDev pkgs.nix}/include"; 135 + 133 136 ATTIC_DISTRIBUTOR = "dev"; 134 137 }; 135 138
+2 -4
package.nix
··· 49 49 50 50 ATTIC_DISTRIBUTOR = "attic"; 51 51 52 - # Workaround for https://github.com/NixOS/nixpkgs/issues/166205 53 - env = lib.optionalAttrs stdenv.cc.isClang { 54 - NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; 55 - }; 52 + # See comment in `attic/build.rs` 53 + NIX_INCLUDE_PATH = "${lib.getDev nix}/include"; 56 54 57 55 # Recursive Nix is not stable yet 58 56 doCheck = false;