The branch, master has been updated
       via  bd66dc24183 build: allow `./configure _foo=x` to work like FOO=x
      from  bc868800276 s3/libsmb: block anon authentication fallback is 
use-kerberos = desired

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit bd66dc2418318716083bf40e447f9815b199fc25
Author: Douglas Bagnall <[email protected]>
Date:   Tue Feb 3 10:24:14 2026 +1300

    build: allow `./configure _foo=x` to work like FOO=x
    
    OpenWRT passes arguments like '_python_sysroot=x' after the './configure',
    which it expects to work as if the occurred before the './configure'
    -- that is, setting environment variables (let's assume its build
    system is necessarily complex due to all the cross-compiles).
    
    This used to work (or at least not cause a failure return code) until
    the upgrade to waf 2.1.5 or 2.1.6 in mid-2025, when waf started using
    the argparse parser.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15990
    
    Signed-off-by: Douglas Bagnall <[email protected]>
    Reviewed-by: Gary Lockyer <[email protected]>
    
    Autobuild-User(master): Douglas Bagnall <[email protected]>
    Autobuild-Date(master): Wed Feb 18 00:00:30 UTC 2026 on atb-devel-224

-----------------------------------------------------------------------

Summary of changes:
 buildtools/wafsamba/samba_utils.py | 14 ++++++++++++--
 script/autobuild.py                | 11 ++++++++++-
 2 files changed, 22 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_utils.py 
b/buildtools/wafsamba/samba_utils.py
index 548e21b4a26..1fd6c42776c 100644
--- a/buildtools/wafsamba/samba_utils.py
+++ b/buildtools/wafsamba/samba_utils.py
@@ -435,7 +435,7 @@ def CHECK_MAKEFLAGS(options):
                 Logs.zones = ['runner']
             if Logs.verbose > 2:
                 Logs.zones = ['*']
-        elif opt[0].isupper() and opt.find('=') != -1:
+        elif (opt[0].isupper() or opt[0] == '_') and '=' in opt:
             # this allows us to set waf options on the make command line
             # for example, if you do "make FOO=blah", then we set the
             # option 'FOO' in Options.options, to blah. If you look in 
wafsamba/wscript
@@ -470,6 +470,16 @@ def wafsamba_options_parse_cmd_args(self, _args=None, 
cwd=None, allow_unknown=Fa
                                       _args=_args,
                                       cwd=cwd,
                                       allow_unknown=allow_unknown)
+    commands = []
+    for arg in leftover_args:
+        if '=' in arg and (arg.startswith('_') or arg[0].isupper()):
+            # We assume this is an environment setting argument, not a
+            # build target.
+            k, v = arg.split('=', 1)
+            setattr(options, k, v)
+        else:
+            commands.append(arg)
+
     CHECK_MAKEFLAGS(options)
     if options.jobs == 1:
         #
@@ -489,7 +499,7 @@ def wafsamba_options_parse_cmd_args(self, _args=None, 
cwd=None, allow_unknown=Fa
                 return
         from waflib import Runner
         Runner.Spawner = NoOpSpawner
-    return options, leftover_args
+    return options, commands
 Options.OptionsContext.parse_cmd_args = wafsamba_options_parse_cmd_args
 
 option_groups = {}
diff --git a/script/autobuild.py b/script/autobuild.py
index 63b0cbb8c9c..b2d3bd0bde4 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -178,6 +178,15 @@ builddirs = {
 ctdb_configure_params = " --enable-developer ${PREFIX}"
 samba_configure_params = " ${ENABLE_COVERAGE} ${PREFIX} --with-profiling-data 
--with-prometheus-exporter"
 
+# To test that waf copes with unknown arguments that look like
+# environment variables, we add a couple of parameters that should be
+# treated environment variables that happen to have no effect.
+#
+# This is for https://bugzilla.samba.org/show_bug.cgi?id=15990: distro
+# build systems do this kind of thing, and older versions of waf
+# allowed it.
+useless_configure_params = " _foobliosity_over_mud=7 GRISHLIHOOD_77=0"
+
 rust_configure_param = ''
 glibc_vers = float('.'.join(get_libc_version().split('.')[:2]))
 cargo = shutil.which('cargo')
@@ -283,7 +292,7 @@ tasks = {
     "samba-def-build": {
         "git-clone-required": True,
         "sequence": [
-            ("configure", "./configure.developer" + samba_configure_params),
+            ("configure", "./configure.developer" + samba_configure_params + 
useless_configure_params),
             ("make", "make -j"),
             ("check-clean-tree", CLEAN_SOURCE_TREE_CMD),
             ("chmod-R-a-w", "chmod -R a-w ."),


-- 
Samba Shared Repository

Reply via email to