Merge branch 'js/ci-use-macos-13'

Replace macos-12 used at GitHub CI with macos-13.

* js/ci-use-macos-13:
  ci: upgrade to using macos-13

This is another backport to `maint-2.39` to allow less CI jobs to break.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin 2024-04-10 19:25:02 +02:00
commit b12dcab61d
4 changed files with 30 additions and 21 deletions

View file

@ -262,11 +262,11 @@ jobs:
pool: ubuntu-20.04
- jobname: osx-clang
cc: clang
pool: macos-12
pool: macos-13
- jobname: osx-gcc
cc: gcc
cc_package: gcc-9
pool: macos-12
cc_package: gcc-13
pool: macos-13
- jobname: linux-gcc-default
cc: gcc
pool: ubuntu-latest

View file

@ -253,11 +253,9 @@ ubuntu-*)
export PATH="$GIT_LFS_PATH:$P4_PATH:$PATH"
;;
macos-*)
if [ "$jobname" = osx-gcc ]
MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=$(which python3)"
if [ "$jobname" != osx-gcc ]
then
MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=$(which python3)"
else
MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=$(which python2)"
MAKEFLAGS="$MAKEFLAGS NO_APPLE_COMMON_CRYPTO=NoThanks"
MAKEFLAGS="$MAKEFLAGS NO_OPENSSL=NoThanks"
fi

View file

@ -80,9 +80,7 @@ void CFRunLoopRun(void);
void CFRunLoopStop(CFRunLoopRef run_loop);
CFRunLoopRef CFRunLoopGetCurrent(void);
extern CFStringRef kCFRunLoopDefaultMode;
void FSEventStreamScheduleWithRunLoop(FSEventStreamRef stream,
CFRunLoopRef run_loop,
CFStringRef run_loop_mode);
void FSEventStreamSetDispatchQueue(FSEventStreamRef stream, dispatch_queue_t q);
unsigned char FSEventStreamStart(FSEventStreamRef stream);
void FSEventStreamStop(FSEventStreamRef stream);
void FSEventStreamInvalidate(FSEventStreamRef stream);

View file

@ -1,4 +1,5 @@
#ifndef __clang__
#include <dispatch/dispatch.h>
#include "fsm-darwin-gcc.h"
#else
#include <CoreFoundation/CoreFoundation.h>
@ -38,7 +39,9 @@ struct fsm_listen_data
FSEventStreamRef stream;
CFRunLoopRef rl;
dispatch_queue_t dq;
pthread_cond_t dq_finished;
pthread_mutex_t dq_lock;
enum shutdown_style {
SHUTDOWN_EVENT = 0,
@ -379,8 +382,11 @@ static void fsevent_callback(ConstFSEventStreamRef streamRef,
fsmonitor_batch__free_list(batch);
string_list_clear(&cookie_list, 0);
pthread_mutex_lock(&data->dq_lock);
data->shutdown_style = FORCE_SHUTDOWN;
CFRunLoopStop(data->rl);
pthread_cond_broadcast(&data->dq_finished);
pthread_mutex_unlock(&data->dq_lock);
strbuf_release(&tmp);
return;
}
@ -441,10 +447,6 @@ int fsm_listen__ctor(struct fsmonitor_daemon_state *state)
if (!data->stream)
goto failed;
/*
* `data->rl` needs to be set inside the listener thread.
*/
return 0;
failed:
@ -471,6 +473,11 @@ void fsm_listen__dtor(struct fsmonitor_daemon_state *state)
FSEventStreamRelease(data->stream);
}
if (data->dq)
dispatch_release(data->dq);
pthread_cond_destroy(&data->dq_finished);
pthread_mutex_destroy(&data->dq_lock);
FREE_AND_NULL(state->listen_data);
}
@ -479,9 +486,11 @@ void fsm_listen__stop_async(struct fsmonitor_daemon_state *state)
struct fsm_listen_data *data;
data = state->listen_data;
data->shutdown_style = SHUTDOWN_EVENT;
CFRunLoopStop(data->rl);
pthread_mutex_lock(&data->dq_lock);
data->shutdown_style = SHUTDOWN_EVENT;
pthread_cond_broadcast(&data->dq_finished);
pthread_mutex_unlock(&data->dq_lock);
}
void fsm_listen__loop(struct fsmonitor_daemon_state *state)
@ -490,9 +499,11 @@ void fsm_listen__loop(struct fsmonitor_daemon_state *state)
data = state->listen_data;
data->rl = CFRunLoopGetCurrent();
pthread_mutex_init(&data->dq_lock, NULL);
pthread_cond_init(&data->dq_finished, NULL);
data->dq = dispatch_queue_create("FSMonitor", NULL);
FSEventStreamScheduleWithRunLoop(data->stream, data->rl, kCFRunLoopDefaultMode);
FSEventStreamSetDispatchQueue(data->stream, data->dq);
data->stream_scheduled = 1;
if (!FSEventStreamStart(data->stream)) {
@ -501,7 +512,9 @@ void fsm_listen__loop(struct fsmonitor_daemon_state *state)
}
data->stream_started = 1;
CFRunLoopRun();
pthread_mutex_lock(&data->dq_lock);
pthread_cond_wait(&data->dq_finished, &data->dq_lock);
pthread_mutex_unlock(&data->dq_lock);
switch (data->shutdown_style) {
case FORCE_ERROR_STOP: