1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

1241 Commits

Author SHA1 Message Date
Björn Jacke
2291679e2b samba_abi.py: avoid inefficient string concatenations
Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-09-21 19:33:25 +00:00
Andrew Bartlett
b76bf7afd0 build: Raise minimum python version to 3.5.0 for Samba 4.12
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Sep  2 01:14:05 UTC 2019 on sn-devel-184
2019-09-02 01:14:05 +00:00
Andrew Bartlett
2b7224ab7c third_party: Remove zlib from third_party
We require zlib 1.2.3.

We stopped requring a patched zlib with 5631a1b9bc

As discussed on samba-technical here:

https://lists.samba.org/archive/samba-technical/2019-May/133476.html

In short, zlib contains some (old, now broken) crypto code that while not compiled
in Samba is best left out of our tarball to ease crypto audits.  It is also very
very out of date and is a slightly modified copy of something otherwise very
likely available on our supported host OSs.  It would be strange to say that
GnuTLS and dependencies are an acceptable burden to install but say zlib is
a step to far.

So it is removed from Samba's third_party with this commit.

The diff between zlib in Samba and official zlib 1.2.3 is included
in third_party/zlib/last-samba-from-1.2.3.diff

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2019-08-17 03:50:40 +00:00
Michael Hanselmann
dd5f8732d8 Add fuzzing support to build system
LibFuzzer, Honggfuzz and other programs implement simple interfaces for
fuzzing appropriately prepared code. Samba contains quite a lot of
parsing code, often a good target for fuzzing.

With this change the build system is amended to support building fuzzing
binaries (added in later changes).

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-08-07 06:07:28 +00:00
Stefan Metzmacher
bed7fc5a1b wafsamba: change --picky-developer into --disable-warnings-as-errors
By default we're using -Werror now if --enable-developer is
specified.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Noel Power <npower@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Aug  6 07:50:14 UTC 2019 on sn-devel-184
2019-08-06 07:50:13 +00:00
Andreas Schneider
9cf3379a14 third_party: Update uid_wrapper to version 1.2.7
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jul 16 17:20:31 UTC 2019 on sn-devel-184
2019-07-16 17:20:31 +00:00
Lukas Slebodnik
dc27ff44de wafsamba: Use native waf timer
__main__:1: DeprecationWarning: time.clock has been deprecated in Python 3.3
  and will be removed from Python 3.8: use time.perf_counter
  or time.process_time instead

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13998

Signed-off-by: Lukas Slebodnik <lslebodn@fedoraproject.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2019-06-18 16:55:20 +00:00
Andreas Schneider
aabdcc9151 third_party: Update waf to version 2.0.17
This fixes building Samba, libtalloc, libtevent, libtdb and libldb with
Python 3.8.

     wget https://waf.io/waf-2.0.17.tar.bz2
     tar -xf waf-2.0.17.tar.bz2
     git rm third_party/waf/waflib/ -r
     mkdir third_party/waf -p
     rsync -a waf-2.0.17/waflib/ third_party/waf/waflib/
     git add third_party/waf/waflib/

(Then update version number in buildtools/bin/waf and
buildtools/wafsamba/wafsamba.py)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13960

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2019-06-05 15:40:23 +00:00
Andreas Schneider
3b608510e4 third_party: Update nss_wrapper to version 1.1.6
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu May 23 11:10:28 UTC 2019 on sn-devel-184
2019-05-23 11:10:28 +00:00
Gary Lockyer
93131652a7 samba_autoconf: fix undefined behaviour sanitizer compile flags
Added the -g option, -fsaniize=null and -fsanitize=alignment, removed
the -fno-omit-frame-pointer option.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-05-16 06:46:18 +00:00
Gary Lockyer
b1a32dd7f5 selftest: enable undefined behaviour sanitizer
Add a --undefined-sanitizer option to configure, this causes the tests
to be run with the undefined behaviout sanitizer enabled.

Errors can be suppressed by adding entries to selftest/ubsan.supp

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue May 14 07:20:28 UTC 2019 on sn-devel-184
2019-05-14 07:20:28 +00:00
Joe Guo
21475e9556 wscript: mv --enable-coverage option to global
We want to enable gcov for all tasks, move it to global wscript.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-05-10 08:19:16 +00:00
Andreas Schneider
bead4fdb88 wafsamba: Enable warnings about zero-length formats
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue May  7 18:45:06 UTC 2019 on sn-devel-184
2019-05-07 18:45:04 +00:00
Andreas Schneider
e6f8404827 wafsamba: Enable warnings about format overflows
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-05-07 17:31:23 +00:00
Christof Schmitt
09962c1b7e wafsamba: Add compiler check for missing field initializer check
The commit cf79ee15

    wafsamba: Enable warnings for missing field initializer

