Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 938025 - sys-fs/compsize-1.5: fails to compile with >=sys-fs/btrfs-progs-6.10.1 (compsize.c: error: GFP_KERNEL undeclared (first use in this function))
Summary: sys-fs/compsize-1.5: fails to compile with >=sys-fs/btrfs-progs-6.10.1 (comps...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: PullRequest
: 939505 939834 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-08-16 21:19 UTC by Toralf Förster
Modified: 2024-11-23 09:52 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,19.19 KB, text/plain)
2024-08-16 21:19 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,211.56 KB, text/plain)
2024-08-16 21:19 UTC, Toralf Förster
Details
environment (environment,78.54 KB, text/plain)
2024-08-16 21:19 UTC, Toralf Förster
Details
etc.clang.tar.xz (etc.clang.tar.xz,1.20 KB, application/x-xz)
2024-08-16 21:19 UTC, Toralf Förster
Details
etc.portage.tar.xz (etc.portage.tar.xz,46.21 KB, application/x-xz)
2024-08-16 21:19 UTC, Toralf Förster
Details
qlist-info.txt.xz (qlist-info.txt.xz,55.58 KB, application/x-xz)
2024-08-16 21:19 UTC, Toralf Förster
Details
sys-fs:compsize-1.5:20240816-180323.log (sys-fs:compsize-1.5:20240816-180323.log,6.86 KB, text/plain)
2024-08-16 21:19 UTC, Toralf Förster
Details
temp.tar.xz (temp.tar.xz,18.53 KB, application/x-xz)
2024-08-16 21:19 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2024-08-16 21:19:06 UTC
  163 |     if (!IS_ALIGNED(disk_bytenr, 1 << 12))
      |          ^~~~~~~~~~
compsize.c:167:5: error: 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);
      |                        ^~~~~~~~~~

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 23.0-20240812-185503

  UNMASKED:
    Requested by sam
  >=sys-libs/ncurses-6.5

  The attached etc.portage.tar.xz has all details.
  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-14 *
clang/llvm (if any):
clang version 18.1.8
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/18/bin
Configuration file: /etc/clang/x86_64-pc-linux-gnu-clang.cfg
/usr/lib/llvm/18
18.1.8
Python 3.12.5
Available Ruby profiles:
  [1]   ruby31 (with Rubygems)
  [2]   ruby32 (with Rubygems)
  [3]   ruby33 (with Rubygems) *
Available Rust versions:
  [1]   rust-bin-1.80.1 *
The following VMs are available for generation-2:
1)	Eclipse Temurin JDK 11.0.24_p8 [openjdk-bin-11]
2)	Eclipse Temurin JDK 17.0.12_p7 [openjdk-bin-17]
*)	Eclipse Temurin JDK 21.0.4_p7 [openjdk-bin-21]
4)	Eclipse Temurin JDK 8.422_p05 [openjdk-bin-8]
Available Java Virtual Machines:
  [1]   openjdk-bin-8 
  [2]   openjdk-bin-11 
  [3]   openjdk-bin-17 
  [4]   openjdk-bin-21  system-vm

The Glorious Glasgow Haskell Compilation System, version 9.2.8
php cli (if any):
  [1]   php8.2
  [2]   php8.3 *
go version go1.23.0 linux/amd64

  HEAD of ::gentoo
commit 39b289d5f60e3aa93c44fd15e8b4339f2406a9f2
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Fri Aug 16 17:18:59 2024 +0000

    2024-08-16 17:18:59 UTC

