Bug 8468 - Compile error at Alpha 17
Compile error at Alpha 17
Status: RESOLVED FIXED
Product: Samba 4.0
Classification: Unclassified
Component: Build
unspecified
x86 FreeBSD
: P5 normal
: ---
Assigned To: Andrew Bartlett
samba4-qa@samba.org
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-18 10:05 UTC by Christoph Theis
Modified: 2011-09-30 13:34 UTC (History)
2 users (show)

See Also:


Attachments
Logs of the compile error (734.52 KB, application/octet-stream)
2011-09-28 16:07 UTC, Christoph Theis
no flags Details
patch to get tdb headers and correct dep on tdb (762 bytes, patch)
2011-09-28 17:54 UTC, Andrew Bartlett
no flags Details
Patch which fixes the libnet dependency on tdb (112 bytes, text/plain)
2011-09-29 11:27 UTC, Matthias Dieter Wallnöfer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Theis 2011-09-18 10:05:16 UTC
When I compile Samba 4 alpha 17, I get the following error when compiling for plain tdb (and not tdb2):

In file included from ../source4/ntvfs/common/brlock.c:29:
../lib/tdb_compat/tdb_compat.h:105:17: error: tdb.h: No such file or directory
In file included from ../source4/ntvfs/common/brlock.c:29:
../lib/tdb_compat/tdb_compat.h:111: error: expected declaration specifiers or '...' before 'tdb_log_func'
../lib/tdb_compat/tdb_compat.h: In function 'tdb_open_compat':
../lib/tdb_compat/tdb_compat.h:113: error: storage size of 'lctx' isn't known
../lib/tdb_compat/tdb_compat.h:114: error: 'log_fn' undeclared (first use in this function)
../lib/tdb_compat/tdb_compat.h:114: error: (Each undeclared identifier is reported only once
../lib/tdb_compat/tdb_compat.h:114: error: for each function it appears in.)
../lib/tdb_compat/tdb_compat.h:119: warning: return makes pointer from integer without a cast
../lib/tdb_compat/tdb_compat.h:121: warning: return makes pointer from integer without a cast
../lib/tdb_compat/tdb_compat.h: At top level:
../lib/tdb_compat/tdb_compat.h:126: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'tdb_nextkey_compat'
Waf: Leaving directory `/usr/ports/net/samba4/work/samba-4.0.0alpha17/bin'

So the compiler can't find tdb.h. 
I have two tdb.h in the system: One coming from FreeBSD ports system under /usr/local/include, the other coming from Samba under lib/tdb/include, but neither path is in the include path.
Strange is, somewhat before the file messaging.c, also requiring tdb.h, compiled just fine, but there, /usr/local/include was in the compilers include path.

I have no idea what would be the right tdb.h. And I could not figure out where "-I/usr/local/include" would enter the build system, I could not find any reference to it. And nowhere had lib/tdb/include in the compilers include path.
Comment 1 Matthias Dieter Wallnöfer 2011-09-19 11:17:56 UTC
Please remove the "tdb_compat.h" include in "source4/ntvfs/common/brlock.c" and rebuild. We will push a fix in the GIT repo as soon as possible.
Comment 2 Matthias Dieter Wallnöfer 2011-09-19 14:33:06 UTC
Please tell us if that was enough otherwise we have to look further.
Comment 3 Christoph Theis 2011-09-19 15:54:53 UTC
When I comment out "#include <tdb_compat.h>" in brlock.c, that file will compile fine. But brlock_tdb.c will not and there I cannot comment out tdb_compat.h as it does use tdb.

Btw., where is defined that some modules are compiled with /usr/local/include added to the include path and some are not? I tried to understand the build scripts but I'm hopelessly lost ...
Comment 4 Matthias Dieter Wallnöfer 2011-09-20 16:45:46 UTC
I with the help of Jelmer worked out a new attempt - here the patch: http://gitweb.samba.org/samba.git/?p=mdw/samba.git;a=commitdiff;h=7669bf7868264390abfd73100e421cabd1d3fea1

Also this will land in the GIT repo as soon as possible.
Comment 5 Matthias Dieter Wallnöfer 2011-09-20 16:52:07 UTC
You will have to evaluate "bin/config.log".

(In reply to comment #3)
> Btw., where is defined that some modules are compiled with /usr/local/include
> added to the include path and some are not? I tried to understand the build
> scripts but I'm hopelessly lost ...
Comment 6 Matthias Dieter Wallnöfer 2011-09-24 20:55:06 UTC
Did the situation improve? Can we close this issue?
Comment 7 Christoph Theis 2011-09-26 07:58:10 UTC
With the patched wscript_build source4/ntvfs/common builds without error.
But in source3/registry/reg_perfcount.c I have the same problem, tdb.h not found. reg_perfcount.c uses tdb so commenting out the offending include would not help. Unfortunately I don't see a wscript_build file in this directory so I can't check if the same fix would help here.
Comment 8 Matthias Dieter Wallnöfer 2011-09-26 11:42:01 UTC
Günther,
you seem to be a maintainer of s3's WAF part. Would you like to look into this (source3/registry/reg_perfcount.c doesn't find "tdb.h")?
Comment 9 Matthias Dieter Wallnöfer 2011-09-28 09:29:33 UTC
Kai, could you help out please? We need to make sure that "source3/registry/reg_perfcount.c" does find "tdb.h" in the combined WAF build (see comments above). Probably a WAF dependency is missing. Do you have an idea where this might be?
Comment 10 Kai Blin 2011-09-28 14:49:07 UTC
I'll need the complete current error and the config.log file
Comment 11 Christoph Theis 2011-09-28 16:07:22 UTC
Created attachment 6957 [details]
Logs of the compile error

Contains config.log (of ./configure) and make.log (of waf -vvv) of a non-development build
Comment 12 Andrew Bartlett 2011-09-28 17:54:58 UTC
Created attachment 6960 [details]
patch to get tdb headers and correct dep on tdb

I'll take build bugs for now, as I'm most active on this.

Try the attached patch.

The issue here is that you have a copy of tdb already installed on this host - I have already tested a compile of Samba4 on FreeBSD and it worked fine.
Comment 13 Christoph Theis 2011-09-28 19:18:38 UTC
It will now fail in source3/libnet/libnet_dssync_passdb.c with the same error (file tdb.h not found)
Comment 14 Christoph Theis 2011-09-28 19:41:46 UTC
You are right: When I deinstall tdb samba-4 will compile just fine.
I don't know when tdb came onto my host, it has no dependent ports. Maybe when I installed some Samba version from the ports tree some time ago.
Comment 15 Matthias Dieter Wallnöfer 2011-09-29 11:27:50 UTC
Created attachment 6963 [details]
Patch which fixes the libnet dependency on tdb

Christoph, do you still have the possibility to test with the installed TDB package? So we could track down all stumbling blocks.
Attached the patch for fixing the libnet issue.
Comment 16 Christoph Theis 2011-09-29 15:57:05 UTC
With the last patch the build completes.  
Thank you very much for supplying the patches so fast.
Comment 17 Andrew Bartlett 2011-09-29 17:16:51 UTC
Thank you both.

Matthias,

Please autobuild these patches.
Comment 18 Matthias Dieter Wallnöfer 2011-09-30 13:34:23 UTC
Okay, patches committed to autobuild, marking as "FIXED".