Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure: compsize #336006

Closed
Schweber opened this issue Aug 20, 2024 · 4 comments · Fixed by #338194
Closed

Build failure: compsize #336006

Schweber opened this issue Aug 20, 2024 · 4 comments · Fixed by #338194
Labels
0.kind: build failure A package fails to build

Comments

@Schweber
Copy link
Contributor

Steps To Reproduce

Steps to reproduce the behavior:

  1. build compsize

Build log

$ nix log /nix/store/j7v8qgzdwy77zyb1hbd536f1vnaplpfd-compsize-1.5.drv                                                                 
warning: The interpretation of store paths arguments ending in `.drv` recently changed. If this command is now failing try again with '/nix/store/j7v8qgzdwy77zyb1hbd536f1vnaplpfd-compsize-1.5.drv^*'
Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/m9h1pvqq543xm7c40x1sf097wkbca0df-source
source root is source
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
no configure script, doing nothing
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
build flags: SHELL=/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash
gcc -Wall -std=gnu90  -c -o compsize.o compsize.c
In file included from compsize.c:17:
radix-tree.h:51:9: error: unknown type name 'gfp_t'
   51 |         gfp_t                   gfp_mask;
      |         ^~~~~
radix-tree.h:78:24: error: unknown type name 'gfp_t'
   78 | int radix_tree_preload(gfp_t gfp_mask);
      |                        ^~~~~
radix-tree.h: In function 'radix_tree_preload_end':
radix-tree.h:94:9: warning: implicit declaration of function 'preempt_enable' [-Wimplicit-function-declaration]
   94 |         preempt_enable();
      |         ^~~~~~~~~~~~~~
compsize.c: In function 'parse_file_extent_item':
compsize.c:163:10: warning: implicit declaration of function 'IS_ALIGNED' [-Wimplicit-function-declaration]
  163 |     if (!IS_ALIGNED(disk_bytenr, 1 << 12))
      |          ^~~~~~~~~~
compsize.c:167:5: warning: implicit declaration of function 'radix_tree_preload'; did you mean 'radix_tree_preload_end'? [-Wimplicit-function-declaration]
  167 |     radix_tree_preload(GFP_KERNEL);
      |     ^~~~~~~~~~~~~~~~~~
      |     radix_tree_preload_end
compsize.c:167:24: error: 'GFP_KERNEL' undeclared (first use in this function); did you mean 'SI_KERNEL'?
  167 |     radix_tree_preload(GFP_KERNEL);
      |                        ^~~~~~~~~~
      |                        SI_KERNEL
compsize.c:167:24: note: each undeclared identifier is reported only once for each function it appears in
compsize.c: In function 'do_file':
compsize.c:194:13: error: 'errno' undeclared (first use in this function)
  194 |         if (errno == ENOTTY)
      |             ^~~~~
compsize.c:19:1: note: 'errno' is defined in header '<errno.h>'; did you forget to '#include <errno.h>'?
   18 | #include "endianness.h"
  +++ |+#include <errno.h>
   19 |
compsize.c:194:22: error: 'ENOTTY' undeclared (first use in this function); did you mean 'N_TTY'?
  194 |         if (errno == ENOTTY)
      |                      ^~~~~~
      |                      N_TTY
