Zygo / bees

Best-Effort Extent-Same, a btrfs dedupe agent
GNU General Public License v3.0
647 stars 55 forks source link

Issue trying to build latest source #160

Closed ubenmackin closed 3 years ago

ubenmackin commented 3 years ago

I was trying to build on the latest source (just did a git clone today), but get the following error during a make:

bees.cc: In function ‘std::ostream& operator<<(std::ostream&, const siginfo_t&)’:
bees.cc:636:26: error: ‘const struct siginfo_t’ has no member named ‘si_addr_lsb’
   << "addr_lsb = " << si.si_addr_lsb << ", "

Some info about my environment:

[kupan787@nas bees]# btrfs --version
btrfs-progs v5.9 
[kupan787@nas bees]# uname -a
Linux rocknas 5.10.2-1.el7.elrepo.x86_64 #1 SMP Sun Dec 20 09:53:23 EST 2020 x86_64 x86_64 x86_64 GNU/Linux
[kupan787@nas bees]# gcc --version
gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
kakra commented 3 years ago

This could be outdated kernel headers that come in an extra package. Bees doesn't use the headers from /usr/src/linux. Or glibc, maybe...

ubenmackin commented 3 years ago

@kakra What would be the best way to check, or update them or have bees use the correct ones?

I looked at what was installed, and I've got:

kernel-ml-headers-5.10.2-1.el7.elrepo.x86_64

So I am pretty sure it is the latest ones.

I checked /usr/src/linux, and I don't have such a folder. I have:

/usr/src/kernels/5.10.2-1.el7.elrepo.x86_64

But you mention those aren't used.

I know I was able to build the previous version from back in September or October. Could it be an issue that I have to new of a kernel?

kakra commented 3 years ago

Headers should be in /usr/include/linux

It compiles for me with kernel headers 5.4, gcc 10 and glibc 2.32. The struct should be in sys/siginfo.h but I don't have this file, I have asm/siginfo.h which you usually do not include directly. So maybe that's another namespace issue or glibc has changed?

ubenmackin commented 3 years ago

Headers should be in /usr/include/linux

It compiles for me with kernel headers 5.4, gcc 10 and glibc 2.32. The struct should be in sys/siginfo.h but I don't have this file, I have asm/siginfo.h which you usually do not include directly. So maybe that's another namespace issue or glibc has changed?

So seeing as I am on 5.10, maybe it has changed since 5.4?

Zygo commented 3 years ago

This is an excellent use case for feature tests in the build system... [waves at @kakra ;)]

We can just delete the offending line. It's a throwaway debug message anyway.

Zygo commented 3 years ago

@ubenmackin Let me know if it builds for you with that line deleted. If it does, I'll push a fix to close this issue.

ubenmackin commented 3 years ago

@Zygo Yup, commenting out that line allows it to build for me. I then did a make install, and started up the systemd service, and it seems to be running fine.