symphorien / nix-du

Visualise which gc-roots to delete to free some space in your nix store
GNU Lesser General Public License v3.0
371 stars 5 forks source link

Build fails with nix 2.7.0: error: 'class nix::Store' has no member named 'findRoots' #10

Closed andersk closed 2 years ago

andersk commented 2 years ago
building '/nix/store/27cvvxf7fb8kx8fp3p3dd0xdhhjb2vdg-nix-du-0.4.1.drv'...
unpacking sources
unpacking source archive /nix/store/dv67k0qa8y10hcjgk5ndp56mg2jmsmzw-source
source root is source
Executing cargoSetupPostUnpackHook
unpacking source archive /nix/store/rxnfwfxrmljwizn2zs3lg15lzxpdg0h6-nix-du-0.4.1-vendor.tar.gz
Finished cargoSetupPostUnpackHook
patching sources
Executing cargoSetupPostPatchHook
Validating consistency between /build/source//Cargo.lock and /build/nix-du-0.4.1-vendor.tar.gz/Cargo.lock
Finished cargoSetupPostPatchHook
configuring
building
Executing cargoBuildHook
++ env CC_x86_64-unknown-linux-gnu=/nix/store/pja9g36cy32z3d51942jqk91a6l2d5nv-gcc-wrapper-10.3.0/bin/cc CXX_x86_64-unknown-linux-gnu=/nix/store/pja9g36cy32z3d51942jqk91a6l2d5nv-gcc-wrapper-10.3.0/bin/c++ CC_x86_64-unknown-linux-gnu=/nix/store/pja9g36cy32z3d51942jqk91a6l2d5nv-gcc-wrapper-10.3.0/bin/cc CXX_x86_64-unknown-linux-gnu=/nix/store/pja9g36cy32z3d51942jqk91a6l2d5nv-gcc-wrapper-10.3.0/bin/c++ cargo build -j 12 --target x86_64-unknown-linux-gnu --frozen --release
   Compiling libc v0.2.106
   Compiling proc-macro2 v1.0.32
   Compiling autocfg v1.0.1
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.81
   Compiling cfg-if v1.0.0
   Compiling ppv-lite86 v0.2.15
   Compiling serde v1.0.130
   Compiling siphasher v0.3.7
   Compiling proc-macro-hack v0.5.19
   Compiling palette v0.6.0
   Compiling memchr v2.4.1
   Compiling pkg-config v0.3.22
   Compiling cc v1.0.71
   Compiling unicode-width v0.1.9
   Compiling hashbrown v0.11.2
   Compiling ansi_term v0.11.0
   Compiling same-file v1.0.6
   Compiling vec_map v0.8.2
   Compiling strsim v0.8.0
   Compiling bitflags v1.3.2
   Compiling fixedbitset v0.4.0
   Compiling human-size v0.4.1
   Compiling humansize v1.1.1
   Compiling phf_shared v0.9.0
   Compiling walkdir v2.3.2
   Compiling num-traits v0.2.14
   Compiling indexmap v1.7.0
   Compiling quote v1.0.10
   Compiling petgraph v0.6.0
   Compiling term_size v0.3.2
   Compiling atty v0.2.14
   Compiling getrandom v0.2.3
   Compiling textwrap v0.11.0
   Compiling nix-du v0.4.1 (/build/source)
   Compiling rand_core v0.6.3
   Compiling clap v2.33.3
   Compiling approx v0.5.0
   Compiling rand_chacha v0.3.1
   Compiling rand v0.8.4
   Compiling phf_generator v0.9.1
   Compiling toml v0.5.8
The following warnings were emitted during compilation:

warning: wrapper.cpp: In lambda function:
warning: wrapper.cpp:22:33: error: 'class nix::Store' has no member named 'findRoots'
warning:    22 | #define findroots(store) store->findRoots(false)
warning:       |                                 ^~~~~~~~~
warning: wrapper.cpp:22:33: note: in definition of macro 'findroots'
warning:    22 | #define findroots(store) store->findRoots(false)
warning:       |                                 ^~~~~~~~~

error: failed to run custom build command for `nix-du v0.4.1 (/build/source)`