enabled a compiler check for warnings about missing initializers for all
developer builds. This fails with older compilers, e.g. gcc on RHEL7.
Add a waf check around adding the compiler option to avoid the failure
with older compilers.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-04-30 17:34:21 +00:00
Ralph Boehme
cbee3037a2 waf: only set mandatory to False if not already set by the caller
There are a bunch of callers that call find_program with mandatory=True,
we should not overwrite this when explicity passed, eg:

  ctx.find_program('objcopy', var='OBJCOPY', mandatory=True)

  conf.SAMBA_CHECK_PERL(mandatory=True)
    -> conf.find_program('perl', var='PERL', mandatory=mandatory)

With this patch we only change the default from False to True, but allow
callers to choose specific behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Apr 29 17:07:02 UTC 2019 on sn-devel-184
2019-04-29 17:07:02 +00:00
Andreas Schneider
cf79ee15bd wafsamba: Enable warnings for missing field initializer
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-04-29 16:04:28 +00:00
Michael Hanselmann
47278bfaa6 waf: Simplify condition for undefined symbol detection
There's no need to check for OpenBSD twice.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Noel Power <npower@samba.org>

Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Tue Apr  2 17:28:40 UTC 2019 on sn-devel-144
2019-04-02 17:28:40 +00:00
Andreas Schneider
55b217288b third_party: Update socket_wrapper to version 1.2.3
* Added environment variable to disable deep binding
* Fixed installation of socket_wrapper
* Fixed several small bugs
* Fixed missing NULL check for socket_wrapper_dir()
* Fixes building in Samba source tree

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-03-22 14:03:19 +00:00
Andrew Bartlett
a574e8f517 build: Standardise on calling conf.SAMBA_CHECK_PYTHON() in libraries
We do this by removing the confusing mandatory option to
conf.SAMBA_CHECK_PYTHON{,_HEADERS}(), instead just use the value of
--disable-python internally

This follows the default minimum of Python 3.4 and keeps things consistent
with the main Samba build where --disable-python is required to skip building
python bindings.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-03-21 04:06:16 +00:00
Andrew Bartlett
63d20d7822 build: Set default minimum python version to 3.4.0
This is the current minimum, but this may change before the 4.11 release.

Python 2.x support is no longer available except to build using --disable-python.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-03-21 04:06:15 +00:00
Andrew Bartlett
760b176d86 build: Do not make python mandatory to build
Clearly we have python or else we would not be running, so this is about if
we have a new enough version.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-03-21 04:06:15 +00:00
Andrew Bartlett
ad3ba5998e build: Remove distinct .py3 ABI files
The only difference between the two built libraries is pytalloc_CObject_FromTallocPtr()
which is deprecated.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-03-21 04:06:15 +00:00
Andrew Bartlett
fdb6305c86 build: Remove bld.gen_python_environments()
This was part of --extra-python support.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2019-03-21 04:06:14 +00:00
Andrew Bartlett
270d04e4ea build: Remove --extra-python
This option is quite invasive in waf and was mainly for the python3 transition.

Testing with multiple python versions can be done by testing a full compile against
multiple versions, likewise multiple different binding versions can be created
the same way.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-03-21 04:06:14 +00:00
Björn Jacke
42e96696a0 wafbuild: create missing private library symlinks on platforms without soname support for shared libs
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9557

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Björn Jacke <bjacke@samba.org>
Autobuild-Date(master): Fri Mar  1 17:05:19 UTC 2019 on sn-devel-144
2019-03-01 17:05:19 +00:00
Joe Guo
9fa698b023 wafsamba/symbols: change regex to match both rpath and runpath for different readelf output
In `wafsamba.dumplicate_symbols` test, it will use Popen to call:

    readelf --dynamic bin/default/source3/lib/netapi/examples/netlogon/netlogon_control2

then try to find rpath lib lines from output with regex:

    re_rpath     = re.compile(b'Library rpath: \[(.*)\]')

In ubuntu 14.04 docker image, which current CI is using, the actual output
from `readelf` is `runpath` instead of 'rpath':

    ...
    Library runpath: [/home/gitlab-runner/samba/bin/shared:/home/gitlab-runner/samba/bin/shared/private]\n'
    ...

So the regex never matched, and hide a bug.

In Ubuntu 1604 docker image, the output changes to `rpath` and matched the
regex, which expose the error in previous commit.

Improve the regex to match both `rpath` and `runpath`.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-02-18 09:25:21 +01:00
Joe Guo
4843a27bbc wafsamba/symbols: always split Popen output by bytes
In py3, `wafsamba.duplicate_symbols` test may fail:

    ...
    elfpipe = subprocess.Popen(['readelf', '--dynamic', binname], stdout=subprocess.PIPE).stdout
    ...

    File "./buildtools/wafsamba/symbols.py", line 153, in get_libs
        rpath.extend(m.group(1).split(":"))
    TypeError: a bytes-like object is required, not 'str'