compsize.c: In function 'do_recursive_search':
compsize.c:246:17: error: 'errno' undeclared (first use in this function)
  246 |             if (errno == ELOOP    // symlink
      |                 ^~~~~
compsize.c:246:17: note: 'errno' is defined in header '<errno.h>'; did you forget to '#include <errno.h>'?
compsize.c:246:26: error: 'ELOOP' undeclared (first use in this function)
  246 |             if (errno == ELOOP    // symlink
      |                          ^~~~~
compsize.c:247:26: error: 'ENXIO' undeclared (first use in this function)
  247 |              || errno == ENXIO    // some device nodes
      |                          ^~~~~
compsize.c:248:26: error: 'ENODEV' undeclared (first use in this function); did you mean 'NODEV'?
  248 |              || errno == ENODEV   // /dev/ptmx
      |                          ^~~~~~
      |                          NODEV
compsize.c:249:26: error: 'ENOMEDIUM' undeclared (first use in this function)
  249 |              || errno == ENOMEDIUM// more device nodes
      |                          ^~~~~~~~~
compsize.c:250:26: error: 'ENOENT' undeclared (first use in this function)
  250 |              || errno == ENOENT)  // something just deleted
      |                          ^~~~~~
compsize.c:252:31: error: 'EACCES' undeclared (first use in this function)
  252 |             else if (errno == EACCES)
      |                               ^~~~~~
compsize.c:275:26: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
  275 |             path_size += strlen(path) + NAME_MAX;
      |                          ^~~~~~
compsize.c:19:1: note: include '<string.h>' or provide a declaration of 'strlen'
   18 | #include "endianness.h"
  +++ |+#include <string.h>
   19 |
compsize.c:275:26: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
  275 |             path_size += strlen(path) + NAME_MAX;
      |                          ^~~~~~
compsize.c:275:26: note: include '<string.h>' or provide a declaration of 'strlen'
compsize.c:290:26: warning: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
  290 |                     if (!strcmp(de->d_name, "."))

Additional context

Add any other context about the problem here.

Notify maintainers

@trofi @CrazedProgrammer

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.10.4, NixOS, 24.11 (Vicuna), 24.11.20240814.c3aa7b8`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - channels(root): `"nixos"`
 - nixpkgs: `/nix/store/sfycwi72zfjsspidinx56ajaiffpyh17-source`

Add a 👍 reaction to issues you find important.

@Schweber Schweber added the 0.kind: build failure A package fails to build label Aug 20, 2024
@ghpzin
Copy link
Contributor

ghpzin commented Aug 20, 2024

The reason is update btrfs-progs: 6.10 -> 6.10.1 #334951
git revert 18fb00789bea6d59828614989880782311b0245b
makes it build again on current master

Something there breaks it:
kdave/btrfs-progs@v6.10...v6.10.1

Seems like quite a few things that compsize used got removed:

#define gfp_t int
#define GFP_KERNEL 0

#include <errno.h>
#include <string.h>

@peterhoeg
Copy link
Member

Here's a quick workaround:

diff --git a/pkgs/os-specific/linux/compsize/default.nix b/pkgs/os-specific/linux/compsize/default.nix
index 441108b0e54f..8132181511ff 100644
--- a/pkgs/os-specific/linux/compsize/default.nix
+++ b/pkgs/os-specific/linux/compsize/default.nix
@@ -1,5 +1,16 @@
-{ lib, stdenv, fetchFromGitHub, btrfs-progs }:
+{ lib, stdenv, fetchFromGitHub, fetchurl, btrfs-progs }:
 
+let
+  btrfs-progs' = btrfs-progs.overrideAttrs (old: rec {
+    pname = "btrfs-progs";
+    version = "6.10";
+    src = fetchurl {
+      url = "mirror://kernel/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v${version}.tar.xz";
+      hash = "sha256-M4KoTj/P4f/eoHphqz9OhmZdOPo18fNFSNXfhnQj4N8=";
+    };
+  });
+
+in
 stdenv.mkDerivation rec {
   pname = "compsize";
   version = "1.5";
@@ -11,7 +22,7 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-OX41ChtHX36lVRL7O2gH21Dfw6GPPEClD+yafR/PFm8=";
   };
 
-  buildInputs = [ btrfs-progs ];
+  buildInputs = [ btrfs-progs' ];
 
   installFlags = [
     "PREFIX=${placeholder "out"}"

@SaltyKitkat
Copy link
Contributor

SaltyKitkat commented Aug 23, 2024

The reason is update btrfs-progs: 6.10 -> 6.10.1 #334951 git revert 18fb00789bea6d59828614989880782311b0245b makes it build again on current master

Something there breaks it: kdave/btrfs-progs@v6.10...v6.10.1

Seems like quite a few things that compsize used got removed:

#define gfp_t int
#define GFP_KERNEL 0

#include <errno.h>
#include <string.h>

Seems due to this commit: kdave/btrfs-progs@2830e84
and this: kdave/btrfs-progs@2f29735

@sliedes
Copy link

sliedes commented Aug 23, 2024

Here's the corresponding compsize upstream bug: kilobyte/compsize#52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: build failure A package fails to build
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants