From 63f64ee8c43062e0ba1972d77aba15674ed2b097 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Tue, 21 Mar 2023 18:45:34 -0600 Subject: [PATCH] Revert bindgenHook workarounds Fixed in https://github.com/NixOS/nixpkgs/pull/215060. This reverts commit 365d739bca45ad699b06582815aea9cc47c5faf1. This reverts commit db443f193238bec1ee80e6987f53852da6656d26. This reverts commit 9869ab4a85d42720ac2d2709ac115dc0b8e0b847. --- crane.nix | 14 +------------- flake.nix | 5 ----- package.nix | 8 +------- 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/crane.nix b/crane.nix index 75c1628..7fd888a 100644 --- a/crane.nix +++ b/crane.nix @@ -8,7 +8,6 @@ { stdenv , lib , craneLib -, llvmPackages , rustPlatform , runCommand , writeReferencesToFile @@ -33,6 +32,7 @@ let }; nativeBuildInputs = [ + rustPlatform.bindgenHook pkg-config installShellFiles ]; @@ -68,12 +68,6 @@ let cargoExtraArgs = "-p attic-client -p attic-server"; - # Temporary workaround for https://github.com/NixOS/nixpkgs/pull/207352#issuecomment-1418363441 - preBuild = '' - export LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib" - export BINDGEN_EXTRA_CLANG_ARGS="$(< ${llvmPackages.clang}/nix-support/cc-cflags) $(< ${llvmPackages.clang}/nix-support/libc-cflags) $(< ${llvmPackages.clang}/nix-support/libcxx-cxxflags) $NIX_CFLAGS_COMPILE" - ''; - postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' if [[ -f $out/bin/attic ]]; then installShellCompletion --cmd attic \ @@ -135,12 +129,6 @@ let doCheck = true; - # Temporary workaround for https://github.com/NixOS/nixpkgs/pull/207352#issuecomment-1418363441 - preBuild = '' - export LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib" - export BINDGEN_EXTRA_CLANG_ARGS="$(< ${llvmPackages.clang}/nix-support/cc-cflags) $(< ${llvmPackages.clang}/nix-support/libc-cflags) $(< ${llvmPackages.clang}/nix-support/libcxx-cxxflags) $NIX_CFLAGS_COMPILE" - ''; - buildPhaseCargoCommand = ""; checkPhaseCargoCommand = "cargoWithProfile test --no-run --message-format=json >cargo-test.json"; doInstallCargoArtifacts = false; diff --git a/flake.nix b/flake.nix index afcb397..d27d2bc 100644 --- a/flake.nix +++ b/flake.nix @@ -117,11 +117,6 @@ RUST_SRC_PATH = "${pkgs.rustPlatform.rustcSrc}/library"; ATTIC_DISTRIBUTOR = "dev"; - - shellHook = '' - export LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib" - export BINDGEN_EXTRA_CLANG_ARGS="$(< ${pkgs.llvmPackages.clang}/nix-support/cc-cflags) $(< ${pkgs.llvmPackages.clang}/nix-support/libc-cflags) $(< ${pkgs.llvmPackages.clang}/nix-support/libcxx-cxxflags) $NIX_CFLAGS_COMPILE" - ''; }; demo = pkgs.mkShell { diff --git a/package.nix b/package.nix index 2303449..bc3c53f 100644 --- a/package.nix +++ b/package.nix @@ -7,7 +7,6 @@ { lib, stdenv, rustPlatform , pkg-config , installShellFiles -, llvmPackages , nix , boost , darwin @@ -32,6 +31,7 @@ in rustPlatform.buildRustPackage rec { }; nativeBuildInputs = [ + rustPlatform.bindgenHook pkg-config installShellFiles ]; @@ -50,12 +50,6 @@ in rustPlatform.buildRustPackage rec { ATTIC_DISTRIBUTOR = "attic"; - # Temporary workaround for https://github.com/NixOS/nixpkgs/pull/207352#issuecomment-1418363441 - preBuild = '' - export LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib" - export BINDGEN_EXTRA_CLANG_ARGS="$(< ${llvmPackages.clang}/nix-support/cc-cflags) $(< ${llvmPackages.clang}/nix-support/libc-cflags) $(< ${llvmPackages.clang}/nix-support/libcxx-cxxflags) $NIX_CFLAGS_COMPILE" - ''; - # Recursive Nix is not stable yet doCheck = false;