emerge -qpvO =sys-fs/compsize-1.5
[ebuild  N    ] sys-fs/compsize-1.5  USE="-debug"
Comment 1 Toralf Förster gentoo-dev 2024-08-16 21:19:07 UTC
Created attachment 900326 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2024-08-16 21:19:08 UTC
Created attachment 900327 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2024-08-16 21:19:09 UTC
Created attachment 900328 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2024-08-16 21:19:10 UTC
Created attachment 900329 [details]
etc.clang.tar.xz
Comment 5 Toralf Förster gentoo-dev 2024-08-16 21:19:11 UTC
Created attachment 900330 [details]
etc.portage.tar.xz
Comment 6 Toralf Förster gentoo-dev 2024-08-16 21:19:12 UTC
Created attachment 900331 [details]
qlist-info.txt.xz
Comment 7 Toralf Förster gentoo-dev 2024-08-16 21:19:13 UTC
Created attachment 900332 [details]
sys-fs:compsize-1.5:20240816-180323.log
Comment 8 Toralf Förster gentoo-dev 2024-08-16 21:19:14 UTC
Created attachment 900333 [details]
temp.tar.xz
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-11 03:04:38 UTC
We should probably take a snapshot at least (I don't think it'll fix this though).

We want at least:
* https://github.com/kilobyte/compsize/commit/9f02a12c377e5ac12544b0d07d73eb7c352a4787
* https://github.com/kilobyte/compsize/commit/a7bf82296193f785757f0cb30627dce30462f085
* https://github.com/kilobyte/compsize/commit/4288964fd32dc5a00c7162e5ab9920039e5a5e14

But I haven't looked at what commit(s) in btrfs-progs broke this (per upstream bug).
Comment 10 Oskari Pirhonen 2024-09-11 03:18:51 UTC
These two commits, at least, are mentioned by NixOS folks:

- https://github.com/kdave/btrfs-progs/commit/2830e841359e456ab14e48aabaedab8a2276e484
- https://github.com/kdave/btrfs-progs/commit/2f297355c9b1c451c3ad2bfd07a368ef69b9b8d7

They remove a bunch of junk which approximates kernel internals using libc equivalents.
Comment 11 Oskari Pirhonen 2024-09-11 03:39:29 UTC
In radix-tree.h in compsize, there's the following bit:

    #if BTRFS_FLAT_INCLUDES
    #include "kerncompat.h"
    #else
    #include <btrfs/kerncompat.h>
    #endif /* BTRFS_FLAT_INCLUDES */

Their bundled kerncompat.h includes definitions for stuff like gfp_t which were removed from btrfs-progs kerncompat.h.
Comment 12 Oskari Pirhonen 2024-09-11 03:52:33 UTC
This is actually a problematic flag because defining it for compsize has implications when it comes to libbtrfs. From libbtrfs/ctree.h as an example:

    #if BTRFS_FLAT_INCLUDES
    #include "libbtrfs/kerncompat.h"
    #include "kernel-lib/rbtree_types.h"
    #include "libbtrfs/ioctl.h"
    #else
    #include <btrfs/kerncompat.h>
    #include <btrfs/rbtree_types.h>
    #include <btrfs/ioctl.h>
    #endif /* BTRFS_FLAT_INCLUDES */

https://github.com/kdave/btrfs-progs/blob/c75b2f2c77c9fdace08a57fe4515b45a4616fa21/libbtrfs/ctree.h#L24
Comment 13 Oskari Pirhonen 2024-09-11 04:08:50 UTC
Taking a closer look at what compsize has, their radix-tree.c and radix-tree.h appear to be 7 year old copies of btrfs-progs sources...
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-13 01:39:25 UTC
*** Bug 939505 has been marked as a duplicate of this bug. ***
Comment 15 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-19 07:02:32 UTC
*** Bug 939834 has been marked as a duplicate of this bug. ***
Comment 16 Larry the Git Cow gentoo-dev 2024-11-23 09:52:49 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f0aa3f52546b99ab498a0233dd323e73f82559c0

commit f0aa3f52546b99ab498a0233dd323e73f82559c0
Author:     David Roman <davidroman96@gmail.com>
AuthorDate: 2024-11-21 21:43:04 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-11-23 09:51:22 +0000

    sys-fs/compsize: fix build with btrfs-progs >= 6.10.1
    
    Closes: https://bugs.gentoo.org/938025
    Signed-off-by: David Roman <davidroman96@gmail.com>
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-fs/compsize/compsize-1.5.ebuild                |  2 ++
 .../compsize/files/compsize-1.5-btrfs-progs.patch  | 35 ++++++++++++++++++++++
 2 files changed, 37 insertions(+)