Because Popen will always return bytestr even in py3, and ":" is a
unicode str in py3.  Change ":" to b":" to fix.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-02-18 09:25:21 +01:00
Björn Jacke
c9bcde012e waf: fix setting of RPATH_ST variable
Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-02-17 13:33:15 +01:00
Björn Jacke
f2c3d2b262 wafsamba: we should also remove stale symlinks here
Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-02-17 13:33:15 +01:00
Björn Jacke
7058a88cbe waf: print the library name in which we search for a function
Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-02-17 13:33:15 +01:00
Björn Jacke
918bf89dc7 waf: use the correct WERROR_CFLAGS in CHECK_CODE
all the non gcc version were incorrectly set here till now

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-02-17 13:33:15 +01:00
Björn Jacke
99dd2ae810 waf: remove redundant WERROR flag
CHECK_CFLAGS always uses WERROR flags

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-02-17 13:33:14 +01:00
Björn Jacke
c1715406f5 waf: remove duplicate WERROR cflags
WERROR flags are already added by the strict=True switch.

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-02-17 13:33:14 +01:00
Björn Jacke
2ba972e90f waf: fix compiler warnings in configure checks
the studio compiler issued here:

warning: statement not reached

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-02-17 13:33:14 +01:00
Björn Jacke
decba07b09 waf: fix WERROR_CFLAGS check
if we found the right WERROR flags of the compiler then the compiler is right
to fail because we explicitly give it an empty file to compile. We
should not do that because that makes the almost successful test fail.
This fixed the studio compiler test.

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-02-17 13:33:14 +01:00
Björn Jacke
6e72fe8450 waf: fix some missing newline compiler warnings
without a trailing newline the studio compiler issues:

warning: newline not last character in file

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-02-17 13:33:14 +01:00
Joe Guo
c9fa0a05d9 wafsamba/samba_utils.py: override symlink to allow force link
if bin is not empty and I have been sharing the samba tree into
a Vagrant environment and we run make, we get annoying linking error like this:

     File "~/samba/lib/tevent/wscript", line 130, in build
        installdir='python')
      File "./buildtools/wafsamba/wafsamba.py", line 745, in SAMBA_SCRIPT
        os.symlink(link_src, link_dst)
    FileExistsError: [Errno 17] File exists: '~/samba/lib/tevent/tevent.py' -> '~/samba/bin/default/../python/tevent.py'
    Makefile:7: recipe for target 'all' failed

Override the symlink method to allow force linking.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-02-13 04:15:15 +01:00
Aliaksei Karaliou
b50f8390eb build: Fixed usage of non-default path to WAFLOCK
If WAFLOCK environment variable is set, use it to override path
to WAF lock file in Samba build scripts.

Signed-off-by: Aliaksei Karaliou <akaraliou@panasas.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-02-11 07:43:31 +01:00
Noel Power
244e2a0279 buildtools/wafsamba: Avoid decode when using python2
To avoid problematic type checking for 'str' types which fail
when result from str.decode is used.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13777

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-02-11 07:43:31 +01:00
Aliaksei Karaliou
74cf2a1bda build:docs: Get rid of hardcoded 'bin/default'
Build scripts for documentation still contain hardcoded path to build
destination rather than use proper final build path variables.

Signed-off-by: Aliaksei Karaliou <akaraliou@panasas.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-02-08 08:51:19 +01:00
Douglas Bagnall
63f4fb615d abi_gen.sh: ignore gdb customisations when comparing signatures
If a .gdbinit file says "set print pretty on", the signatures are printed over
several lines, and the abi_check fails. So let's ignore .gdbinit files.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Sat Feb  2 20:19:05 CET 2019 on sn-devel-144
2019-02-02 20:19:05 +01:00
David Disseldorp via samba-technical
bdb90ec974 build: replace SAMBA3_ADD_OPTION with samba_add_onoff_option
The former is just an alias for the latter. samba_add_onoff_option()
better describes what the function actually does, so use that and
remove the alias.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2019-02-01 16:08:25 +01:00
Stefan Metzmacher
b2050db67b wafsamba/replace: move __STDC_WANT_LIB_EXT1__ to CFLAGS
This fixes the build of python bindings, which use memset_s()
(via ZERO_STRUCT).

In python bindings Python.h needs to be the first header, which means
is already includes string.h. Defining __STDC_WANT_LIB_EXT1__ in
replace.h is too late in that case.

This fixes the --check-c-compiler=gcc --picky-developer on FreeBSD 12.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-01-29 22:09:07 +01:00
Bjoern Jacke
f353c93096 waf: let CHECK_SIZEOF check for 64 bit also
wafsamba: utmp can be 64 bit also (like on AIX)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12017

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jan  2 14:10:41 CET 2019 on sn-devel-144
2019-01-02 14:10:41 +01:00
Andrew Bartlett
b99b51400c build: Remove --timestamp-dependencies (BROKEN)
Remove this code marked as broken, we do not need broken configure options making Samba
appear to be more complex than it already is.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2018-12-21 22:16:09 +01:00
Andreas Schneider
7eaa59686b wafsamba: Do not remove BUILTINS as duplicates
BUILTINS add object files to the target, so we can't remove them as
duplicates.

