Bug#768746: snapper: FTBFS in jessie: BtrfsUtils.cc:127:27: error: 'btrfs_qgroup_inherit' was not declared in this scope

2014-11-15 Thread Andrey Rahmatullin
Control: reassign -1 btrfs-tools
Control: forcemerge 768694 -1

On Sun, Nov 09, 2014 at 08:15:16AM +0100, Lucas Nussbaum wrote:
  /bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. 
  -I.. -I/usr/include/libxml2  -D_FORTIFY_SOURCE=2 -DCONFDIR='/etc/default' 
  -D_FILE_OFFSET_BITS=64 -g -O2 -fstack-protector-strong -Wformat 
  -Werror=format-security -std=c++0x -Wall -Wextra -Wformat=2 
  -Wnon-virtual-dtor -Wno-unused-parameter -c -o BtrfsUtils.lo BtrfsUtils.cc
  libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include/libxml2 
  -D_FORTIFY_SOURCE=2 -DCONFDIR=\/etc/default\ -D_FILE_OFFSET_BITS=64 -g 
  -O2 -fstack-protector-strong -Wformat -Werror=format-security -std=c++0x 
  -Wall -Wextra -Wformat=2 -Wnon-virtual-dtor -Wno-unused-parameter -c 
  BtrfsUtils.cc  -fPIC -DPIC -o .libs/BtrfsUtils.o
  BtrfsUtils.cc: In function 'void snapper::create_snapshot(int, int, const 
  string, bool, snapper::qgroup_t)':
  BtrfsUtils.cc:127:27: error: 'btrfs_qgroup_inherit' was not declared in 
  this scope
