Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libdispatch for openSUSE:Factory checked in at 2022-07-03 18:26:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libdispatch (Old) and /work/SRC/openSUSE:Factory/.libdispatch.new.1548 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libdispatch" Sun Jul 3 18:26:56 2022 rev:4 rq:986376 version:5.6.2 Changes: -------- --- /work/SRC/openSUSE:Factory/libdispatch/libdispatch.changes 2022-05-31 15:47:56.352010405 +0200 +++ /work/SRC/openSUSE:Factory/.libdispatch.new.1548/libdispatch.changes 2022-07-03 18:26:56.604739870 +0200 @@ -1,0 +2,8 @@ +Sat Jul 2 11:37:03 UTC 2022 - Predrag Ivanovi?? <[email protected]> + +- Update to version 5.6.2 + * No upstream provided changelog. + * Drop 563.patch and 574.patch, merged upstream/no longer required. + * Disable i586 arch build for now. + +------------------------------------------------------------------- Old: ---- 563.patch 574.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libdispatch.spec ++++++ --- /var/tmp/diff_new_pack.Efpnif/_old 2022-07-03 18:26:57.084740579 +0200 +++ /var/tmp/diff_new_pack.Efpnif/_new 2022-07-03 18:26:57.088740586 +0200 @@ -16,9 +16,9 @@ # -%define reltag 5.5-RELEASE +%define reltag 5.6.2-RELEASE Name: libdispatch -Version: 5.5 +Version: 5.6.2 Release: 0 Summary: Apple's Grand Central Dispatch library License: Apache-2.0 @@ -26,11 +26,6 @@ URL: https://github.com/apple/swift-corelibs-libdispatch Source0: https://github.com/apple/swift-corelibs-libdispatch/archive/swift-%{reltag}.tar.gz#/corelibs-libdispatch.tar.gz Source1: libdispatch-rpmlintrc -# Clang13 fix for warnings treated as errors -# https://patch-diff.githubusercontent.com/raw/apple/swift-corelibs-libdispatch/pull/574.patch -Patch0: 574.patch -# https://patch-diff.githubusercontent.com/raw/apple/swift-corelibs-libdispatch/pull/563.patch -Patch1: 563.patch # set library versions Patch2: soversion.patch BuildRequires: chrpath @@ -40,6 +35,10 @@ BuildRequires: libstdc++-devel BuildRequires: llvm-gold BuildRequires: ninja +# Disable i586 build for now +%ifarch i586 +ExclusiveArch: do_not_build +%endif %description Grand Central Dispatch (GCD or libdispatch) provides support for @@ -48,7 +47,7 @@ %package -n libdispatch1_3 Summary: Apple's Grand Central Dispatch library Group: System/Libraries -Obsoletes: libdispatch +Obsoletes: libdispatch < %{version}-%{release} Provides: libdispatch = %{version}-%{release} %description -n libdispatch1_3 ++++++ corelibs-libdispatch.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/swift-corelibs-libdispatch-swift-5.5-RELEASE/cmake/modules/SwiftSupport.cmake new/swift-corelibs-libdispatch-swift-5.6.2-RELEASE/cmake/modules/SwiftSupport.cmake --- old/swift-corelibs-libdispatch-swift-5.5-RELEASE/cmake/modules/SwiftSupport.cmake 2021-09-17 06:54:52.000000000 +0200 +++ new/swift-corelibs-libdispatch-swift-5.6.2-RELEASE/cmake/modules/SwiftSupport.cmake 2021-11-30 17:20:58.000000000 +0100 @@ -9,8 +9,12 @@ function(get_swift_host_arch result_var_name) if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") set("${result_var_name}" "x86_64" PARENT_SCOPE) - elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64") - set("${result_var_name}" "aarch64" PARENT_SCOPE) + elseif ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "AArch64|aarch64|arm64") + if(CMAKE_SYSTEM_NAME MATCHES Darwin) + set("${result_var_name}" "arm64" PARENT_SCOPE) + else() + set("${result_var_name}" "aarch64" PARENT_SCOPE) + endif() elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ppc64") set("${result_var_name}" "powerpc64" PARENT_SCOPE) elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ppc64le") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/swift-corelibs-libdispatch-swift-5.5-RELEASE/dispatch/source.h new/swift-corelibs-libdispatch-swift-5.6.2-RELEASE/dispatch/source.h --- old/swift-corelibs-libdispatch-swift-5.5-RELEASE/dispatch/source.h 2021-09-17 06:54:52.000000000 +0200 +++ new/swift-corelibs-libdispatch-swift-5.6.2-RELEASE/dispatch/source.h 2021-11-30 17:20:58.000000000 +0100 @@ -54,7 +54,7 @@ * Dispatch sources are used to automatically submit event handler blocks to * dispatch queues in response to external events. */ -DISPATCH_SOURCE_DECL(dispatch_source); +DISPATCH_SOURCE_DECL(dispatch_source) __BEGIN_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/swift-corelibs-libdispatch-swift-5.5-RELEASE/src/BlocksRuntime/runtime.c new/swift-corelibs-libdispatch-swift-5.6.2-RELEASE/src/BlocksRuntime/runtime.c --- old/swift-corelibs-libdispatch-swift-5.5-RELEASE/src/BlocksRuntime/runtime.c 2021-09-17 06:54:52.000000000 +0200 +++ new/swift-corelibs-libdispatch-swift-5.6.2-RELEASE/src/BlocksRuntime/runtime.c 2021-11-30 17:20:58.000000000 +0100 @@ -468,18 +468,16 @@ // Old compiler SPI static void _Block_byref_release(const void *arg) { struct Block_byref *byref = (struct Block_byref *)arg; - int32_t refcount; // dereference the forwarding pointer since the compiler isn't doing this anymore (ever?) byref = byref->forwarding; - + // To support C++ destructors under GC we arrange for there to be a finalizer for this // by using an isa that directs the code to a finalizer that calls the byref_destroy method. if ((byref->flags & BLOCK_BYREF_NEEDS_FREE) == 0) { return; // stack or GC or global } - refcount = byref->flags & BLOCK_REFCOUNT_MASK; - os_assert(refcount); + os_assert(byref->flags & BLOCK_REFCOUNT_MASK); if (latching_decr_int_should_deallocate(&byref->flags)) { if (byref->flags & BLOCK_BYREF_HAS_COPY_DISPOSE) { struct Block_byref_2 *byref2 = (struct Block_byref_2 *)(byref+1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/swift-corelibs-libdispatch-swift-5.5-RELEASE/src/event/event_windows.c new/swift-corelibs-libdispatch-swift-5.6.2-RELEASE/src/event/event_windows.c --- old/swift-corelibs-libdispatch-swift-5.5-RELEASE/src/event/event_windows.c 2021-09-17 06:54:52.000000000 +0200 +++ new/swift-corelibs-libdispatch-swift-5.6.2-RELEASE/src/event/event_windows.c 2021-11-30 17:20:58.000000000 +0100 @@ -359,12 +359,11 @@ DWORD dwBytesAvailable = 1; if (lNetworkEvents & FD_CLOSE) { dwBytesAvailable = 0; - // Post to all registered read and write handlers - lNetworkEvents |= FD_READ | FD_WRITE; } else if (lNetworkEvents & FD_READ) { ioctlsocket(sock, FIONREAD, &dwBytesAvailable); } - if (lNetworkEvents & FD_READ) { + if ((lNetworkEvents & FD_CLOSE) || + ((lNetworkEvents & FD_READ) && (dwBytesAvailable > 0))) { _dispatch_muxnote_retain(dmn); if (!PostQueuedCompletionStatus(hPort, dwBytesAvailable, (ULONG_PTR)DISPATCH_PORT_SOCKET_READ, (LPOVERLAPPED)dmn)) { @@ -372,9 +371,10 @@ "PostQueuedCompletionStatus"); } } - if (lNetworkEvents & FD_WRITE) { + if ((lNetworkEvents & FD_CLOSE) || (lNetworkEvents & FD_WRITE)) { _dispatch_muxnote_retain(dmn); - if (!PostQueuedCompletionStatus(hPort, dwBytesAvailable, + if (!PostQueuedCompletionStatus(hPort, + lNetworkEvents & FD_CLOSE ? 0 : 1, (ULONG_PTR)DISPATCH_PORT_SOCKET_WRITE, (LPOVERLAPPED)dmn)) { DISPATCH_INTERNAL_CRASH(GetLastError(), "PostQueuedCompletionStatus"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/swift-corelibs-libdispatch-swift-5.5-RELEASE/src/event/workqueue.c new/swift-corelibs-libdispatch-swift-5.6.2-RELEASE/src/event/workqueue.c --- old/swift-corelibs-libdispatch-swift-5.5-RELEASE/src/event/workqueue.c 2021-09-17 06:54:52.000000000 +0200 +++ new/swift-corelibs-libdispatch-swift-5.6.2-RELEASE/src/event/workqueue.c 2021-11-30 17:20:58.000000000 +0100 @@ -22,6 +22,10 @@ #if DISPATCH_USE_INTERNAL_WORKQUEUE +#if defined(_WIN32) +#include <wct.h> +#endif + /* * dispatch_workq monitors the thread pool that is * executing the work enqueued on libdispatch's pthread @@ -177,6 +181,64 @@ } mon->num_runnable = running_count; + + _dispatch_unfair_lock_unlock(&mon->registered_tid_lock); +} +#elif defined(_WIN32) +static void +_dispatch_workq_init_wct(void *hWCTSession) +{ + // TODO(compnerd) this should have an associated CloseThreadWaitChainSession + *(HWCT **)hWCTSession = OpenThreadWaitChainSession(0, NULL); +} + +static void +_dispatch_workq_count_runnable_workers(dispatch_workq_monitor_t mon) +{ + static dispatch_once_t _wct_init_pred; + static HWCT hWCTSession; + static WAITCHAIN_NODE_INFO wait_chain[WCT_MAX_NODE_COUNT]; + + dispatch_once_f(&_wct_init_pred, &hWCTSession, &_dispatch_workq_init_wct); + + int running_count = 0; + + _dispatch_unfair_lock_lock(&mon->registered_tid_lock); + + for (int i = 0; i < mon->num_registered_tids; ++i) { + /* See _dispatch_tid_self() */ + dispatch_tid tid = mon->registered_tids[i] >> 2; + + DWORD count = WCT_MAX_NODE_COUNT; + BOOL cycle = FALSE; + if (GetThreadWaitChain(hWCTSession, 0, 0, tid, &count, wait_chain, &cycle)) { + // Check the deepest entry to see what the thread is waiting on. + DWORD index = MIN(count, WCT_MAX_NODE_COUNT) - 1; + if (wait_chain[index].ObjectType == WctThreadType) { + if (wait_chain[index].ObjectStatus != WctStatusRunning) { + continue; + } + } + } + + // Ensure that the thread is not waiting on IO + // XXX(compnerd) is this needed? The wait chain reports SMB + // and Socket IO, but it is unclear if that includes normal IO. + HANDLE hThread = OpenThread(THREAD_QUERY_INFORMATION, FALSE, tid); + if (hThread == NULL) { + _dispatch_debug("workq: unable to open thread %u: %u", tid, GetLastError()); + continue; + } + + BOOL IOPending = TRUE; + if (GetThreadIOPendingFlag(hThread, &IOPending)) + if (!IOPending) + ++running_count; + + CloseHandle(hThread); + } + + mon->num_runnable = running_count; _dispatch_unfair_lock_unlock(&mon->registered_tid_lock); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/swift-corelibs-libdispatch-swift-5.5-RELEASE/src/event/workqueue_internal.h new/swift-corelibs-libdispatch-swift-5.6.2-RELEASE/src/event/workqueue_internal.h --- old/swift-corelibs-libdispatch-swift-5.5-RELEASE/src/event/workqueue_internal.h 2021-09-17 06:54:52.000000000 +0200 +++ new/swift-corelibs-libdispatch-swift-5.6.2-RELEASE/src/event/workqueue_internal.h 2021-11-30 17:20:58.000000000 +0100 @@ -30,7 +30,7 @@ void _dispatch_workq_worker_register(dispatch_queue_global_t root_q); void _dispatch_workq_worker_unregister(dispatch_queue_global_t root_q); -#if defined(__linux__) +#if defined(__linux__) || defined(_WIN32) #define HAVE_DISPATCH_WORKQ_MONITORING 1 #else #define HAVE_DISPATCH_WORKQ_MONITORING 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/swift-corelibs-libdispatch-swift-5.5-RELEASE/src/shims/atomic.h new/swift-corelibs-libdispatch-swift-5.6.2-RELEASE/src/shims/atomic.h --- old/swift-corelibs-libdispatch-swift-5.5-RELEASE/src/shims/atomic.h 2021-09-17 06:54:52.000000000 +0200 +++ new/swift-corelibs-libdispatch-swift-5.6.2-RELEASE/src/shims/atomic.h 2021-11-30 17:20:58.000000000 +0100 @@ -35,7 +35,11 @@ #if defined(__cplusplus) #define _Bool bool #endif +#if defined(__ANDROID__) && __NDK_MAJOR__ >= 23 +#include <bits/stdatomic.h> +#else #include <stdatomic.h> +#endif #define memory_order_ordered memory_order_seq_cst #define memory_order_dependency memory_order_acquire diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/swift-corelibs-libdispatch-swift-5.5-RELEASE/src/shims/tsd.h new/swift-corelibs-libdispatch-swift-5.6.2-RELEASE/src/shims/tsd.h --- old/swift-corelibs-libdispatch-swift-5.5-RELEASE/src/shims/tsd.h 2021-09-17 06:54:52.000000000 +0200 +++ new/swift-corelibs-libdispatch-swift-5.6.2-RELEASE/src/shims/tsd.h 2021-11-30 17:20:58.000000000 +0100 @@ -158,7 +158,7 @@ extern _Thread_local struct dispatch_tsd __dispatch_tsd; extern void libdispatch_tsd_init(void); -extern void _libdispatch_tsd_cleanup(void *ctx); +extern void DISPATCH_TSD_DTOR_CC _libdispatch_tsd_cleanup(void *ctx); DISPATCH_ALWAYS_INLINE static inline struct dispatch_tsd * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/swift-corelibs-libdispatch-swift-5.5-RELEASE/tests/bsdtestharness.c new/swift-corelibs-libdispatch-swift-5.6.2-RELEASE/tests/bsdtestharness.c --- old/swift-corelibs-libdispatch-swift-5.5-RELEASE/tests/bsdtestharness.c 2021-09-17 06:54:52.000000000 +0200 +++ new/swift-corelibs-libdispatch-swift-5.6.2-RELEASE/tests/bsdtestharness.c 2021-11-30 17:20:58.000000000 +0100 @@ -72,13 +72,6 @@ assert(res == 0); #endif - uint64_t to = 0; - char *tos = getenv("BSDTEST_TIMEOUT"); - if (tos) { - to = strtoul(tos, NULL, 0); - to *= NSEC_PER_SEC; - } - #ifdef __APPLE__ char *arch = getenv("BSDTEST_ARCH"); if (arch) { @@ -245,6 +238,13 @@ }); dispatch_resume(tmp_ds); + uint64_t to = 0; + char *tos = getenv("BSDTEST_TIMEOUT"); + if (tos) { + to = strtoul(tos, NULL, 0); + to *= NSEC_PER_SEC; + } + if (!to) { #if TARGET_OS_EMBEDDED to = 180LL * NSEC_PER_SEC; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/swift-corelibs-libdispatch-swift-5.5-RELEASE/tests/dispatch_apply.c new/swift-corelibs-libdispatch-swift-5.6.2-RELEASE/tests/dispatch_apply.c --- old/swift-corelibs-libdispatch-swift-5.5-RELEASE/tests/dispatch_apply.c 2021-09-17 06:54:52.000000000 +0200 +++ new/swift-corelibs-libdispatch-swift-5.6.2-RELEASE/tests/dispatch_apply.c 2021-11-30 17:20:58.000000000 +0100 @@ -65,6 +65,7 @@ j += i; i += 1; } + (void)j; OSAtomicIncrement32(&busy_threads_finished); }
