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

snapper cannot to be built with btrfs-progs v6.1 #762

Closed
henrich opened this issue Jan 1, 2023 · 3 comments
Closed

snapper cannot to be built with btrfs-progs v6.1 #762

henrich opened this issue Jan 1, 2023 · 3 comments
Labels

Comments

@henrich
Copy link
Contributor

henrich commented Jan 1, 2023

Hi,

I've got a bug report for Debian snapper package as Debian Bug#1027628, and I found that it was caused by a change in /usr/include/btrfs/kerncompat.h in btrfs-progs v6.1 as kdave/btrfs-progs@788a71c

/bin/sh ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..  -I/usr/include/libxml2   -Wdate-time -D_FORTIFY_SOURCE=2 -DCONF_DIR='"/etc/default"' -D_FILE_OFFSET_BITS=64 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -std=c++11 -Wall -Wextra -Wformat -Wnon-virtual-dtor -Wno-unused-parameter -Wsuggest-override -c -o libsnapper_la-MntTable.lo `test -f 'MntTable.cc' || echo './'`MntTable.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include/libxml2 -Wdate-time -D_FORTIFY_SOURCE=2 -DCONF_DIR=\"/etc/default\" -D_FILE_OFFSET_BITS=64 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -std=c++11 -Wall -Wextra -Wformat -Wnon-virtual-dtor -Wno-unused-parameter -Wsuggest-override -c MntTable.cc  -fPIC -DPIC -o .libs/libsnapper_la-MntTable.o
In file included from /usr/include/c++/12/bits/regex_compiler.h:571,
                 from /usr/include/c++/12/regex:65,
                 from Btrfs.cc:47:
/usr/include/c++/12/bits/regex_compiler.tcc: In member function ‘bool std::__detail::_Compiler<_TraitsT>::_M_quantifier()’:
/usr/include/c++/12/bits/regex_compiler.tcc:179:19: error: expected unqualified-id before ‘=’ token
  179 |       auto __init = [this, &__neg]()
      |                   ^
/usr/include/c++/12/bits/regex_compiler.tcc:187:18: error: expected primary-expression before ‘)’ token
  187 |           __init();
      |                  ^
/usr/include/c++/12/bits/regex_compiler.tcc:197:18: error: expected primary-expression before ‘)’ token
  197 |           __init();
      |                  ^
/usr/include/c++/12/bits/regex_compiler.tcc:205:18: error: expected primary-expression before ‘)’ token
  205 |           __init();
      |                  ^
make[3]: *** [Makefile:768: libsnapper_la-Btrfs.lo] Error 1

It's because __init was defined in /usr/include/btrfs/kerncompat.h

@aschnell
Copy link
Member

aschnell commented Jan 2, 2023

Looks like a problem of btrfs-progs since names starting with __ are reserved by the implementation (compiler and sandard headers).

@aschnell aschnell added the bug label Jan 2, 2023
@aschnell
Copy link
Member

aschnell commented Jan 2, 2023

As a workaround you can #undef __init in Btrfs.cc after including btrfs/send-utils.h. I will contact the btrfs people anyway.

@aschnell
Copy link
Member

aschnell commented Jan 3, 2023

Should be fixed with btrfs-progs 6.1.1, see https://lore.kernel.org/linux-btrfs/20230103173549.10791-1-dsterba@suse.com/T/#u.

@aschnell aschnell closed this as completed Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants