Upstream release notes for glibc 2.30 https://sourceware.org/ml/libc-alpha/2019-08/msg00029.html state that <stropts.h> has been removed:
* The obsolete and never-implemented XSI STREAMS header files <stropts.h>
and <sys/stropts.h> have been removed.
which results in a build failure of lib/replace:
In file included from ../../source4/heimdal_build/krb5-types.h:8,
../../lib/replace/system/network.h:91:10: fatal error: stropts.h: No such file or directory
I used following workaround to build samba 4.10.7 on a system with glibc 2.30 installed:
edo sed \
-e '/HAVE_STROPTS_H/,+2 d' \
Would be nice to see this fixed upstream.
Can you determine why the configure check for stropts.h passed? See bin/config.log
Is HAVE_STROPTS_H in config.h?
Did you re-configure Samba after the upgrade to glibc 2.30?
(In reply to Andrew Bartlett from comment #1)
> Is HAVE_STROPTS_H in config.h?
Doesn't seem to be the case.
> Did you re-configure Samba after the upgrade to glibc 2.30?
Yes, it's a completely clean environment.
I'm trying to attach a tarball of the relevant logs/files (they're quite big), including a complete build log, bin/config.log and bin/default/include/config.h.
Created attachment 15422 [details]
Adding this as an additional report, as I'm also observing this build breakage too with samba 4.10.7, also with glibc-2.30. This is with a Gentoo x86_64 system.
Checking for header mntent.h : yes
Checking for header stropts.h : no
Checking for header unix.h : no
So it seems the system knows that the header doesn't exist, but still tries to include it nonetheless.
Created attachment 15437 [details]
patch to remove stropts.h include from network.h
The attached patch fixed it for me, by removing the include from lib/replace/system/network.h . I don't think it's necessarily correct (because autodetection perhaps should pick up on this anyway) but it does suggest that the include isn't required at least on glibc-2.30, and possibly other systems.
I just hit the same on Ubuntu.
It has the same ingredients of a recent samba 4.10.7 and glibc 2.30.
BTW the glibc change that dropped stropts.h was .
Like the other reporters I wondered why stropts.h would be included since the header detection clearly recognized that it is missing.
Since the build is always in a clean environment that came down to a local grep and that found the stray HAVE_STROPTS_H definition.
/usr/include/x86_64-linux-gnu/python3.7m/pyconfig.h:986:#define HAVE_STROPTS_H 1
That is due to pycredentials.c including python headers which will include pyconfig.h. The solution is to re-generate python with a rebuild against the new glibc which for Ubuntu I requested in .
The other projects/distros might do the same rebuild and be good for now.
In the long run samba might consider to undefine all external HAVE_* that might pollute the samba build that way, but that certainly is a bigger change.
Why hasn't this patch been applied?
See also https://bugs.gentoo.org/699668
This is a Python issue. Python incorrectly defines HAVE_STROPTS_H based on what the system had when Python was configured, but provides that to applications like Samba developed against Python.
As I read the manpages, on strict POSIX systems, ioctl (likely the header network.h was looking for) is in stropts.h, but on Linux and FreeBSD it is in sys/ioctl.h.
So, to remove this we would break Solaris, as I read it.
The bug is in Python, it needs to be fixed in Python, in my view.
If that isn't possible, the #define Samba uses and detects from waf will need to be renamed, or a build done on an OpenSolaris clone to show that removing this is harmless due to other things including the right headers.