Q: how to build with system Heimdal

Christof Schmitt cs at samba.org
Tue Oct 29 23:32:16 UTC 2019

On Tue, Oct 29, 2019 at 08:06:42PM +0200, Uri Simchoni wrote:
> On 29/10/2019 19:18, Christof Schmitt wrote:
> >On Fri, Oct 25, 2019 at 12:33:33AM +0300, Uri Simchoni via samba-technical wrote:
> >>Hi,
> >>
> >>How should I build Samba with system heimdal? Should this do the trick:
> >>./configure --with-system-heimdalkrb5 --without-ad-dc
> >>make
> >>
> >>(assuming I have Heimdal installed, of course)
> >>
> >>I tried this one on master, configure succeeds and the build fails
> >>like so (kind of surprising that it tries building system heimdal):
> >>
> >>waf: Entering directory `/home/vagrant/samba/bin/default'
> >>         Selected system Heimdal build
> >>[190/192] Compiling source4/heimdal/lib/vers/print_version.c
> >>21:26:51 runner ['/usr/bin/gcc', '-D_SAMBA_BUILD_=4',
> >>'-DHAVE_CONFIG_H=1', '-MMD', '-D_GNU_SOURCE=1',
> >>'-fstack-protector-strong',
> >>__HEIMDAL_VERS_HOSTCC_dummy_module_proto(void)',
> >>'-Isource4/heimdal_build', '-I../../source4/heimdal_build',
> >>'-Iinclude/public', '-I../../include/public', '-Isource4',
> >>'-I../../source4', '-Ilib', '-I../../lib', '-Isource4/lib',
> >>'-I../../source4/lib', '-Isource4/include',
> >>'-I../../source4/include', '-Iinclude', '-I../../include',
> >>'-Ilib/replace', '-I../../lib/replace', '-I.', '-I../..',
> >>'../../source4/heimdal/lib/vers/print_version.c', '-c', '-o/home/vagrant/samba/bin/default/source4/heimdal/lib/vers/print_version.c.1.o']
> >>In file included from ../../source4/heimdal_build/roken.h:156:0,
> >>                  from ../../source4/heimdal/lib/vers/print_version.c:39:
> >>../../source4/heimdal/lib/roken/roken.h.in:282:10: fatal error:
> >>roken-common.h: No such file or directory
> >>  #include <roken-common.h>
> >>           ^~~~~~~~~~~~~~~~
> >>compilation terminated.
> >
> >This should work, but it broke back with Samba 4.10. The build works
> >with Samba 4.9. I am trying to bisect and debug this problem now.
> >
> >Christof
> >
> Oh, thanks! I didn't want to start actually debugging this before
> being sure I'm not missing some basic thing. Do note however that
> all of waf has been replaced for 4.10, so maybe it's more a matter
> of getting this back in shape than bisecting.
> I wanted to push forward another cross-compilation patch that
> involves removal of an explicit path of Heimdal headers, so I wanted
> to see if that breaks system-heimdal build and then realized it's
> broken before the patch.

So far it looks like the problem is that the heimdal include files are
in /usr/include/heimdal (at least in the Ubuntu 18.04 that i am using
for debugging).

Deleting source4/heimdal_build/krb5-types.h and adding this line allows
the system heimdal build to succeed:

--- a/wscript_configure_system_heimdal
+++ b/wscript_configure_system_heimdal
@@ -18,6 +18,7 @@ if krb5_config:
             elif l.startswith("includedir="):
                 include_path = l.strip()[len("includedir="):]
+                conf.ADD_EXTRA_INCLUDES(include_path)
                             include_path + "/krb5-types.h")

I am not sure if that is the cleanest solution, maybe someone with more
knowledge about waf and the build could provide input.

I have not done further testing. Building with the internal heimdal
library and MIT would be the next steps. Ideally we would also establish
a system heimdal build in gitlab.


More information about the samba-technical mailing list