# Set this to the contents of bootstrap/sha1sum.txt
# which is generated by bootstrap/template.py --render
#
- SAMBA_CI_CONTAINER_TAG: d1ce7e10953d16253a34b8e58077fd32c1dbd59c
+ SAMBA_CI_CONTAINER_TAG: 8845099b492ab9888181df3e094e00ae8916ddb7
#
# We use the ubuntu2204 image as default as
# it matches what we have on atb-devel-224
--- /dev/null
+from waflib.Configure import conf
+from waflib import Build
+import os.path
+
+@conf
+def SAMBA_CHECK_RUST(conf):
+ conf.find_program('cargo', var='CARGO',
+ mandatory=not conf.env.disable_rust)
+
+def SAMBA_RUST(bld, name, source, enabled=True):
+ # force-disable when we can't build rust modules, so
+ # every single call doesn't need to pass this in.
+ if bld.env.disable_rust:
+ enabled = False
+
+ # Save time, no need to build rust when fuzzing
+ if bld.env.enable_fuzzing:
+ enabled = False
+
+ release_flag = ''
+ if bld.env.debug or bld.env.developer:
+ target = os.path.join('debug', name)
+ else:
+ release_flag = '--release'
+ target = os.path.join('release', name)
+ target = bld.path.find_or_declare(target)
+ rust_vars = 'CARGO_TARGET_DIR=%s' % bld.path.find_or_declare('./')
+
+ rule = [rust_vars, '${CARGO}', 'build',
+ '--manifest-path=${SRC[0].abspath(env)}', release_flag]
+ bld.SAMBA_GENERATOR(name,
+ ' '.join(rule),
+ source='Cargo.toml %s' % source,
+ target=target,
+ group='final',
+ enabled=enabled)
+Build.BuildContext.SAMBA_RUST_LIBRARY = SAMBA_RUST
+Build.BuildContext.SAMBA_RUST_BINARY = SAMBA_RUST
opt.add_option('--disable-python',
help='do not generate python modules',
action='store_true', dest='disable_python', default=False)
+ opt.add_option('--disable-rust',
+ help='do not build rust modules',
+ action='store_true', dest='disable_rust', default=False)
@Utils.run_once
conf.env.AUTOCONF_PROGRAM_PREFIX = Options.options.AUTOCONF_PROGRAM_PREFIX
conf.env.disable_python = Options.options.disable_python
+ conf.env.disable_rust = Options.options.disable_rust
if (conf.env.AUTOCONF_HOST and
conf.env.AUTOCONF_BUILD and
conf.SAMBA_CHECK_PYTHON()
conf.SAMBA_CHECK_PYTHON_HEADERS()
+ conf.SAMBA_CHECK_RUST()
+
if sys.platform == 'darwin' and not conf.env['HAVE_ENVIRON_DECL']:
# Mac OSX needs to have this and it's also needed that the python is compiled with this
# otherwise you face errors about common symbols
if Options.options.with_smb1server is not False:
conf.DEFINE('WITH_SMB1SERVER', '1')
+ conf.env.debug = Options.options.debug
+ conf.env.developer = Options.options.developer
+
#
# FreeBSD is broken. It doesn't include 'extern char **environ'
# in any shared library, but statically inside crt0.o.