The issue e.g happens when tevent wants to link libreplace:

   20:04:10 deps removing dups from tevent of type LIBRARY: {'replace'}
   also in LIBRARY talloc

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-20 12:16:39 +01:00
Joe Guo
edfb6cb822 PY3: change shebang to python3 in misc dirs
Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>

Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Fri Dec 14 18:00:40 CET 2018 on sn-devel-144
2018-12-14 18:00:40 +01:00
Andrew Bartlett
5ddff307b4 build: Move python detection back into waf (instead of in configure and Makefile)
This avoids creating a mini-configure in the configure script.

Users wishing to use python2 to build need to specify PYTHON=
to both ./configure and make

After we merged the python3 change, it became clear that relying on systems prefixing
the correct python just causes trouble and make debugging harder, so only use $PYTHON
for the override, not the default case

This essentially reverts a660b7fb8e but
leaves the files more consistent.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2018-12-14 14:40:19 +01:00
Andrew Bartlett
90f0460c69 buildtools/wafsamba: Ensure default python picked up is python3
1) set the default python searched for samba waf to be python3
2) remove default setting of PYTHON variable if not defined (not needed)

Signed-off-by: Noel Power <npower@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-14 00:51:33 +01:00
Noel Power
bae5364bf3 buildtools/wafsamba: re-write shebang for delivered python scripts
Can't see how the orig code would have worked though
a)
  task.env["PYTHON"] is a list
b) task.env["PYTHON_SPECIFIED"] can (and is in our case false) looks
   like it would only be true for python2 but in anycase no harm we
   always rewrite the shebang

So now it works as follows,

1. PYTHON (which is where the shebang is got) is set to python3 by default
2. To override the default you need to set PYTHON (e.g. to build with python2)
3. If you give a full path in PYTHON then shebang is of the format
   "#!{FULL_PYTHON_INTERPRETER_PATH)
4. If you specify PYTHON=python or PYTHON=python2 etc. shebang format is
   "#!!/usr/bin/env python", "#!!/usr/bin/env python2" etc.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-14 00:51:33 +01:00
Noel Power
28ecdd9777 buildtools/wafsamba: Decode output of cmd_output (which is bytes)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-14 00:51:32 +01:00
Stefan Metzmacher
660b872163 wafsamba: fix pidl dependencies to rebuild on pidl changes
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2018-12-13 08:52:23 +01:00
Andrew Bartlett
a42f18cc3e selftest: Run waf build --dup-symbol-check under $PYTHON
This would often be python3 in the new build

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2018-12-13 01:49:30 +01:00
Andrew Bartlett
c71417a0eb waf-py3: Allow waf build --dup-symbol-check to operate in python3
Use the b prefix on output from subcommands to match bytes with bytes.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2018-12-13 01:49:30 +01:00
Noel Power
2fb74e6ad3 buildtools/wafsamba: Support --extra-python with python2
Relax restriction on extra_python version

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-10 10:38:25 +01:00
Noel Power
3e017aa7e5 buildtools/wafsamba Provide proper pc file
To support building by default python3 we need to fix assumption
that only extra-python with py3 has valid PYTHON_SO_ABI_FLAG used to
create alt name for pc file.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-10 10:38:25 +01:00
Noel Power
19ac50ba2d buildtools/wafsamba: Ensure we detect the correct python.
In order to support a default python3 build we need to ensure
we detect python3 if no PYTHON env variable is set up.

Currently we detect python with

conf.find_program('python', var='PYTHON', mandatory=mandatory)

which uses PYTHON as as hint and falls back to the program name
'python' otherwise

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-10 10:38:25 +01:00
Noel Power
3eb7281ff3 buildtools/wafsamba: Decode result of Popen as unicode/string
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-10 10:38:25 +01:00
Noel Power
a7cb10e4b4 PY3 pure build fix some str/bytes wobblies
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-10 10:38:24 +01:00
Stefan Metzmacher
19d71597b0 wafsamba: add MODE_{744,_777}
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-05 13:35:19 +01:00
Stefan Metzmacher
a83e4a24ab buildtools: remove unused buildtools/bin/waf-1.9
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-05 13:35:18 +01:00
Andreas Schneider
bebab07609 wafsamba: Do not always set _FORTIFY_SOURCE=2
This requires to be compiled with optimization (-O).

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2018-11-28 23:19:21 +01:00
Andreas Schneider
0025e8e96a waf: Load the C compiler correctly
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Nov 20 04:47:24 CET 2018 on sn-devel-144
2018-11-20 04:47:24 +01:00
Stefan Metzmacher
65f7f7ffe5 wafsamba: simplify SAMBA_PIDL_TABLES() rule
The builddir is not bin/default/ instead of just bin/,
so we don't need to strip 'default/' anymore.

And the '--output ${TGT}' part is not really implemented.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-11-20 01:33:34 +01:00
Stefan Metzmacher
076afab4cf wafsamba: remove unused Build.BuildContext.pre_build overload
This is not needed and also fixed the interaction between
vim and ':make'

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-11-20 01:33:34 +01:00
Stefan Metzmacher
8e1135f99b wafsamba: remove the need of BuildContext.bdir
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-11-20 01:33:34 +01:00
Stefan Metzmacher
c0104a4a04 wafsamba: remove hardcoded '..' and '/default/' from SAMBA_PIDL()
This makes it possible to remove some move waf 1.8 compat code.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-11-20 01:33:34 +01:00
Stefan Metzmacher
1cb782119a wafsamba: add a fix for broken python threading if just one job is forced
This fixes random failures during (at least) configure on AIX.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-11-20 01:33:34 +01:00
Stefan Metzmacher
5bb48cb650 wafsamba: fix CHECK_MAKEFLAGS() with waf 2.0.8
Changing Options.options.jobs in the build() hook
is too late in waf 2.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-11-20 01:33:34 +01:00
Andreas Schneider
e3b6402b8b third_party: Update socket_wrapper to version 1.2.1
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Nov 15 04:50:31 CET 2018 on sn-devel-144
2018-11-15 04:50:31 +01:00
Douglas Bagnall
aafe6bf96a waflib: fix syntax error in string format
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <noel.power@suse.com>
2018-11-01 05:08:13 +01:00
Douglas Bagnall
d4e0660354 waflib: add necessary imports
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <noel.power@suse.com>
2018-11-01 05:08:13 +01:00
Andreas Schneider
bda98b3846 third_party: Update nss_wrapper to version 1.1.5
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-10-31 21:27:16 +01:00
Noel Power
8eae420fbc PY3: ensure StringIO usage is py2/py3 compatible 2018-10-23 05:50:27 +02:00
Noel Power
ca12342b0a PY3: relative import fixes 2018-10-23 05:50:26 +02:00
Andreas Schneider
1853fd4f97 third_party: Update cmocka to version 1.1.3
* Added function to filter tests (cmocka_set_test_filter)
* Fixed fixture error reporting
* Some improvement for API documentation -> https://api.cmocka.org/
* Fixed subunit output on failures
* Do not abort if a test is skipped

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-10-03 01:07:15 +02:00
Andreas Schneider
1fd2a79a92 third_party: Update pam_wrapper to version 1.0.7
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2018-10-02 14:12:13 +02:00
Noel Power
6400c8c695 buildtools/wafsamba: Finally fix reference to basestring PY3 error.
While a previous attempt squashed the error on the config & make
phase, make install threw up this error again.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-28 01:01:23 +02:00
Noel Power
8514b5b1c6 buildtools/wafsamba: add_manual_dependency needs bytes for value
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-27 01:54:27 +02:00
Noel Power
9a6052b521 buildtools/wafsamba: fix basestring not defined error in PY3
Test for str first (which exists in py3 & py2) this avoids
the undefined runtime error.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-27 01:54:27 +02:00
Noel Power
d28b4fa361 PY3: md5 related functions need to be passed bytes
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-27 01:54:27 +02:00
Noel Power
2d94839f9f PY3: decode bytes in py3 where strings are needed
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-27 01:54:27 +02:00
Noel Power
e8fec94827 PY3: fix "TabError: inconsistent use of tabs and spaces"
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-27 01:54:27 +02:00
Noel Power
2e59a3343f PY3: make sure print stmt is enclosed by '(' & ')'
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-19 22:25:05 +02:00
Noel Power
eceb99708f PY3: decode output of cmd_output for easier string manip
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-16 06:16:20 +02:00
Noel Power
b342e6f038 PY3: bytes.maketrans, string.maketrans is a PY2 only function
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-16 06:16:19 +02:00
Noel Power
9fc6759792 PY3: enclose filter with list as len on result of filter fails
filter returns an iterator in PY3 (and a list in PY2)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-16 06:16:19 +02:00
Noel Power
59f69a7c21 py2/py3 enclose map with list
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-16 06:16:19 +02:00
Noel Power
3cc284b2af PY3: fix some octal literals
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-16 06:16:19 +02:00
Martin Schwenke
93d72bcfb0 wafsamba: Only use $DESTDIR in INSTALL_DIR() if it is set
Otherwise the leading '/' is stripped and directories are created
relative to the current directory.

This fixes a regression introduced in recent commit
26ea0f58da.