Caused by:
  process didn't exit successfully: `/build/source/target/release/build/nix-du-9210a97b5999c27d/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=wrapper.hpp
  cargo:rerun-if-changed=wrapper.cpp
  cargo:rerun-if-env-changed=NIX_MAIN_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=NIX_MAIN_STATIC
  cargo:rerun-if-env-changed=NIX_MAIN_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=SYSROOT
  cargo:rerun-if-env-changed=NIX_MAIN_STATIC
  cargo:rerun-if-env-changed=NIX_MAIN_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rustc-link-search=native=/nix/store/7c4cp4pj389j8rmrc40x5sq6csf0m8ks-nix-2.7.0/lib
  cargo:rustc-link-lib=nixmain
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=NIX_MAIN_STATIC
  cargo:rerun-if-env-changed=NIX_MAIN_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  Found nix version 2.7.0
  TARGET = Some("x86_64-unknown-linux-gnu")
  HOST = Some("x86_64-unknown-linux-gnu")
  CXX_x86_64-unknown-linux-gnu = Some("/nix/store/pja9g36cy32z3d51942jqk91a6l2d5nv-gcc-wrapper-10.3.0/bin/c++")
  CXXFLAGS_x86_64-unknown-linux-gnu = None
  CXXFLAGS_x86_64_unknown_linux_gnu = None
  HOST_CXXFLAGS = None
  CXXFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  running: "/nix/store/pja9g36cy32z3d51942jqk91a6l2d5nv-gcc-wrapper-10.3.0/bin/c++" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-Wall" "-Wextra" "-std=c++17" "-DNIXVER=204" "-o" "/build/source/target/x86_64-unknown-linux-gnu/release/build/nix-du-c9e691f13c378539/out/wrapper.o" "-c" "wrapper.cpp"
  cargo:warning=wrapper.cpp: In lambda function:
  cargo:warning=wrapper.cpp:22:33: error: 'class nix::Store' has no member named 'findRoots'
  cargo:warning=   22 | #define findroots(store) store->findRoots(false)
  cargo:warning=      |                                 ^~~~~~~~~
  cargo:warning=wrapper.cpp:22:33: note: in definition of macro 'findroots'
  cargo:warning=   22 | #define findroots(store) store->findRoots(false)
  cargo:warning=      |                                 ^~~~~~~~~
  exit status: 1

  --- stderr

  error occurred: Command "/nix/store/pja9g36cy32z3d51942jqk91a6l2d5nv-gcc-wrapper-10.3.0/bin/c++" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-Wall" "-Wextra" "-std=c++17" "-DNIXVER=204" "-o" "/build/source/target/x86_64-unknown-linux-gnu/release/build/nix-du-c9e691f13c378539/out/wrapper.o" "-c" "wrapper.cpp" with args "c++" did not execute successfully (status code exit status: 1).
symphorien commented 2 years ago

fixed in #11, can you test?

austinbutler commented 2 years ago

Builds and runs with the following nixpkgs diff:

diff --git a/pkgs/tools/package-management/nix-du/default.nix b/pkgs/tools/package-management/nix-du/default.nix
index e0f2a192c23..1652813bd24 100644
--- a/pkgs/tools/package-management/nix-du/default.nix
+++ b/pkgs/tools/package-management/nix-du/default.nix
@@ -17,11 +17,11 @@ rustPlatform.buildRustPackage rec {
   src = fetchFromGitHub {
     owner = "symphorien";
     repo = "nix-du";
-    rev = "v${version}";
-    sha256 = "0v6hixj81aa6g3sddny46i0yqaaqv6krp5xadj0xz1g77cb8xy2w";
+    rev = "d334e5a559c7aacdd82787753a79d9d5eb149b5e";
+    sha256 = "sha256-wwrXOh7I+x1X1LiIzTicSTtxTJaqGYY7aXxmgHYQpzM=";
   };

-  cargoSha256 = "11jaks6adsvrvxlqqw3glvn4ff7xh9j35ayfrl89rb4achvqp7xn";
+  cargoSha256 = "sha256-bE6IVSDDCe5XLF5kNrl22055wK2RIZf9uh2gXyX066w=";

   doCheck = true;
   checkInputs = [ nix graphviz ];
@@ -32,7 +32,7 @@ rustPlatform.buildRustPackage rec {
     nlohmann_json
   ] ++ lib.optionals stdenv.isDarwin [ Security ];

-  nativeBuildInputs = [ pkg-config ];
+  nativeBuildInputs = [ pkg-config rustPlatform.bindgenHook ];

   meta = with lib; {
     description = "A tool to determine which gc-roots take space in your nix store";
symphorien commented 2 years ago

Thanks, I'll tag a new release.