The relevant header is included only with HAVE_LIBBTRFS (which is
apparently wrong because the source can't be compiled without the header)
which is false because libbtrfs.so can't be linked against.

-- 
WBR, wRAR


signature.asc
Description: Digital signature


Bug#768746: snapper: FTBFS in jessie: BtrfsUtils.cc:127:27: error: 'btrfs_qgroup_inherit' was not declared in this scope

2014-11-15 Thread Nicolas Dandrimont
Control: retitle -1 libbtrfs missing headers
Control: found -1 3.17-1
Control: tags -1 + upstream fixed-upstream patch

* Andrey Rahmatullin w...@debian.org [2014-11-15 20:49:10 +0500]:

 Control: reassign -1 btrfs-tools
 Control: forcemerge 768694 -1
 
 On Sun, Nov 09, 2014 at 08:15:16AM +0100, Lucas Nussbaum wrote:
   /bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. 
   -I.. -I/usr/include/libxml2  -D_FORTIFY_SOURCE=2 
   -DCONFDIR='/etc/default' -D_FILE_OFFSET_BITS=64 -g -O2 
   -fstack-protector-strong -Wformat -Werror=format-security -std=c++0x 
   -Wall -Wextra -Wformat=2 -Wnon-virtual-dtor -Wno-unused-parameter -c -o 
   BtrfsUtils.lo BtrfsUtils.cc
   libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include/libxml2 
   -D_FORTIFY_SOURCE=2 -DCONFDIR=\/etc/default\ -D_FILE_OFFSET_BITS=64 -g 
   -O2 -fstack-protector-strong -Wformat -Werror=format-security -std=c++0x 
   -Wall -Wextra -Wformat=2 -Wnon-virtual-dtor -Wno-unused-parameter -c 
   BtrfsUtils.cc  -fPIC -DPIC -o .libs/BtrfsUtils.o
   BtrfsUtils.cc: In function 'void snapper::create_snapshot(int, int, const 
   string, bool, snapper::qgroup_t)':
   BtrfsUtils.cc:127:27: error: 'btrfs_qgroup_inherit' was not declared in 
   this scope
 The relevant header is included only with HAVE_LIBBTRFS (which is
 apparently wrong because the source can't be compiled without the header)
 which is false because libbtrfs.so can't be linked against.

Well, yes, that's a bug in btrfs-tools: libbtrfs stopped exporting some headers
after an upstream refactoring, and can't be linked against anymore.

Cherry-picking the two following patches from the 3.17 branch of btrfsprogs
restores the headers and lets snapper compile properly.

- 
https://github.com/kdave/btrfs-progs/commit/dcf11c371cbcdca78f297fe042095912634a8323.patch
- 
https://github.com/kdave/btrfs-progs/commit/cafacda441120976105d01c07286e843cb7cbb94.patch

Unless the maintainer disagrees, I will upload a NMU (to DELAYED/5) adding
those two patches.

Cheers,
-- 
Nicolas Dandrimont

BOFH excuse #129:
The ring needs another token


signature.asc
Description: Digital signature


Bug#768746: snapper: FTBFS in jessie: BtrfsUtils.cc:127:27: error: 'btrfs_qgroup_inherit' was not declared in this scope

2014-11-15 Thread Nicolas Dandrimont
* Nicolas Dandrimont ol...@debian.org [2014-11-15 17:50:02 +0100]:

 Unless the maintainer disagrees, I will upload a NMU (to DELAYED/5) adding
 those two patches.

Debdiff attached.
-- 
Nicolas Dandrimont

...[Linux's] capacity to talk via any medium except smoke signals.
(By Dr. Greg Wettstein, Roger Maris Cancer Center)
diff -Nru btrfs-tools-3.17/debian/changelog btrfs-tools-3.17/debian/changelog
--- btrfs-tools-3.17/debian/changelog	2014-10-23 23:04:25.0 +0200
+++ btrfs-tools-3.17/debian/changelog	2014-11-15 16:58:09.0 +0100
@@ -1,3 +1,13 @@
+btrfs-tools (3.17-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add 0002-Fix-linking-with-libbtrfs.patch from upstream, to properly
+export all the previously exported API (Closes: #768746)
+  * Add 0003-Make-headers-C++-compatible.patch from upstream, making the
+new headers C++-compatible.
+
+ -- Nicolas Dandrimont ol...@debian.org  Sat, 15 Nov 2014 16:23:26 +0100
+
 btrfs-tools (3.17-1) unstable; urgency=medium
 
   * New upstream release.
diff -Nru btrfs-tools-3.17/debian/patches/0002-Fix-linking-with-libbtrfs.patch btrfs-tools-3.17/debian/patches/0002-Fix-linking-with-libbtrfs.patch
--- btrfs-tools-3.17/debian/patches/0002-Fix-linking-with-libbtrfs.patch	1970-01-01 01:00:00.0 +0100
+++ btrfs-tools-3.17/debian/patches/0002-Fix-linking-with-libbtrfs.patch	2014-11-15 16:23:00.0 +0100
@@ -0,0 +1,36 @@
+From dcf11c371cbcdca78f297fe042095912634a8323 Mon Sep 17 00:00:00 2001
+From: David Sterba dste...@suse.cz
+Date: Thu, 30 Oct 2014 18:33:41 +0100
+Subject: [PATCH] btrfs-progs: fix linking with libbtrfs
+
+Reported at https://github.com/openSUSE/snapper/issues/128
+
+Commit cdb9e22e292275237c added another rbtree file that defines
+functions that libbtrfs uses.
+
+Signed-off-by: David Sterba dste...@suse.cz
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 9c69ada..203597c 100644
+--- a/Makefile
 b/Makefile
+@@ -10,14 +10,14 @@ objects = ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o \
+ 	  root-tree.o dir-item.o file-item.o inode-item.o inode-map.o \
+ 	  extent-cache.o extent_io.o volumes.o utils.o repair.o \
+ 	  qgroup.o raid6.o free-space-cache.o list_sort.o props.o \
+-	  ulist.o qgroup-verify.o backref.o rbtree-utils.o
++	  ulist.o qgroup-verify.o backref.o
+ cmds_objects = cmds-subvolume.o cmds-filesystem.o cmds-device.o cmds-scrub.o \
+ 	   cmds-inspect.o cmds-balance.o cmds-send.o cmds-receive.o \
+ 	   cmds-quota.o cmds-qgroup.o cmds-replace.o cmds-check.o \
+ 	   cmds-restore.o cmds-rescue.o chunk-recover.o super-recover.o \
+ 	   cmds-property.o
+ libbtrfs_objects = send-stream.o send-utils.o rbtree.o btrfs-list.o crc32c.o \
+-		   uuid-tree.o utils-lib.o
++		   uuid-tree.o utils-lib.o rbtree-utils.o
+ libbtrfs_headers = send-stream.h send-utils.h send.h rbtree.h btrfs-list.h \
+ 	   crc32c.h list.h kerncompat.h radix-tree.h extent-cache.h \
+ 	   extent_io.h ioctl.h ctree.h btrfsck.h version.h
diff -Nru btrfs-tools-3.17/debian/patches/0003-Make-headers-C++-compatible.patch btrfs-tools-3.17/debian/patches/0003-Make-headers-C++-compatible.patch
--- btrfs-tools-3.17/debian/patches/0003-Make-headers-C++-compatible.patch	1970-01-01 01:00:00.0 +0100
+++ btrfs-tools-3.17/debian/patches/0003-Make-headers-C++-compatible.patch	2014-11-15 16:57:02.0 +0100
@@ -0,0 +1,96 @@
+From cafacda441120976105d01c07286e843cb7cbb94 Mon Sep 17 00:00:00 2001
+From: David Sterba dste...@suse.cz
+Date: Mon, 3 Nov 2014 23:50:50 +0100
+Subject: [PATCH] btrfs-progs: libbtrfs, make exported headers compatible with
+ C++
+
+Add externs and don't use a reserved keyword.
+
+Signed-off-by: David Sterba dste...@suse.cz
+---
+ rbtree-utils.h |  8 
+ rbtree.h   | 10 +-
+ rbtree_augmented.h |  8 
+ 3 files changed, 25 insertions(+), 1 deletion(-)
+
+diff --git a/rbtree-utils.h b/rbtree-utils.h
+index 7298c72..718581f 100644
+--- a/rbtree-utils.h
 b/rbtree-utils.h
+@@ -21,6 +21,10 @@
+ 
+ #include rbtree.h
+ 
++#ifdef __cplusplus
++extern C {
++#endif
++
+ /* The common insert/search/free functions */
+ typedef int (*rb_compare_nodes)(struct rb_node *node1, struct rb_node *node2);
+ typedef int (*rb_compare_keys)(struct rb_node *node, void *key);
+@@ -42,4 +46,8 @@ static void free_##name##_tree(struct rb_root *root)	\
+ 	rb_free_nodes(root, free_func);			\
+ }
+ 
++#ifdef __cplusplus
++}
++#endif
++
+ #endif
+diff --git a/rbtree.h b/rbtree.h
+index 03c06d8..0d4f2bf 100644
+--- a/rbtree.h
 b/rbtree.h
+@@ -34,6 +34,10 @@
+ #include btrfs/kerncompat.h
+ #endif /* BTRFS_FLAT_INCLUDES */
+ 
++#ifdef __cplusplus
++extern C {
++#endif
++
+ struct rb_node {
+ 	unsigned long  __rb_parent_color;
+ 	struct rb_node *rb_right;
+@@ -75,7 +79,7 @@ extern struct rb_node *rb_first_postorder(const struct rb_root *);
+ extern struct rb_node *rb_next_postorder(const struct rb_node *);
+ 

Bug#768746: snapper: FTBFS in jessie: BtrfsUtils.cc:127:27: error: 'btrfs_qgroup_inherit' was not declared in this scope

2014-11-08 Thread Lucas Nussbaum
Source: snapper
Version: 0.2.4-1
Severity: serious
Tags: jessie sid
User: debian...@lists.debian.org
Usertags: qa-ftbfs-20141108 qa-ftbfs
Justification: FTBFS in jessie on amd64

Hi,

During a rebuild of all packages in jessie (in a jessie chroot, not a
sid chroot), your package failed to build on amd64.

Relevant part (hopefully):
 /bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. 
 -I/usr/include/libxml2  -D_FORTIFY_SOURCE=2 -DCONFDIR='/etc/default' 
 -D_FILE_OFFSET_BITS=64 -g -O2 -fstack-protector-strong -Wformat 
 -Werror=format-security -std=c++0x -Wall -Wextra -Wformat=2 
 -Wnon-virtual-dtor -Wno-unused-parameter -c -o BtrfsUtils.lo BtrfsUtils.cc
 libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include/libxml2 
 -D_FORTIFY_SOURCE=2 -DCONFDIR=\/etc/default\ -D_FILE_OFFSET_BITS=64 -g -O2 
 -fstack-protector-strong -Wformat -Werror=format-security -std=c++0x -Wall 
 -Wextra -Wformat=2 -Wnon-virtual-dtor -Wno-unused-parameter -c BtrfsUtils.cc  
 -fPIC -DPIC -o .libs/BtrfsUtils.o
 BtrfsUtils.cc: In function 'void snapper::create_snapshot(int, int, const 
 string, bool, snapper::qgroup_t)':
 BtrfsUtils.cc:127:27: error: 'btrfs_qgroup_inherit' was not declared in this 
 scope
   size_t size = sizeof(btrfs_qgroup_inherit) + 
 sizeof(((btrfs_qgroup_inherit*) 0)-qgroups[0]);
^
 BtrfsUtils.cc:127:81: error: expected primary-expression before ')' token
   size_t size = sizeof(btrfs_qgroup_inherit) + 
 sizeof(((btrfs_qgroup_inherit*) 0)-qgroups[0]);
   
^
 BtrfsUtils.cc:127:83: error: expected ')' before numeric constant
   size_t size = sizeof(btrfs_qgroup_inherit) + 
 sizeof(((btrfs_qgroup_inherit*) 0)-qgroups[0]);
   
  ^
 BtrfsUtils.cc:127:98: error: expected ')' before ';' token
   size_t size = sizeof(btrfs_qgroup_inherit) + 
 sizeof(((btrfs_qgroup_inherit*) 0)-qgroups[0]);
   
 ^
 BtrfsUtils.cc:129:43: error: invalid type in declaration before '=' token
   struct btrfs_qgroup_inherit* inherit = (btrfs_qgroup_inherit*) 
 buffer[0];
^
 BtrfsUtils.cc:129:67: error: expected primary-expression before ')' token
   struct btrfs_qgroup_inherit* inherit = (btrfs_qgroup_inherit*) 
 buffer[0];
^
 BtrfsUtils.cc:131:15: error: request for member 'num_qgroups' in '* inherit', 
 which is of non-class type 'int'
   inherit-num_qgroups = 1;
^
 BtrfsUtils.cc:132:15: error: request for member 'num_ref_copies' in '* 
 inherit', which is of non-class type 'int'
   inherit-num_ref_copies = 0;
^
 BtrfsUtils.cc:133:15: error: request for member 'num_excl_copies' in '* 
 inherit', which is of non-class type 'int'
   inherit-num_excl_copies = 0;
^
 BtrfsUtils.cc:134:15: error: request for member 'qgroups' in '* inherit', 
 which is of non-class type 'int'
   inherit-qgroups[0] = qgroup;
^
 BtrfsUtils.cc:136:23: error: 'BTRFS_SUBVOL_QGROUP_INHERIT' was not declared 
 in this scope
   args_v2.flags |= BTRFS_SUBVOL_QGROUP_INHERIT;
^
 BtrfsUtils.cc:137:14: error: 'struct btrfs_ioctl_vol_args_v2' has no member 
 named 'size'
   args_v2.size = size;
   ^
 BtrfsUtils.cc:138:14: error: 'struct btrfs_ioctl_vol_args_v2' has no member 
 named 'qgroup_inherit'
   args_v2.qgroup_inherit = inherit;
   ^
 BtrfsUtils.cc: In function 'void snapper::set_default_id(int, long long 
 unsigned int)':
 BtrfsUtils.cc:176:16: error: 'BTRFS_IOC_DEFAULT_SUBVOL' was not declared in 
 this scope
   if (ioctl(fd, BTRFS_IOC_DEFAULT_SUBVOL, id) != 0)
 ^
 BtrfsUtils.cc: In function 'long long unsigned int 
 snapper::get_default_id(int)':
 BtrfsUtils.cc:184:33: error: aggregate 
 'snapper::get_default_id(int)::btrfs_ioctl_search_args args' has incomplete 
 type and cannot be defined
   struct btrfs_ioctl_search_args args;
  ^
 BtrfsUtils.cc:188:4: error: invalid use of incomplete type 'struct 
 snapper::get_default_id(int)::btrfs_ioctl_search_key'
   sk-tree_id = BTRFS_ROOT_TREE_OBJECTID;
 ^
 BtrfsUtils.cc:187:9: error: forward declaration of 'struct 
 snapper::get_default_id(int)::btrfs_ioctl_search_key'
   struct btrfs_ioctl_search_key* sk = args.key;
  ^
 BtrfsUtils.cc:188:16: error: 'BTRFS_ROOT_TREE_OBJECTID' was not declared in 
 this scope
   sk-tree_id = BTRFS_ROOT_TREE_OBJECTID;
 ^
 BtrfsUtils.cc:189:4: error: invalid use of incomplete type 'struct 
 snapper::get_default_id(int)::btrfs_ioctl_search_key'
   sk-nr_items = 1;
 ^
 BtrfsUtils.cc:187:9: error: forward declaration of 'struct