Reported-by: Ralph Böhme <slow@samba.org>
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Sep 13 09:37:23 CEST 2018 on sn-devel-144
2018-09-13 09:37:23 +02:00
Martin Schwenke
587bbd3eb1 wafsamba: Drop unused, broken install_dir()
This is broken because it doesn't respect $DESTDIR.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Tue Sep 11 10:00:05 CEST 2018 on sn-devel-144
2018-09-11 10:00:05 +02:00
Martin Schwenke
b4fa3f982a wafsamba: Have INSTALL_DIR() log directory creation
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-09-11 06:59:11 +02:00
Martin Schwenke
26ea0f58da wafsamba: Make INSTALL_DIR() respect $DESTDIR
INSTALL_DIR() currently ignores $DESTDIR and just installs directories
into the final destination.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-09-11 06:59:11 +02:00
Stefan Metzmacher
ad04275769 wafsamba: remove tru64cc.py as it's not compatible with waf 2
third_party/waf/waflib/Tools/compiler_c.py proposed
gcc for osf1V/Tru64.

If there's more needed on Tru64 someone with a Tru64 box needs to
provide a waf 2 compatible fix.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Sep 10 22:49:31 CEST 2018 on sn-devel-144
2018-09-10 22:49:31 +02:00
Stefan Metzmacher
b35ac32b2e wafsamba: remove hpuxcc.py as it's not compatible with waf 2
third_party/waf/waflib/Tools/compiler_c.py proposed
gcc for HPUX.

If there's more needed on HPUX someone with a HPUX box needs to
provide a waf 2 compatible fix.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-10 19:28:15 +02:00
Stefan Metzmacher
420d0b5606 wafsamba: remove irixcc.py as we don't support IRIX any more
There's still a irixcc.py in waf itself.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-10 19:28:15 +02:00
Stefan Metzmacher
0cd9452ea6 wafsamba: fix generic_cc.py to work with waf 2
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-10 19:28:15 +02:00
Alexander Bokovoy
230796d7ee buildtools/wafsamba: undefine a define for a failed test unless asked to keep it
If conf.CHECK_CODE() is called without `always=True` and the test has
failed, undefine the define already set to '0' by conf.check_code().

This restores expectations that undefined symbols are not considered to
be set by CONFIG_SET() method.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-10 19:28:15 +02:00
Stefan Metzmacher
93b2357035 Revert "wafsamba/samba_autoconf: when setting undefined result, use empty tuple"
This reverts commit 95ba6b9744.

There was already a better fix under discusion.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-10 19:28:14 +02:00
Alexander Bokovoy
95ba6b9744 wafsamba/samba_autoconf: when setting undefined result, use empty tuple
A difference between waf 1.x and 2.x is that we gained 0 as an undefined
variable in the cache file. This does not allow to differentiate unset
and set to 0 defines.

Force to use empty tuple () to signify unset defines.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-08 08:44:16 +02:00
Andreas Schneider
70169d4789 wafsamba: Fix 'make -j<jobs>'
Currently only 'make -j' enables parallel builds and e.g. 'make -j4'
results in no parallel compile jobs at all.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13606

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Sep  7 20:24:46 CEST 2018 on sn-devel-144
2018-09-07 20:24:46 +02:00
Alexander Bokovoy
4847daf0b7 wafsamba/samba_waf18: redefine flex function
There is a bug in waf: flex routine adjusts its inputs against
the task's current working directory but assumes it is being called from
within the build variant directory.

For Samba this means we adjust one level up than the actual work
directory we use to run (bin/ vs bin/default) and flex doesn't find the
source files.

Fix the issue by creating a local override of flex definition that
utilizes the same workd directory for both path adjustment and running
the flex itself.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Sep  7 15:45:36 CEST 2018 on sn-devel-144
2018-09-07 15:45:36 +02:00
Alexander Bokovoy
311e1eb673 wafsamba/samba_autoconf: when setting undefined result, use empty tuple
A difference between waf 1.x and 2.x is that we gained 0 as an undefined
variable in the cache file. This does not allow to differentiate unset
and set to 0 defines.

Force to use empty tuple () to signify unset defines.

Also, fix handling of extra cflags in case of 'strict=True': if
extra_cflags were not defined, we'd append None to the cflags list and
it confuses conf.check() later. 'None' is added to the command line of a
tool executed by the conf.check() which, depending on a tool, may be
treated as an error and cause wrong test result.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-07 11:37:23 +02:00
Andreas Schneider
c4c6ca5e0c wafsamba: Support clang as C compiler
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Sep  6 12:06:05 CEST 2018 on sn-devel-144
2018-09-06 12:06:05 +02:00
Alexander Bokovoy
72c3ff9ae2 buildtools/wafsamba: use CACHE_SUFFIX instead of a hard-coded name
waflib.Build provides CACHE_SUFFIX constant to append to the target
name. We have a reference to samba-specific cache suffix (.cache.py)
while original WAF uses _cache.py as a cache suffix since 2011 (see
commit 44a967e326cc2e670a31b3712e4763b72d65e81b in WAF project code).

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:27 +02:00
Alexander Bokovoy
f495f64e2e buildtools/wafsamba: remove ENFORCE_GROUP_ORDERING
ENFORCE_GROUP_ORDERING is not needed with waf 2.0 anymore

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:27 +02:00
Alexander Bokovoy
7944ed6e7b buildtools/wafsamba: port stale_files to waf 2.0
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:27 +02:00
Alexander Bokovoy
2a3fcdf1ef buildtools/wafsamba: generate build options output with waf 2.0
With WAF 2.0 we get all defines in environment at the same level.
Fix build options source code generator to handle this.

