Closed vlrpl closed 1 year ago
If I understand this correctly, this is a fixup for the /usr/include/x86_64-linux-gnu
header path, which is used to look for errno.h
.
If the path doesn't exist (e.g. on Fedora), then do we use the right errno.h
file?
If I understand this correctly, this is a fixup for the
/usr/include/x86_64-linux-gnu
header path, which is used to look forerrno.h
.If the path doesn't exist (e.g. on Fedora), then do we use the right
errno.h
file?
Yes, the problem is that directory. AFAICT, the problem is that for debian system that include path is needed as <asm/errno.h> fails to be included otherwise:
stderr=
In file included from src/core/probe/user/bpf/usdt.bpf.c:3:
In file included from /tmp/.tmpOVQRLT/bpf/src/bpf/usdt.bpf.h:6:
/usr/include/linux/errno.h:1:10: fatal error: 'asm/errno.h' file not found
#include <asm/errno.h>
^~~~~~~~~~~~~
1 error generated.
on my Fedora <asm/errno.h> is under /usr/include, so we should still get it from the standard include paths.
Maybe the comment on this one is a bit misleading (for me), it says Taking errno.h from libc instead of linux headers
.
IMHO your commit makes sense, as we can have different paths on different distributions. But I'd just like to check the original change adding this path is working as expected. @amorenoz could you check?
Maybe the comment on this one is a bit misleading (for me), it says
Taking errno.h from libc instead of linux headers
.
It's true that it's only a workaround for the CI to work and it's not the path where errno.h
is being taken in our (mostly Fedora) build machines. For debian systems it is a libc header:
> dpkg -S /usr/include/x86_64-linux-gnu/asm/errno.h
linux-libc-dev:amd64: /usr/include/x86_64-linux-gnu/asm/errno.h
We could also install the linux headers, which is more complicated in the CI VM because it's not using a stock kernel. In our systems it's most likely taken from kernel-headers (i.e: /usr/include/).
IMHO your commit makes sense, as we can have different paths on different distributions. But I'd just like to check the original change adding this path is working as expected. @amorenoz could you check?
In order to accommodate for more distros maybe the fix would be to only add to the include paths the right path. Maybe the first existing path in a list of optional/excluding paths? In any case, and since this is a temporary workaround anyway (we have to add proper header dependencies soon) I'm also OK with this patch
Thanks for the explanations @amorenoz.
on Fedora this could stretch build time:
with this applied: