Projects
openEuler:Mainline
libtdb
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 8
View file
_service:tar_scm:libtdb.spec
Changed
@@ -1,5 +1,5 @@ Name: libtdb -Version: 1.4.7 +Version: 1.4.8 Release: 1 Summary: The Tdb library License: LGPLv3+ @@ -87,6 +87,9 @@ %ldconfig_scriptlets %changelog +* Fri Jul 14 2023 niuyaru <niuyaru@kylinos.cn> - 1.4.8-1 +- upgrade version to 1.4.8 + * Sat Nov 05 2022 shixuantong<shixuantong1@huawei.com> - 1.4.7-1 - upgrade version to 1.4.7
View file
_service:tar_scm:tdb-1.4.8.tar.gz/ABI/tdb-1.4.8.sigs
Added
@@ -0,0 +1,73 @@ +tdb_add_flags: void (struct tdb_context *, unsigned int) +tdb_append: int (struct tdb_context *, TDB_DATA, TDB_DATA) +tdb_chainlock: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_mark: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_nonblock: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_read: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_read_nonblock: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_unmark: int (struct tdb_context *, TDB_DATA) +tdb_chainunlock: int (struct tdb_context *, TDB_DATA) +tdb_chainunlock_read: int (struct tdb_context *, TDB_DATA) +tdb_check: int (struct tdb_context *, int (*)(TDB_DATA, TDB_DATA, void *), void *) +tdb_close: int (struct tdb_context *) +tdb_delete: int (struct tdb_context *, TDB_DATA) +tdb_dump_all: void (struct tdb_context *) +tdb_enable_seqnum: void (struct tdb_context *) +tdb_error: enum TDB_ERROR (struct tdb_context *) +tdb_errorstr: const char *(struct tdb_context *) +tdb_exists: int (struct tdb_context *, TDB_DATA) +tdb_fd: int (struct tdb_context *) +tdb_fetch: TDB_DATA (struct tdb_context *, TDB_DATA) +tdb_firstkey: TDB_DATA (struct tdb_context *) +tdb_freelist_size: int (struct tdb_context *) +tdb_get_flags: int (struct tdb_context *) +tdb_get_logging_private: void *(struct tdb_context *) +tdb_get_seqnum: int (struct tdb_context *) +tdb_hash_size: int (struct tdb_context *) +tdb_increment_seqnum_nonblock: void (struct tdb_context *) +tdb_jenkins_hash: unsigned int (TDB_DATA *) +tdb_lock_nonblock: int (struct tdb_context *, int, int) +tdb_lockall: int (struct tdb_context *) +tdb_lockall_mark: int (struct tdb_context *) +tdb_lockall_nonblock: int (struct tdb_context *) +tdb_lockall_read: int (struct tdb_context *) +tdb_lockall_read_nonblock: int (struct tdb_context *) +tdb_lockall_unmark: int (struct tdb_context *) +tdb_log_fn: tdb_log_func (struct tdb_context *) +tdb_map_size: size_t (struct tdb_context *) +tdb_name: const char *(struct tdb_context *) +tdb_nextkey: TDB_DATA (struct tdb_context *, TDB_DATA) +tdb_null: dptr = 0xXXXX, dsize = 0 +tdb_open: struct tdb_context *(const char *, int, int, int, mode_t) +tdb_open_ex: struct tdb_context *(const char *, int, int, int, mode_t, const struct tdb_logging_context *, tdb_hash_func) +tdb_parse_record: int (struct tdb_context *, TDB_DATA, int (*)(TDB_DATA, TDB_DATA, void *), void *) +tdb_printfreelist: int (struct tdb_context *) +tdb_remove_flags: void (struct tdb_context *, unsigned int) +tdb_reopen: int (struct tdb_context *) +tdb_reopen_all: int (int) +tdb_repack: int (struct tdb_context *) +tdb_rescue: int (struct tdb_context *, void (*)(TDB_DATA, TDB_DATA, void *), void *) +tdb_runtime_check_for_robust_mutexes: bool (void) +tdb_set_logging_function: void (struct tdb_context *, const struct tdb_logging_context *) +tdb_set_max_dead: void (struct tdb_context *, int) +tdb_setalarm_sigptr: void (struct tdb_context *, volatile sig_atomic_t *) +tdb_store: int (struct tdb_context *, TDB_DATA, TDB_DATA, int) +tdb_storev: int (struct tdb_context *, TDB_DATA, const TDB_DATA *, int, int) +tdb_summary: char *(struct tdb_context *) +tdb_transaction_active: bool (struct tdb_context *) +tdb_transaction_cancel: int (struct tdb_context *) +tdb_transaction_commit: int (struct tdb_context *) +tdb_transaction_prepare_commit: int (struct tdb_context *) +tdb_transaction_start: int (struct tdb_context *) +tdb_transaction_start_nonblock: int (struct tdb_context *) +tdb_transaction_write_lock_mark: int (struct tdb_context *) +tdb_transaction_write_lock_unmark: int (struct tdb_context *) +tdb_traverse: int (struct tdb_context *, tdb_traverse_func, void *) +tdb_traverse_chain: int (struct tdb_context *, unsigned int, tdb_traverse_func, void *) +tdb_traverse_key_chain: int (struct tdb_context *, TDB_DATA, tdb_traverse_func, void *) +tdb_traverse_read: int (struct tdb_context *, tdb_traverse_func, void *) +tdb_unlock: int (struct tdb_context *, int, int) +tdb_unlockall: int (struct tdb_context *) +tdb_unlockall_read: int (struct tdb_context *) +tdb_validate_freelist: int (struct tdb_context *, int *) +tdb_wipe_all: int (struct tdb_context *)
View file
_service:tar_scm:tdb-1.4.7.tar.gz/buildtools/bin/waf -> _service:tar_scm:tdb-1.4.8.tar.gz/buildtools/bin/waf
Changed
@@ -32,7 +32,7 @@ import os, sys, inspect -VERSION="2.0.24" +VERSION="2.0.25" REVISION="x" GIT="x" INSTALL="x"
View file
_service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/samba_autoconf.py -> _service:tar_scm:tdb-1.4.8.tar.gz/buildtools/wafsamba/samba_autoconf.py
Changed
@@ -146,7 +146,7 @@ @conf -def CHECK_TYPE(conf, t, alternate=None, headers=None, define=None, lib=None, msg=None): +def CHECK_TYPE(conf, t, alternate=None, headers=None, define=None, lib=None, msg=None, cflags=''): '''check for a single type''' if define is None: define = 'HAVE_' + t.upper().replace(' ', '_') @@ -158,6 +158,7 @@ headers=headers, local_include=False, msg=msg, + cflags=cflags, lib=lib, link=False) if not ret and alternate: @@ -177,14 +178,15 @@ @conf -def CHECK_TYPE_IN(conf, t, headers=None, alternate=None, define=None): +def CHECK_TYPE_IN(conf, t, headers=None, alternate=None, define=None, cflags=''): '''check for a single type with a header''' - return CHECK_TYPE(conf, t, headers=headers, alternate=alternate, define=define) + return CHECK_TYPE(conf, t, headers=headers, alternate=alternate, define=define, cflags=cflags) @conf def CHECK_VARIABLE(conf, v, define=None, always=False, - headers=None, msg=None, lib=None): + headers=None, msg=None, lib=None, + mandatory=False): '''check for a variable declaration (or define)''' if define is None: define = 'HAVE_%s' % v.upper() @@ -208,6 +210,7 @@ lib=lib, headers=headers, define=define, + mandatory=mandatory, always=always) @@ -774,6 +777,8 @@ testflags=True) conf.ADD_CFLAGS('-Werror-implicit-function-declaration', testflags=True) + conf.ADD_CFLAGS('-Werror=implicit-int', + testflags=True) conf.ADD_CFLAGS('-Werror=pointer-arith -Wpointer-arith', testflags=True) conf.ADD_CFLAGS('-Werror=declaration-after-statement -Wdeclaration-after-statement', @@ -786,6 +791,8 @@ testflags=True) conf.ADD_CFLAGS('-Werror=strict-overflow -Wstrict-overflow=2', testflags=True) + conf.ADD_CFLAGS('-Werror=old-style-definition -Wold-style-definition', + testflags=True) conf.ADD_CFLAGS('-Wformat=2 -Wno-format-y2k', testflags=True) conf.ADD_CFLAGS('-Wno-format-zero-length', testflags=True) @@ -806,6 +813,9 @@ conf.env'EXTRA_CFLAGS' = conf.env'EXTRA_CFLAGS'.extend(TO_LIST("-Werror=format")) + if CHECK_CFLAGS(conf, "-Wno-error=array-bounds"): + conf.define('HAVE_WNO_ERROR_ARRAY_BOUNDS', 1) + if not Options.options.disable_warnings_as_errors: conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Werror -Wno-error=deprecated-declarations', testflags=True) conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Wno-error=tautological-compare', testflags=True)
View file
_service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/samba_conftests.py -> _service:tar_scm:tdb-1.4.8.tar.gz/buildtools/wafsamba/samba_conftests.py
Changed
@@ -126,7 +126,7 @@ @conf -def CHECK_C_PROTOTYPE(conf, function, prototype, define, headers=None, msg=None): +def CHECK_C_PROTOTYPE(conf, function, prototype, define, headers=None, msg=None, lib=None): '''verify that a C prototype matches the one on the current system''' if not conf.CHECK_DECLS(function, headers=headers): return False @@ -138,7 +138,8 @@ headers=headers, link=False, execute=False, - msg=msg) + msg=msg, + lib=lib) @conf
View file
_service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/samba_cross.py -> _service:tar_scm:tdb-1.4.8.tar.gz/buildtools/wafsamba/samba_cross.py
Changed
@@ -77,7 +77,7 @@ f.close() return (0, ans.strip("'")) else: - m = re.match('\(\s*(-?\d+)\s*,\s*\"(.*)\"\s*\)', ans) + m = re.match(r'\(\s*(-?\d+)\s*,\s*\"(.*)\"\s*\)', ans) if m: f.close() return (int(m.group(1)), m.group(2))
View file
_service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/samba_third_party.py -> _service:tar_scm:tdb-1.4.8.tar.gz/buildtools/wafsamba/samba_third_party.py
Changed
@@ -24,17 +24,17 @@ @conf def CHECK_SOCKET_WRAPPER(conf): - return conf.CHECK_BUNDLED_SYSTEM_PKG('socket_wrapper', minversion='1.3.3') + return conf.CHECK_BUNDLED_SYSTEM_PKG('socket_wrapper', minversion='1.3.4') Build.BuildContext.CHECK_SOCKET_WRAPPER = CHECK_SOCKET_WRAPPER @conf def CHECK_NSS_WRAPPER(conf): - return conf.CHECK_BUNDLED_SYSTEM_PKG('nss_wrapper', minversion='1.1.11') + return conf.CHECK_BUNDLED_SYSTEM_PKG('nss_wrapper', minversion='1.1.13') Build.BuildContext.CHECK_NSS_WRAPPER = CHECK_NSS_WRAPPER @conf def CHECK_RESOLV_WRAPPER(conf): - return conf.CHECK_BUNDLED_SYSTEM_PKG('resolv_wrapper', minversion='1.1.7') + return conf.CHECK_BUNDLED_SYSTEM_PKG('resolv_wrapper', minversion='1.1.8') Build.BuildContext.CHECK_RESOLV_WRAPPER = CHECK_RESOLV_WRAPPER @conf
View file
_service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/samba_waf18.py -> _service:tar_scm:tdb-1.4.8.tar.gz/buildtools/wafsamba/samba_waf18.py
Changed
@@ -209,7 +209,8 @@ lib_node.parent.mkdir() lib_node.write('int lib_func(void) { return 42; }\n', 'w') main_node = bld.srcnode.make_node('main.c') - main_node.write('int main(void) {return !(lib_func() == 42);}', 'w') + main_node.write('int lib_func(void);\n' + 'int main(void) {return !(lib_func() == 42);}', 'w') linkflags = if version_script: script = bld.srcnode.make_node('ldscript')
View file
_service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/wafsamba.py -> _service:tar_scm:tdb-1.4.8.tar.gz/buildtools/wafsamba/wafsamba.py
Changed
@@ -38,7 +38,7 @@ os.environ'PYTHONUNBUFFERED' = '1' -if Context.HEXVERSION not in (0x2001800,): +if Context.HEXVERSION not in (0x2001900,): Logs.error(''' Please use the version of waf that comes with Samba, not a system installed version. See http://wiki.samba.org/index.php/Waf @@ -913,12 +913,19 @@ dep_vars.append('ruledeps') dep_vars.append('SAMBA_GENERATOR_VARS') + shell=isinstance(rule, str) + + # This ensures that if the command (executed in the shell) fails + # (returns non-zero), the build fails + if shell: + rule = "set -e; " + rule + bld.SET_BUILD_GROUP(group) t = bld( rule=rule, source=bld.EXPAND_VARIABLES(source, vars=vars), + shell=shell, target=target, - shell=isinstance(rule, str), update_outputs=True, before='c', ext_out='.c', @@ -1180,10 +1187,10 @@ source = m + '.xml' if extra_source is not None: source = source, extra_source - # ${SRC1} and ${SRC2} are not referenced in the + # ${SRC1}, ${SRC2} and ${SRC3} are not referenced in the # SAMBA_GENERATOR but trigger the dependency calculation so # ensures that manpages are rebuilt when these change. - source += 'build/DTD/samba.entities', 'build/DTD/samba.build.version' + source += 'build/DTD/samba.build.pathconfig', 'build/DTD/samba.entities', 'build/DTD/samba.build.version' bld.SAMBA_GENERATOR(m, source=source, target=m,
View file
_service:tar_scm:tdb-1.4.7.tar.gz/common/error.c -> _service:tar_scm:tdb-1.4.8.tar.gz/common/error.c
Changed
@@ -32,26 +32,43 @@ return tdb->ecode; } -static struct tdb_errname { - enum TDB_ERROR ecode; const char *estring; -} emap = { {TDB_SUCCESS, "Success"}, - {TDB_ERR_CORRUPT, "Corrupt database"}, - {TDB_ERR_IO, "IO Error"}, - {TDB_ERR_LOCK, "Locking error"}, - {TDB_ERR_OOM, "Out of memory"}, - {TDB_ERR_EXISTS, "Record exists"}, - {TDB_ERR_NOLOCK, "Lock exists on other keys"}, - {TDB_ERR_EINVAL, "Invalid parameter"}, - {TDB_ERR_NOEXIST, "Record does not exist"}, - {TDB_ERR_RDONLY, "write not permitted"} }; - -/* Error string for the last tdb error */ _PUBLIC_ const char *tdb_errorstr(struct tdb_context *tdb) { - uint32_t i; - for (i = 0; i < sizeof(emap) / sizeof(struct tdb_errname); i++) - if (tdb->ecode == emapi.ecode) - return emapi.estring; + switch (tdb->ecode) { + case TDB_SUCCESS: + return "Success"; + break; + case TDB_ERR_CORRUPT: + return "Corrupt database"; + break; + case TDB_ERR_IO: + return "IO Error"; + break; + case TDB_ERR_LOCK: + return "Locking error"; + break; + case TDB_ERR_OOM: + return "Out of memory"; + break; + case TDB_ERR_EXISTS: + return "Record exists"; + break; + case TDB_ERR_NOLOCK: + return "Lock exists on other keys"; + break; + case TDB_ERR_EINVAL: + return "Invalid parameter"; + break; + case TDB_ERR_NOEXIST: + return "Record does not exist"; + break; + case TDB_ERR_RDONLY: + return "write not permitted"; + break; + default: + break; + } + return "Invalid error code"; }
View file
_service:tar_scm:tdb-1.4.7.tar.gz/lib/replace/replace.c -> _service:tar_scm:tdb-1.4.8.tar.gz/lib/replace/replace.c
Changed
@@ -33,6 +33,10 @@ #include "system/locale.h" #include "system/wait.h" +#ifdef HAVE_SYS_SYSCALL_H +#include <sys/syscall.h> +#endif + #ifdef _WIN32 #define mkdir(d,m) _mkdir(d) #endif @@ -1058,9 +1062,6 @@ #endif /* HAVE_GETPROGNAME */ #ifndef HAVE_COPY_FILE_RANGE -# ifdef HAVE_SYSCALL_COPY_FILE_RANGE -# include <sys/syscall.h> -# endif ssize_t rep_copy_file_range(int fd_in, loff_t *off_in, int fd_out, @@ -1081,3 +1082,64 @@ return -1; } #endif /* HAVE_COPY_FILE_RANGE */ + +#ifndef HAVE_OPENAT2 + +/* fallback known wellknown __NR_openat2 values */ +#ifndef __NR_openat2 +# if defined(LINUX) && defined(HAVE_SYS_SYSCALL_H) +# if defined(__i386__) +# define __NR_openat2 437 +# elif defined(__x86_64__) && defined(__LP64__) +# define __NR_openat2 437 /* 437 0x1B5 */ +# elif defined(__x86_64__) && defined(__ILP32__) +# define __NR_openat2 1073742261 /* 1073742261 0x400001B5 */ +# elif defined(__aarch64__) +# define __NR_openat2 437 +# elif defined(__arm__) +# define __NR_openat2 437 +# elif defined(__sparc__) +# define __NR_openat2 437 +# endif +# endif /* defined(LINUX) && defined(HAVE_SYS_SYSCALL_H) */ +#endif /* !__NR_openat2 */ + +#ifdef DISABLE_OPATH +/* + * systems without O_PATH also don't have openat2, + * so make sure we at a realistic combination. + */ +#undef __NR_openat2 +#endif /* DISABLE_OPATH */ + +long rep_openat2(int dirfd, const char *pathname, + struct open_how *how, size_t size) +{ +#ifdef __NR_openat2 +#if _FILE_OFFSET_BITS == 64 && SIZE_MAX == 0xffffffffUL && defined(O_LARGEFILE) + struct open_how __how; + +#if defined(O_PATH) && ! defined(DISABLE_OPATH) + if ((how->flags & O_PATH) == 0) +#endif + { + if (sizeof(__how) == size) { + __how = *how; + + __how.flags |= O_LARGEFILE; + how = &__how; + } + } +#endif + + return syscall(__NR_openat2, + dirfd, + pathname, + how, + size); +#else + errno = ENOSYS; + return -1; +#endif +} +#endif /* !HAVE_OPENAT2 */
View file
_service:tar_scm:tdb-1.4.7.tar.gz/lib/replace/replace.h -> _service:tar_scm:tdb-1.4.8.tar.gz/lib/replace/replace.h
Changed
@@ -699,13 +699,9 @@ #include <stdbool.h> #endif -#if !defined(HAVE_BOOL) -#ifdef HAVE__Bool -#define bool _Bool -#else +#ifndef HAVE_BOOL #error Need a real boolean type #endif -#endif #if !defined(HAVE_INTPTR_T) typedef long long intptr_t ; @@ -847,6 +843,35 @@ #define ZERO_ARRAY_LEN(x, l) memset_s((char *)(x), (l), 0, (l)) /** + * Explicitly zero data from memory. This is guaranteed to be not optimized + * away. + */ +#define BURN_DATA(x) memset_s((char *)&(x), sizeof(x), 0, sizeof(x)) + +/** + * Explicitly zero data from memory. This is guaranteed to be not optimized + * away. + */ +#define BURN_DATA_SIZE(x, s) memset_s((char *)&(x), (s), 0, (s)) + +/** + * Explicitly zero data from memory. This is guaranteed to be not optimized + * away. + */ +#define BURN_PTR_SIZE(x, s) memset_s((x), (s), 0, (s)) + +/** + * Explicitly zero data in string. This is guaranteed to be not optimized + * away. + */ +#define BURN_STR(x) do { \ + if ((x) != NULL) { \ + size_t s = strlen(x); \ + memset_s((x), s, 0, s); \ + } \ + } while(0) + +/** * Work out how many elements there are in a static array. */ #ifdef ARRAY_SIZE @@ -1057,4 +1082,16 @@ #include <sys/atomic.h> #endif +/* + * This handles the case of missing pthread support and ensures code can use + * __thread unconditionally, such that when built on a platform without pthread + * support, the __thread qualifier is an empty define. + */ +#ifndef HAVE___THREAD +# ifdef HAVE_PTHREAD +# error Configure failed to detect pthread library with missing TLS support +# endif +#define HAVE___THREAD +#endif + #endif /* _LIBREPLACE_REPLACE_H */
View file
_service:tar_scm:tdb-1.4.7.tar.gz/lib/replace/snprintf.c -> _service:tar_scm:tdb-1.4.8.tar.gz/lib/replace/snprintf.c
Changed
@@ -751,6 +751,8 @@ while (chunks) { cnk = chunks->next; + if (chunks->min_star) free(chunks->min_star); + if (chunks->max_star) free(chunks->max_star); free(chunks); chunks = cnk; }
View file
_service:tar_scm:tdb-1.4.7.tar.gz/lib/replace/system/filesys.h -> _service:tar_scm:tdb-1.4.8.tar.gz/lib/replace/system/filesys.h
Changed
@@ -36,7 +36,8 @@ #include <sys/param.h> #endif -#ifdef HAVE_SYS_MOUNT_H +/* This include is required on UNIX (*BSD, AIX, ...) for statfs() */ +#if !defined(LINUX) && defined(HAVE_SYS_MOUNT_H) #include <sys/mount.h> #endif @@ -44,6 +45,7 @@ #include <mntent.h> #endif +/* This include is required on Linux for statfs() */ #ifdef HAVE_SYS_VFS_H #include <sys/vfs.h> #endif @@ -241,4 +243,39 @@ #endif /* !defined(HAVE_XATTR_XATTR) || defined(XATTR_ADDITIONAL_OPTIONS) */ +#ifdef HAVE_LINUX_OPENAT2_H +#include <linux/openat2.h> +#else /* ! HAVE_LINUX_OPENAT2_H */ +/* how->resolve flags for openat2(2). */ +#define RESOLVE_NO_XDEV 0x01 /* Block mount-point crossings + (includes bind-mounts). */ +#define RESOLVE_NO_MAGICLINKS 0x02 /* Block traversal through procfs-style + "magic-links". */ +#define RESOLVE_NO_SYMLINKS 0x04 /* Block traversal through all symlinks + (implies OEXT_NO_MAGICLINKS) */ +#define RESOLVE_BENEATH 0x08 /* Block "lexical" trickery like + "..", symlinks, and absolute + paths which escape the dirfd. */ +#define RESOLVE_IN_ROOT 0x10 /* Make all jumps to "/" and ".." + be scoped inside the dirfd + (similar to chroot(2)). */ +#define RESOLVE_CACHED 0x20 /* Only complete if resolution can be + completed through cached lookup. May + return -EAGAIN if that's not + possible. */ +struct __rep_open_how { + uint64_t flags; + uint64_t mode; + uint64_t resolve; +}; +#define open_how __rep_open_how +#endif /* ! HAVE_LINUX_OPENAT2_H */ + +#ifndef HAVE_OPENAT2 +long rep_openat2(int dirfd, const char *pathname, + struct open_how *how, size_t size); +#define openat2(dirfd, pathname, how, size) \ + rep_openat2(dirfd, pathname, how, size) +#endif /* !HAVE_OPENAT2 */ + #endif
View file
_service:tar_scm:tdb-1.4.7.tar.gz/lib/replace/wscript -> _service:tar_scm:tdb-1.4.8.tar.gz/lib/replace/wscript
Changed
@@ -31,6 +31,9 @@ conf.env.standalone_replace = conf.IN_LAUNCH_DIR() + if sys.platform.rfind('linux') > -1: + conf.DEFINE('LINUX', '1') + conf.DEFINE('BOOL_DEFINED', 1) conf.DEFINE('HAVE_LIBREPLACE', 1) conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1) @@ -63,6 +66,7 @@ conf.CHECK_HEADERS('errno.h') conf.CHECK_HEADERS('getopt.h iconv.h') conf.CHECK_HEADERS('memory.h nss.h sasl/sasl.h') + conf.CHECK_HEADERS('linux/openat2.h') conf.CHECK_FUNCS_IN('inotify_init', 'inotify', checklibc=True, headers='sys/inotify.h') @@ -128,6 +132,9 @@ if conf.CHECK_CFLAGS('-Wno-strict-overflow'): conf.define('HAVE_WNO_STRICT_OVERFLOW', '1') + if conf.CHECK_CFLAGS('-Wuse-after-free=1'): + conf.define('HAVE_WUSE_AFTER_FREE_1', '1') + # Check for process set name support conf.CHECK_CODE(''' #include <sys/prctl.h> @@ -153,8 +160,7 @@ msg='Checking for O_DIRECT flag to open(2)') conf.CHECK_TYPES('"long long" intptr_t uintptr_t ptrdiff_t comparison_fn_t') - if not conf.CHECK_TYPE('bool', define='HAVE_BOOL'): - if not conf.CHECK_TYPE('_Bool', define='HAVE__Bool'): + if not conf.CHECK_TYPE('bool', define='HAVE_BOOL', headers='stdbool.h'): raise Errors.WafError('Samba requires a genuine boolean type') conf.CHECK_TYPE('int8_t', 'char') @@ -470,7 +476,7 @@ execute = True, define = 'HAVE_BSD_STRTOLL', ) - conf.CHECK_FUNCS('if_nametoindex strerror_r') + conf.CHECK_FUNCS('if_nameindex if_nametoindex strerror_r') conf.CHECK_FUNCS('syslog') conf.CHECK_FUNCS('gai_strerror get_current_dir_name') conf.CHECK_FUNCS('timegm getifaddrs freeifaddrs mmap setgroups syscall setsid') @@ -667,7 +673,8 @@ conf.CONFIG_SET('HAVE_PTHREAD_MUTEX_CONSISTENT_NP'))): conf.DEFINE('HAVE_ROBUST_MUTEXES', 1) - # __thread is available since 2002 in gcc. + # __thread is available in Solaris Studio, IBM XL, + # gcc, Clang and Intel C Compiler conf.CHECK_CODE(''' __thread int tls; @@ -679,6 +686,9 @@ addmain=False, msg='Checking for __thread local storage') + if conf.CONFIG_SET('HAVE_PTHREAD') and not conf.CONFIG_SET('HAVE___THREAD'): + conf.fatal('Missing required TLS support in pthread library') + conf.CHECK_FUNCS_IN('crypt', 'crypt', checklibc=True) conf.CHECK_FUNCS_IN('crypt_r', 'crypt', checklibc=True) conf.CHECK_FUNCS_IN('crypt_rn', 'crypt', checklibc=True) @@ -927,9 +937,9 @@ bld.SAMBA_LIBRARY('replace', source=REPLACE_SOURCE, group='base_libraries', - # FIXME: Ideally symbols should be hidden here so they - # don't appear in the global namespace when Samba - # libraries are loaded, but this doesn't appear to work + # FIXME: Ideally symbols should be hidden here so they + # don't appear in the global namespace when Samba + # libraries are loaded, but this doesn't appear to work # at the moment: # hide_symbols=bld.BUILTIN_LIBRARY('replace'), private_library=True,
View file
_service:tar_scm:tdb-1.4.7.tar.gz/lib/replace/xattr.c -> _service:tar_scm:tdb-1.4.8.tar.gz/lib/replace/xattr.c
Changed
@@ -210,7 +210,8 @@ static ssize_t bsd_attr_list (int type, extattr_arg arg, char *list, size_t size) { ssize_t list_size, total_size = 0; - int i, t, len; + int i, len; + size_t t; char *buf; /* Iterate through extattr(2) namespaces */ for(t = 0; t < ARRAY_SIZE(extattr); t++) { @@ -266,6 +267,18 @@ for(i = 0; i < list_size; i += len + 1) { len = bufi; + + /* + * If for some reason we receive a truncated + * return from call to list xattrs the pascal + * string lengths will not be changed and + * therefore we must check that we're not + * reading garbage data or off end of array + */ + if (len + i >= list_size) { + errno = ERANGE; + return -1; + } strncpy(list, extattrt.name, extattrt.len + 1); list += extattrt.len; strncpy(list, buf + i + 1, len);
View file
_service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/update.sh -> _service:tar_scm:tdb-1.4.8.tar.gz/third_party/waf/update.sh
Changed
@@ -1,8 +1,8 @@ #!/bin/bash if $# -lt 1 ; then - echo "Usage: update.sh VERSION" - exit 1 + echo "Usage: update.sh VERSION" + exit 1 fi WAF_VERSION="${1}" @@ -16,19 +16,21 @@ echo "WAF SAMBA DIR: ${WAF_SAMBA_DIR}" echo "WAF TMP DIR: ${WAF_TMPDIR}" -cleanup_tmpdir() { - popd 2>/dev/null || true - rm -rf "$WAF_TMPDIR" +cleanup_tmpdir() +{ + popd 2>/dev/null || true + rm -rf "$WAF_TMPDIR" } trap cleanup_tmpdir SIGINT -cleanup_and_exit() { - cleanup_tmpdir - if test "$1" = 0 -o -z "$1" ; then - exit 0 - else - exit "$1" - fi +cleanup_and_exit() +{ + cleanup_tmpdir + if test "$1" = 0 -o -z "$1"; then + exit 0 + else + exit "$1" + fi } # Checkout the git tree @@ -38,17 +40,16 @@ git clone "${WAF_GIT}" ret=$? if $ret -ne 0 ; then - echo "ERROR: Failed to clone repository" - cleanup_and_exit 1 + echo "ERROR: Failed to clone repository" + cleanup_and_exit 1 fi - pushd waf || cleanup_and_exit 1 git checkout -b "waf-${WAF_VERSION}" "waf-${WAF_VERSION}" ret=$? if $ret -ne 0 ; then - echo "ERROR: Failed to checkout waf-${WAF_VERSION} repository" - cleanup_and_exit 1 + echo "ERROR: Failed to checkout waf-${WAF_VERSION} repository" + cleanup_and_exit 1 fi popd || cleanup_and_exit 1 @@ -62,8 +63,8 @@ rsync -av "${WAF_TMPDIR}/waf/waflib" . ret=$? if $ret -ne 0 ; then - echo "ERROR: Failed copy waflib" - cleanup_and_exit 1 + echo "ERROR: Failed copy waflib" + cleanup_and_exit 1 fi chmod -x waflib/Context.py
View file
_service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/Configure.py -> _service:tar_scm:tdb-1.4.8.tar.gz/third_party/waf/waflib/Configure.py
Changed
@@ -439,7 +439,7 @@ var = kw.get('var', '') if not var: - var = re.sub(r'-.', '_', filename0.upper()) + var = re.sub(r'\W', '_', filename0.upper()) path_list = kw.get('path_list', '') if path_list:
View file
_service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/Context.py -> _service:tar_scm:tdb-1.4.8.tar.gz/third_party/waf/waflib/Context.py
Changed
@@ -18,13 +18,13 @@ import imp # the following 3 constants are updated on each new release (do not touch) -HEXVERSION=0x2001800 +HEXVERSION=0x2001900 """Constant updated on new releases""" -WAFVERSION="2.0.24" +WAFVERSION="2.0.25" """Constant updated on new releases""" -WAFREVISION="1af97c71f5a6756abf36d0f78ed8fd551596d7cb" +WAFREVISION="2db0b41b2805cd5db3b55476c06b23c1e46d319f" """Git revision when the waf version is updated""" WAFNAME="waf"
View file
_service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/TaskGen.py -> _service:tar_scm:tdb-1.4.8.tar.gz/third_party/waf/waflib/TaskGen.py
Changed
@@ -400,7 +400,7 @@ Decorator that registers a task generator method that will be executed when the object attribute ``feature`` contains the corresponding key(s):: - from waflib.Task import feature + from waflib.TaskGen import feature @feature('myfeature') def myfunction(self): print('that is my feature!')
View file
_service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/Tools/msvc.py -> _service:tar_scm:tdb-1.4.8.tar.gz/third_party/waf/waflib/Tools/msvc.py
Changed
@@ -111,7 +111,7 @@ class MSVCVersion(object): def __init__(self, ver): - m = re.search('^(.*)\s+(\d+.\d+)', ver) + m = re.search(r'^(.*)\s+(\d+.\d+)', ver) if m: self.name = m.group(1) self.number = float(m.group(2))
View file
_service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/Tools/python.py -> _service:tar_scm:tdb-1.4.8.tar.gz/third_party/waf/waflib/Tools/python.py
Changed
@@ -53,7 +53,17 @@ Piece of Python code used in :py:class:`waflib.Tools.python.pyo` and :py:class:`waflib.Tools.python.pyc` for byte-compiling python files """ -DISTUTILS_IMP = 'from distutils.sysconfig import get_config_var, get_python_lib' +DISTUTILS_IMP = """ +try: + from distutils.sysconfig import get_config_var, get_python_lib +except ImportError: + from sysconfig import get_config_var, get_path + def get_python_lib(*k, **kw): + keyword='platlib' if kw.get('plat_specific') else 'purelib' + if 'prefix' in kw: + return get_path(keyword, vars={'installed_base': kw'prefix', 'platbase': kw'prefix'}) + return get_path(keyword) +""".splitlines() @before_method('process_source') @feature('py') @@ -219,7 +229,7 @@ try: out = self.cmd_and_log(self.env.PYTHON + '-c', '\n'.join(program), env=os_env) except Errors.WafError: - self.fatal('The distutils module is unusable: install "python-devel"?') + self.fatal('Could not run %r' % self.env.PYTHON) self.to_log(out) return_values = for s in out.splitlines(): @@ -291,7 +301,8 @@ @conf def check_python_headers(conf, features='pyembed pyext'): """ - Check for headers and libraries necessary to extend or embed python by using the module *distutils*. + Check for headers and libraries necessary to extend or embed python. + It may use the module *distutils* or sysconfig in newer Python versions. On success the environment variables xxx_PYEXT and xxx_PYEMBED are added: * PYEXT: for compiling python extensions @@ -439,7 +450,7 @@ env.LIBPATH_PYEXT = env.LIBPATH_PYEMBED env.LIB_PYEXT = env.LIB_PYEMBED - conf.to_log("Include path for Python extensions (found via distutils module): %r\n" % (dct'INCLUDEPY',)) + conf.to_log("Found an include path for Python extensions: %r\n" % (dct'INCLUDEPY',)) env.INCLUDES_PYEXT = dct'INCLUDEPY' env.INCLUDES_PYEMBED = dct'INCLUDEPY' @@ -452,15 +463,21 @@ env.append_unique('CXXFLAGS_PYEXT', '-fno-strict-aliasing') if env.CC_NAME == "msvc": - from distutils.msvccompiler import MSVCCompiler - dist_compiler = MSVCCompiler() - dist_compiler.initialize() - env.append_value('CFLAGS_PYEXT', dist_compiler.compile_options) - env.append_value('CXXFLAGS_PYEXT', dist_compiler.compile_options) - env.append_value('LINKFLAGS_PYEXT', dist_compiler.ldflags_shared) + try: + from distutils.msvccompiler import MSVCCompiler + except ImportError: + # From https://github.com/python/cpython/blob/main/Lib/distutils/msvccompiler.py + env.append_value('CFLAGS_PYEXT', '/nologo', '/Ox', '/MD', '/W3', '/GX', '/DNDEBUG') + env.append_value('CXXFLAGS_PYEXT', '/nologo', '/Ox', '/MD', '/W3', '/GX', '/DNDEBUG') + env.append_value('LINKFLAGS_PYEXT', '/DLL', '/nologo', '/INCREMENTAL:NO') + else: + dist_compiler = MSVCCompiler() + dist_compiler.initialize() + env.append_value('CFLAGS_PYEXT', dist_compiler.compile_options) + env.append_value('CXXFLAGS_PYEXT', dist_compiler.compile_options) + env.append_value('LINKFLAGS_PYEXT', dist_compiler.ldflags_shared) - # See if it compiles - conf.check(header_name='Python.h', define_name='HAVE_PYTHON_H', uselib='PYEMBED', fragment=FRAG, errmsg='Distutils not installed? Broken python installation? Get python-config now!') + conf.check(header_name='Python.h', define_name='HAVE_PYTHON_H', uselib='PYEMBED', fragment=FRAG, errmsg='Could not build a Python embedded interpreter') @conf def check_python_version(conf, minver=None): @@ -506,17 +523,9 @@ else: # Finally, try to guess if Utils.is_win32: - (python_LIBDEST, pydir) = conf.get_python_variables( - "get_config_var('LIBDEST') or ''", - "get_python_lib(standard_lib=0) or ''") + (pydir,) = conf.get_python_variables("get_python_lib(standard_lib=0) or ''") else: - python_LIBDEST = None - (pydir,) = conf.get_python_variables( "get_python_lib(standard_lib=0, prefix=%r) or ''" % conf.env.PREFIX) - if python_LIBDEST is None: - if conf.env.LIBDIR: - python_LIBDEST = os.path.join(conf.env.LIBDIR, 'python' + pyver) - else: - python_LIBDEST = os.path.join(conf.env.PREFIX, 'lib', 'python' + pyver) + (pydir,) = conf.get_python_variables("get_python_lib(standard_lib=0, prefix=%r) or ''" % conf.env.PREFIX) if 'PYTHONARCHDIR' in conf.env: # Check if --pythonarchdir was specified @@ -526,7 +535,7 @@ pyarchdir = conf.environ'PYTHONARCHDIR' else: # Finally, try to guess - (pyarchdir, ) = conf.get_python_variables( "get_python_lib(plat_specific=1, standard_lib=0, prefix=%r) or ''" % conf.env.PREFIX) + (pyarchdir, ) = conf.get_python_variables("get_python_lib(plat_specific=1, standard_lib=0, prefix=%r) or ''" % conf.env.PREFIX) if not pyarchdir: pyarchdir = pydir @@ -585,13 +594,12 @@ if ret == 'unknown version': conf.fatal('Could not check the %s version' % module_name) - from distutils.version import LooseVersion def num(*k): if isinstance(k0, int): - return LooseVersion('.'.join(str(x) for x in k)) + return Utils.loose_version('.'.join(str(x) for x in k)) else: - return LooseVersion(k0) - d = {'num': num, 'ver': LooseVersion(ret)} + return Utils.loose_version(k0) + d = {'num': num, 'ver': Utils.loose_version(ret)} ev = eval(condition, {}, d) if not ev: conf.fatal('The %s version does not satisfy the requirements' % module_name)
View file
_service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/Utils.py -> _service:tar_scm:tdb-1.4.8.tar.gz/third_party/waf/waflib/Utils.py
Changed
@@ -452,6 +452,8 @@ pass else: if codepage: + if 65001 == codepage and sys.version_info < (3, 3): + return 'utf-8' return 'cp%d' % codepage return sys.stdout.encoding or ('cp1252' if is_win32 else 'latin-1') @@ -868,6 +870,19 @@ return '64' return '' +def loose_version(ver_str): + # private for the time being! + # see #2402 + lst = re.split(r'(.|\\d+|a-zA-Z)', ver_str) + ver = + for i, val in enumerate(lst): + try: + ver.append(int(val)) + except ValueError: + if val != '.': + ver.append(val) + return ver + def sane_path(p): # private function for the time being! return os.path.abspath(os.path.expanduser(p))
View file
_service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/extras/cpplint.py -> _service:tar_scm:tdb-1.4.8.tar.gz/third_party/waf/waflib/extras/cpplint.py
Changed
@@ -169,7 +169,7 @@ global critical_errors with cpplint_wrapper(get_cpplint_logger(self.env.CPPLINT_OUTPUT), self.env.CPPLINT_BREAK, self.env.CPPLINT_OUTPUT): params = {key: str(self.envkey) for key in self.env if 'CPPLINT_' in key} - if params'CPPLINT_OUTPUT' is 'waf': + if params'CPPLINT_OUTPUT' == 'waf': params'CPPLINT_OUTPUT' = 'emacs' params'CPPLINT' = self.env.get_flat('CPPLINT') cmd = Utils.subst_vars(CPPLINT_STR, params)
View file
_service:tar_scm:tdb-1.4.8.tar.gz/third_party/waf/waflib/extras/fc_fujitsu.py
Added
@@ -0,0 +1,52 @@ +#! /usr/bin/env python +# encoding: utf-8 +# Detection of the Fujitsu Fortran compiler for ARM64FX + +import re +from waflib.Tools import fc,fc_config,fc_scan +from waflib.Configure import conf +from waflib.Tools.compiler_fc import fc_compiler +fc_compiler'linux'.append('fc_fujitsu') + +@conf +def find_fujitsu(conf): + fc=conf.find_program('frtpx',var='FC') + conf.get_fujitsu_version(fc) + conf.env.FC_NAME='FUJITSU' + conf.env.FC_MOD_CAPITALIZATION='lower' + +@conf +def fujitsu_flags(conf): + v=conf.env + v'_FCMODOUTFLAGS'= + v'FCFLAGS_DEBUG'= + v'FCFLAGS_fcshlib'= + v'LINKFLAGS_fcshlib'= + v'FCSTLIB_MARKER'='' + v'FCSHLIB_MARKER'='' + +@conf +def get_fujitsu_version(conf,fc): + version_re=re.compile(r"frtpx\s*\(FRT\)\s*(?P<major>\d+)\.(?P<minor>\d+)\.",re.I).search + cmd=fc+'--version' + out,err=fc_config.getoutput(conf,cmd,stdin=False) + if out: + match=version_re(out) + else: + match=version_re(err) + if not match: + return(False) + conf.fatal('Could not determine the Fujitsu FRT Fortran compiler version.') + else: + k=match.groupdict() + conf.env'FC_VERSION'=(k'major',k'minor') + +def configure(conf): + conf.find_fujitsu() + conf.find_program('ar',var='AR') + conf.add_os_flags('ARFLAGS') + if not conf.env.ARFLAGS: + conf.env.ARFLAGS='rcs' + conf.fc_flags() + conf.fc_add_flags() + conf.fujitsu_flags()
View file
_service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/extras/gccdeps.py -> _service:tar_scm:tdb-1.4.8.tar.gz/third_party/waf/waflib/extras/gccdeps.py
Changed
@@ -17,7 +17,7 @@ import os, re, threading from waflib import Task, Logs, Utils, Errors -from waflib.Tools import c_preproc +from waflib.Tools import asm, c, c_preproc, cxx from waflib.TaskGen import before_method, feature lock = threading.Lock()
View file
_service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/extras/pyqt5.py -> _service:tar_scm:tdb-1.4.8.tar.gz/third_party/waf/waflib/extras/pyqt5.py
Changed
@@ -1,6 +1,6 @@ #!/usr/bin/env python # encoding: utf-8 -# Federico Pellegrin, 2016-2019 (fedepell) adapted for Python +# Federico Pellegrin, 2016-2022 (fedepell) adapted for Python """ This tool helps with finding Python Qt5 tools and libraries, @@ -137,7 +137,7 @@ Processes ``.qrc`` files """ color = 'BLUE' - run_str = '${QT_PYRCC} ${SRC} -o ${TGT}' + run_str = '${QT_PYRCC} ${QT_PYRCC_FLAGS} ${SRC} -o ${TGT}' ext_out = '.py' def rcname(self): @@ -175,7 +175,7 @@ Processes ``.ui`` files for python """ color = 'BLUE' - run_str = '${QT_PYUIC} ${SRC} -o ${TGT}' + run_str = '${QT_PYUIC} ${QT_PYUIC_FLAGS} ${SRC} -o ${TGT}' ext_out = '.py' class ts2qm(Task.Task): @@ -216,17 +216,17 @@ self.find_program('pyrcc5', var='QT_PYRCC') self.find_program('pylupdate5', var='QT_PYLUPDATE') elif getattr(Options.options, 'want_pyside2', True): - self.find_program('pyside2-uic', var='QT_PYUIC') - self.find_program('pyside2-rcc', var='QT_PYRCC') - self.find_program('pyside2-lupdate', var='QT_PYLUPDATE') + self.find_program('pyside2-uic','uic-qt5', var='QT_PYUIC') + self.find_program('pyside2-rcc','rcc-qt5', var='QT_PYRCC') + self.find_program('pyside2-lupdate','lupdate-qt5', var='QT_PYLUPDATE') elif getattr(Options.options, 'want_pyqt4', True): self.find_program('pyuic4', var='QT_PYUIC') self.find_program('pyrcc4', var='QT_PYRCC') self.find_program('pylupdate4', var='QT_PYLUPDATE') else: - self.find_program('pyuic5','pyside2-uic','pyuic4', var='QT_PYUIC') - self.find_program('pyrcc5','pyside2-rcc','pyrcc4', var='QT_PYRCC') - self.find_program('pylupdate5', 'pyside2-lupdate','pylupdate4', var='QT_PYLUPDATE') + self.find_program('pyuic5','pyside2-uic','pyuic4','uic-qt5', var='QT_PYUIC') + self.find_program('pyrcc5','pyside2-rcc','pyrcc4','rcc-qt5', var='QT_PYRCC') + self.find_program('pylupdate5', 'pyside2-lupdate','pylupdate4','lupdate-qt5', var='QT_PYLUPDATE') if not env.QT_PYUIC: self.fatal('cannot find the uic compiler for python for qt5')
View file
_service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/extras/sphinx.py -> _service:tar_scm:tdb-1.4.8.tar.gz/third_party/waf/waflib/extras/sphinx.py
Changed
@@ -1,7 +1,15 @@ """Support for Sphinx documentation -This is a wrapper for sphinx-build program. Please note that sphinx-build supports only one output format which can -passed to build via sphinx_output_format attribute. The default output format is html. +This is a wrapper for sphinx-build program. Please note that sphinx-build supports only +one output format at a time, but the tool can create multiple tasks to handle more. +The output formats can be passed via the sphinx_output_format, which is an array of +strings. For backwards compatibility if only one output is needed, it can be passed +as a single string. +The default output format is html. + +Specific formats can be installed in different directories by specifying the +install_path_<FORMAT> attribute. If not defined, the standard install_path +will be used instead. Example wscript: @@ -13,7 +21,8 @@ features='sphinx', sphinx_source='sources', # path to source directory sphinx_options='-a -v', # sphinx-build program additional options - sphinx_output_format='man' # output format of sphinx documentation + sphinx_output_format='html', 'man', # output format of sphinx documentation + install_path_man='${DOCDIR}/man' # put man pages in a specific directory ) """ @@ -43,30 +52,36 @@ if not self.sphinx_source: self.bld.fatal('Can\'t find sphinx_source: %r' % self.sphinx_source) + # In the taskgen we have the complete list of formats Utils.def_attrs(self, sphinx_output_format='html') - self.env.SPHINX_OUTPUT_FORMAT = self.sphinx_output_format + self.sphinx_output_format = Utils.to_list(self.sphinx_output_format) + self.env.SPHINX_OPTIONS = getattr(self, 'sphinx_options', ) for source_file in self.sphinx_source.ant_glob('**/*'): self.bld.add_manual_dependency(self.sphinx_source, source_file) - sphinx_build_task = self.create_task('SphinxBuildingTask') - sphinx_build_task.set_inputs(self.sphinx_source) - sphinx_build_task.set_outputs(self.path.get_bld()) + for cfmt in self.sphinx_output_format: + sphinx_build_task = self.create_task('SphinxBuildingTask') + sphinx_build_task.set_inputs(self.sphinx_source) + # In task we keep the specific format this task is generating + sphinx_build_task.env.SPHINX_OUTPUT_FORMAT = cfmt + + # the sphinx-build results are in <build + output_format> directory + sphinx_build_task.sphinx_output_directory = self.path.get_bld().make_node(cfmt) + sphinx_build_task.set_outputs(sphinx_build_task.sphinx_output_directory) + sphinx_build_task.sphinx_output_directory.mkdir() - # the sphinx-build results are in <build + output_format> directory - self.sphinx_output_directory = self.path.get_bld().make_node(self.env.SPHINX_OUTPUT_FORMAT) - self.sphinx_output_directory.mkdir() - Utils.def_attrs(self, install_path=get_install_path(self)) + Utils.def_attrs(sphinx_build_task, install_path=getattr(self, 'install_path_' + cfmt, getattr(self, 'install_path', get_install_path(sphinx_build_task)))) -def get_install_path(tg): - if tg.env.SPHINX_OUTPUT_FORMAT == 'man': - return tg.env.MANDIR - elif tg.env.SPHINX_OUTPUT_FORMAT == 'info': - return tg.env.INFODIR +def get_install_path(object): + if object.env.SPHINX_OUTPUT_FORMAT == 'man': + return object.env.MANDIR + elif object.env.SPHINX_OUTPUT_FORMAT == 'info': + return object.env.INFODIR else: - return tg.env.DOCDIR + return object.env.DOCDIR class SphinxBuildingTask(Task.Task): @@ -96,10 +111,10 @@ def add_install(self): - nodes = self.generator.sphinx_output_directory.ant_glob('**/*', quiet=True) + nodes = self.sphinx_output_directory.ant_glob('**/*', quiet=True) self.outputs += nodes - self.generator.add_install_files(install_to=self.generator.install_path, + self.generator.add_install_files(install_to=self.install_path, install_from=nodes, postpone=False, - cwd=self.generator.sphinx_output_directory, + cwd=self.sphinx_output_directory.make_node(self.env.SPHINX_OUTPUT_FORMAT), relative_trick=True)
View file
_service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/extras/wafcache.py -> _service:tar_scm:tdb-1.4.8.tar.gz/third_party/waf/waflib/extras/wafcache.py
Changed
@@ -39,7 +39,14 @@ * WAFCACHE_TRIM_MAX_FOLDER: maximum amount of tasks to cache (1M) * WAFCACHE_EVICT_MAX_BYTES: maximum amount of cache size in bytes (10GB) * WAFCACHE_EVICT_INTERVAL_MINUTES: minimum time interval to try - and trim the cache (3 minutess) + and trim the cache (3 minutes) + +Upload specific options: +* WAFCACHE_ASYNC_WORKERS: define a number of workers to upload results asynchronously + this may improve build performance with many/long file uploads + the default is unset (synchronous uploads) +* WAFCACHE_ASYNC_NOWAIT: do not wait for uploads to complete (default: False) + this requires asynchonous uploads to have an effect Usage:: @@ -49,10 +56,10 @@ To troubleshoot:: - waf clean build --zones=wafcache + waf clean build --zone=wafcache """ -import atexit, base64, errno, fcntl, getpass, os, re, shutil, sys, time, traceback, urllib3, shlex +import atexit, base64, errno, fcntl, getpass, os, re, shutil, sys, time, threading, traceback, urllib3, shlex try: import subprocess32 as subprocess except ImportError: @@ -71,6 +78,8 @@ WAFCACHE_NO_PUSH = 1 if os.environ.get('WAFCACHE_NO_PUSH') else 0 WAFCACHE_VERBOSITY = 1 if os.environ.get('WAFCACHE_VERBOSITY') else 0 WAFCACHE_STATS = 1 if os.environ.get('WAFCACHE_STATS') else 0 +WAFCACHE_ASYNC_WORKERS = os.environ.get('WAFCACHE_ASYNC_WORKERS') +WAFCACHE_ASYNC_NOWAIT = os.environ.get('WAFCACHE_ASYNC_NOWAIT') OK = "ok" re_waf_cmd = re.compile('(?P<src>%{SRC})|(?P<tgt>%{TGT})') @@ -99,7 +108,9 @@ self.generator.bld.cache_reqs += 1 files_to = node.abspath() for node in self.outputs - err = cache_command(ssig, , files_to) + proc = get_process() + err = cache_command(proc, ssig, , files_to) + process_pool.append(proc) if err.startswith(OK): if WAFCACHE_VERBOSITY: Logs.pprint('CYAN', ' Fetched %r from cache' % files_to) @@ -132,23 +143,50 @@ files_from.append(path) bld = self.generator.bld + old_sig = self.signature() + + for node in self.inputs: + try: + del node.ctx.cache_signode + except KeyError: + pass + + delattr(self, 'cache_sig') sig = self.signature() - ssig = Utils.to_hex(self.uid() + sig) - err = cache_command(ssig, files_from, ) + def _async_put_files_cache(bld, ssig, files_from): + proc = get_process() + if WAFCACHE_ASYNC_WORKERS: + with bld.wafcache_lock: + if bld.wafcache_stop: + process_pool.append(proc) + return + bld.wafcache_procs.add(proc) + + err = cache_command(proc, ssig, files_from, ) + process_pool.append(proc) + if err.startswith(OK): + if WAFCACHE_VERBOSITY: + Logs.pprint('CYAN', ' Successfully uploaded %s to cache' % files_from) + else: + Logs.debug('wafcache: Successfully uploaded %r to cache', files_from) + if WAFCACHE_STATS: + bld.cache_puts += 1 + else: + if WAFCACHE_VERBOSITY: + Logs.pprint('RED', ' Error caching step results %s: %s' % (files_from, err)) + else: + Logs.debug('wafcache: Error caching results %s: %s', files_from, err) - if err.startswith(OK): - if WAFCACHE_VERBOSITY: - Logs.pprint('CYAN', ' Successfully uploaded %s to cache' % files_from) + if old_sig == sig: + ssig = Utils.to_hex(self.uid() + sig) + if WAFCACHE_ASYNC_WORKERS: + fut = bld.wafcache_executor.submit(_async_put_files_cache, bld, ssig, files_from) + bld.wafcache_uploads.append(fut) else: - Logs.debug('wafcache: Successfully uploaded %r to cache', files_from) - if WAFCACHE_STATS: - self.generator.bld.cache_puts += 1 + _async_put_files_cache(bld, ssig, files_from) else: - if WAFCACHE_VERBOSITY: - Logs.pprint('RED', ' Error caching step results %s: %s' % (files_from, err)) - else: - Logs.debug('wafcache: Error caching results %s: %s', files_from, err) + Logs.debug('wafcache: skipped %r upload due to late input modifications %r', self.outputs, self.inputs) bld.task_sigsself.uid() = self.cache_sig @@ -245,19 +283,45 @@ return subprocess.Popen(cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, bufsize=0) def atexit_pool(): - for k in process_pool: - try: - os.kill(k.pid, 9) - except OSError: - pass - else: - k.wait() + for proc in process_pool: + proc.kill() atexit.register(atexit_pool) def build(bld): """ Called during the build process to enable file caching """ + + if WAFCACHE_ASYNC_WORKERS: + try: + num_workers = int(WAFCACHE_ASYNC_WORKERS) + except ValueError: + Logs.warn('Invalid WAFCACHE_ASYNC_WORKERS specified: %r' % WAFCACHE_ASYNC_WORKERS) + else: + from concurrent.futures import ThreadPoolExecutor + bld.wafcache_executor = ThreadPoolExecutor(max_workers=num_workers) + bld.wafcache_uploads = + bld.wafcache_procs = set() + bld.wafcache_stop = False + bld.wafcache_lock = threading.Lock() + + def finalize_upload_async(bld): + if WAFCACHE_ASYNC_NOWAIT: + with bld.wafcache_lock: + bld.wafcache_stop = True + + for fut in reversed(bld.wafcache_uploads): + fut.cancel() + + for proc in bld.wafcache_procs: + proc.kill() + + bld.wafcache_procs.clear() + else: + Logs.pprint('CYAN', '... waiting for wafcache uploads to complete (%s uploads)' % len(bld.wafcache_uploads)) + bld.wafcache_executor.shutdown(wait=True) + bld.add_post_fun(finalize_upload_async) + if WAFCACHE_STATS: # Init counter for statistics and hook to print results at the end bld.cache_reqs = bld.cache_hits = bld.cache_puts = 0 @@ -266,9 +330,8 @@ hit_ratio = 0 if bld.cache_reqs > 0: hit_ratio = (bld.cache_hits / bld.cache_reqs) * 100 - Logs.pprint('CYAN', ' wafcache stats: requests: %s, hits, %s, ratio: %.2f%%, writes %s' % + Logs.pprint('CYAN', ' wafcache stats: %s requests, %s hits (ratio: %.2f%%), %s writes' % (bld.cache_reqs, bld.cache_hits, hit_ratio, bld.cache_puts) ) - bld.add_post_fun(printstats) if process_pool: @@ -286,15 +349,13 @@ for x in reversed(list(Task.classes.values())): make_cached(x) -def cache_command(sig, files_from, files_to): +def cache_command(proc, sig, files_from, files_to): """ Create a command for cache worker processes, returns a pickled base64-encoded tuple containing the task signature, a list of files to cache and a list of files files to get from cache (one of the lists is assumed to be empty) """ - proc = get_process() - obj = base64.b64encode(cPickle.dumps(sig, files_from, files_to)) proc.stdin.write(obj) proc.stdin.write('\n'.encode()) @@ -302,7 +363,6 @@ obj = proc.stdout.readline() if not obj: raise OSError('Preforked sub-process %r died' % proc.pid) - process_pool.append(proc) return cPickle.loads(base64.b64decode(obj))
View file
_service:tar_scm:tdb-1.4.7.tar.gz/wscript -> _service:tar_scm:tdb-1.4.8.tar.gz/wscript
Changed
@@ -1,7 +1,7 @@ #!/usr/bin/env python APPNAME = 'tdb' -VERSION = '1.4.7' +VERSION = '1.4.8' import sys, os
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2