I felt uneasy at filtering out some defines so instead the code
is mangling generic defines to be correct for C compiler by
replacing '-', '.', and '()' with an underscore ('_').

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:27 +02:00
Alexander Bokovoy
31f8945aa6 wafsamba: install Python modules back to bin/python, not bin/python_modules
Partially revert 80fce353e7 which started
installing generated Python modules into python_modules directory back
in 2013. This, unfortunately, does not work anymore as Python gets quite
confused with our setup even when both bin/python and bin/python_modules
directories are part of sys.path.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:27 +02:00
Alexander Bokovoy
77f3a1387f buildtools/wafsamba: use cflags instead of ccflags for waf 2.0
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:27 +02:00
Alexander Bokovoy
1d25ae580b buildtools/wafsamba: use context instead of options for cross-compile checks for waf 2.0
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:27 +02:00
Alexander Bokovoy
aebcd69876 buildtools/wafsamba: crosscompile should use Utils.subprocess in waf 2.0
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:26 +02:00
Alexander Bokovoy
fb43723bc1 buildtools/wafsamba: use top and out for waf 2.0
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:26 +02:00
Alexander Bokovoy
0fdba4be9c buildtools/wafsamba: use top for waf 2.0
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:26 +02:00
Alexander Bokovoy
cdda0d9048 buildtools/wafsamba: change SAMBA_BUILD_ENV to use bldnode.abspath()
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:26 +02:00
Alexander Bokovoy
1fdcbd0696 wafsamba: use correct context for APPNAME
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:26 +02:00
Thomas Nagy
850ceec810 buildtools/wafsamba: compile asn1 files by adding missing code from compat15
Signed-off-by:    Thomas Nagy <tnagy@waf.io>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:26 +02:00
Alexander Bokovoy
7aaa1e680e buildtools/wafsamba/samba_abi: always_run helper was deprecated in waf 2.0
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:26 +02:00
Alexander Bokovoy
3fc4786658 buildtools/wafsamba: add install_dir to build context
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:25 +02:00
Alexander Bokovoy
69c655fe98 buildtools/wafsamba: reduce imports
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:25 +02:00
Alexander Bokovoy
7eab91a068 buildtools/wafsamba: adopt to waf 2.0.8
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:25 +02:00
Alexander Bokovoy
15288c38b3 lib/tdb/wscript: update to handle waf 2.0.4
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:23 +02:00
Alexander Bokovoy
4e65b33c1d third_party:waf: update to upstream 2.0.4 release
Update third_party/waf/ to 2.0.4 to bring us closer to Python 3

This change requires a number of changes in buildtools/ too.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:22 +02:00
Thomas Nagy
5d99786151 build:wafsamba: Update dist/distcheck commands
Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:21 +02:00
Thomas Nagy
8077f462c9 build:wafsamba: Build on waf 1.9
Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:21 +02:00
Andreas Schneider
fc4df251c8 waf: Add -fstack-clash-protection
https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13601

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-04 02:31:27 +02:00
Andreas Schneider
38e97f8b52 waf: Check for -fstack-protect-strong support
The -fstack-protector* flags are compiler only flags, don't pass them to
the linker.

https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13601

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-04 02:31:27 +02:00
Andrew Bartlett
739691fd1e buildtools: Split git ls-files output on newline, not any whitespace
This allows files to have a space in the filename within the Samba git tree.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-16 23:42:19 +02:00
Alexander Bokovoy
4e123c4682 wafsamba/samba_abi: always hide ABI symbols which must be local
binutils 2.31 is going to change how shared libraries are linked, such
that they always provide their own local definitions of the _end, _edata
and _bss_start symbols.  This would all be fine, except for shared
libraries that export all symbols be default.  (Rather than just
exporting those symbols that form part of their API).

According to binutils developers, we should only export the symbols we
explicitly want to be used. We don't use this principle for all our
libraries and deliberately don't want to have ABI versioning control for
all of them, so the change I introduce here is to explicitly mark those
symbols that will always be added by default linker configuration with
binutils 2.31 as local. Right now these are '_end', '_edata', and
'__bss_start' symbols.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Jul 13 17:45:36 CEST 2018 on sn-devel-144
2018-07-13 17:45:35 +02:00
Christof Schmitt
5c58ccba71 wscript: Add --with-system-heimdalkrb5
Add the configure option --with-system-heimdalkrb5 to build Samba
explicitly with a system Heimdal kerberos library. This does the same as
the more complicated syntax

--bundled-libraries='!heimdal,!asn1,!com_err,!roken,!hx509,!wind,!gssapi,!hcrypto,!krb5,!heimbase,!asn1_compile,!compile_et,!kdc,!hdb,!heimntlm'

and it also enforces the conflicts with MIT Kerbros and the AD DC
build.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jul 11 05:18:59 CEST 2018 on sn-devel-144
2018-07-11 05:18:59 +02:00
Amitay Isaacs
a9775c2429 wafsamba: Be strict when checking __attribute__ features
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
2018-07-04 23:56:43 +02:00
Amitay Isaacs
c08d65c3ee wafsamba: Add strict option to CHECK_CODE
Some compilers (e.g. xlc) ignores unsupported features, generates a
warning, but does not fail compilation.

This ensures that any compiler warnings are treated as errors and the
feature support is correctly identified.  This adds equivalent compiler
option to -Werror for xlc.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
2018-07-04 23:56:42 +02:00
Joe Guo
f3b5287538 python: bulk replace dict.iteritems to items for py3
In py3, iterxxx methods are removed.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-04-13 07:27:12 +02:00
Andreas Schneider
924f3f000e wafsamba: Add '-Werror=strict-overflow -Wstrict-overflow=2' to the developer build
We could move it to 3, but shouldn't go higher. If you set it to 4 and 5
you will probably also get a lot of false positives.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Apr  6 02:07:16 CEST 2018 on sn-devel-144
2018-04-06 02:07:15 +02:00
Andreas Schneider
5ebb1dd18e wafsamba: Add missing cflags_end argument to SAMBA_BINARY
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Apr  3 23:08:33 CEST 2018 on sn-devel-144
2018-04-03 23:08:33 +02:00
Andreas Schneider
a12e12e986 wafsamba: Add missing cflags_end argument to SAMBA_MODULE
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-04-03 20:20:11 +02:00
Andreas Schneider
33fa6778e1 wafsamba: Build with -Wimplicit-fallthrough if supported
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Mar  1 19:38:12 CET 2018 on sn-devel-144
2018-03-01 19:38:12 +01:00
Douglas Bagnall
578786c38b buildtools python: convert 'except X, e' to 'except X as e'
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Feb 15 05:40:55 CET 2018 on sn-devel-144
2018-02-15 05:40:55 +01:00
Andreas Schneider
87f105d76c wafsamba: Allow passing 'lib' to CHECK_STRUCTURE_MEMBER
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13238

We need to be able to point it to the right header location, so we need
to be able to pass the 'lib' that it gets set.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-01-22 12:26:20 +01:00
Mathieu Parent
e131ce4ddc waf: Remove build system info (uname -a)
Preventing reproducible builds while adding minor benefit.

More information at <https://reproducible-builds.org/>.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13213

Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
2018-01-14 17:38:26 +01:00
Andreas Schneider
19606e4dc6 third_party: Update socket_wrapper to version 1.1.9
* Fixed thread - signal deadlock issue
* Added support for openat()
* Added support for open64() and fopen64()
* Always turn on logging
* Increased maximum of wrapped interfaces to 64
* Improved fd duplication code
* Fixed strict-aliasing issues
* Fixed some use after free issues
* Fixed issues on ppc64le

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2017-12-06 19:06:21 +01:00
Andreas Schneider
8635465d77 build: Move pam_wrapper to third_party
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2017-11-25 10:14:13 +01:00
Andreas Schneider
6fbc8b810e build: Move uid_wrapper to third_party
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2017-11-25 10:14:13 +01:00
Andreas Schneider
ac65070490 build: Move resolv_wrapper to third_party
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2017-11-25 10:14:13 +01:00
Andreas Schneider
5d2b5e9848 build: Move nss_wrapper to third_party
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2017-11-25 10:14:13 +01:00
Andreas Schneider
22bf36c85a build: Move socket_wrapper to third_party
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2017-11-25 10:14:13 +01:00
Uri Simchoni
667335a42d build: ensure compiler flags are properly detected
While checking for compiler flag availability, treat warnings
as errors. Thus if the compiler only warns about unsupported flag,
it will fail the test and the flag shall be marked as unsupported.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Nov 22 14:19:20 CET 2017 on sn-devel-144
2017-11-22 14:19:20 +01:00
Uri Simchoni
2e53d6a30f build: specify -Wformat as a prerequisite of -Wformat-security
Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-11-22 10:20:21 +01:00
Uri Simchoni
34b4be091f build: allow specifying prerequisite flags when checking flags
In gcc, "-Wformat-security" is ignored unless "-Wformat" is also
specified. This patch allow adding a "prerequisite flag" to a flag
we're testing during configuration.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-11-22 10:20:21 +01:00