From c4cc1c3a5d3a14c62df8a868de434e3db878c5e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rene=CC=81=20de=20Hesselle?= Date: Mon, 19 Feb 2024 19:05:50 +0100 Subject: [PATCH 1/2] Move to Apple Silicon based runner Remove cmake as we no longer need to build ninja. We can use the official wheel now since the runner's Python is 3.9 (before: 3.8). Use the same comment regarding '--wrap-mode' as in the other jobs. Download and use official ccache binary. Add myself to the 'only' section in .gitlab-ci.yml so I can have CI in my fork. Disable a few deprecation warnings due to the much newer SDK of the Apple Silicon machine. --- .gitlab-ci.yml | 33 ++++++++++++++++----------------- gio/gcocoanotificationbackend.m | 7 +++++++ gio/gosxappinfo.m | 6 ++++++ 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 08bf2ad1f..ad2372122 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -664,12 +664,16 @@ freebsd-13-x86_64: - "_build/glib/glibconfig.h" - "_build/meson-logs" -macos-x86_64: - # The macOS runner is not allowed in forks. This is about trust, not capacity. - extends: .only-origin +macos-arm64: + only: + - branches@GNOME/glib + # runner's maintainer + - branches@dehesselle/glib + except: + - tags stage: build tags: - - macosintel + - macosarm needs: [] cache: [] variables: @@ -678,31 +682,26 @@ macos-x86_64: # libpcre2 gets built as a subproject, but the default Clang options on # macOS limit string lengths to 4095B — pcre2_error.c has a string of length # 4380B - CFLAGS: "-Wno-overlength-strings" + CFLAGS: -Wno-overlength-strings # redirect to the runner's volatile temporary directory TMPDIR: /Users/Shared/work/tmp # keep the user profile clean - PIP_CACHE_DIR: /Users/Shared/build/cache + PIP_CACHE_DIR: /Users/Shared/work/cache PIPENV_CACHE_DIR: $PIP_CACHE_DIR PYTHONPYCACHEPREFIX: $PIP_CACHE_DIR - # target OS X 10.9 Mavericks for backward compatibility - SDKROOT: /opt/sdks/MacOSX10.9.sdk + # target macOS 11 Big Sur + SDKROOT: /opt/sdks/MacOSX11.3.sdk # use the runner's ccache directory CCACHE_DIR: /Users/Shared/work/ccache before_script: - bash .gitlab-ci/show-execution-environment.sh - python3 -m venv .venv - - ln -s /opt/cmake/CMake.app/Contents/bin/cmake .venv/bin - - ln -s /opt/ccache/ccache .venv/bin + - curl -L https://github.com/ccache/ccache/releases/download/v4.9.1/ccache-4.9.1-darwin.tar.gz | tar -C .venv/bin -xz --strip-components=1 ccache-4.9.1-darwin/ccache - source .venv/bin/activate - - pip3 install meson==1.2.3 - - pip3 install ninja==1.11.1 + - pip3 install meson==1.2.3 ninja==1.11.1.1 packaging==23.2 script: - # FIXME: Use --wrap-mode=default so we download dependencies each time, - # until the macOS runner is a VM where we can use a pre-made image which - # already contains the dependencies. See: - # - https://gitlab.gnome.org/GNOME/glib/merge_requests/388 - # - https://gitlab.gnome.org/Infrastructure/Infrastructure/issues/225 + # FIXME: These should use --wrap-mode=nodownload but the macOS CI machine + # isn't currently set up for that. - meson setup ${MESON_COMMON_OPTIONS} --wrap-mode=default --werror diff --git a/gio/gcocoanotificationbackend.m b/gio/gcocoanotificationbackend.m index 1f5549e0c..15c4433f4 100644 --- a/gio/gcocoanotificationbackend.m +++ b/gio/gcocoanotificationbackend.m @@ -106,6 +106,11 @@ activate_detailed_action (const char * action) } } +G_GNUC_BEGIN_IGNORE_DEPRECATIONS +/* first deprecated in macOS 11.0 - All NSUserNotifications API should be + * replaced with UserNotifications.frameworks API + */ + @interface GNotificationCenterDelegate : NSObject @end @implementation GNotificationCenterDelegate @@ -263,6 +268,8 @@ g_cocoa_notification_backend_withdraw_notification (GNotificationBackend *backen [str_id release]; } +G_GNUC_END_IGNORE_DEPRECATIONS + static void g_cocoa_notification_backend_init (GCocoaNotificationBackend *backend) { diff --git a/gio/gosxappinfo.m b/gio/gosxappinfo.m index 244d6578c..cc20a41d2 100644 --- a/gio/gosxappinfo.m +++ b/gio/gosxappinfo.m @@ -656,7 +656,10 @@ g_osx_app_info_get_all_for_scheme (const char *cscheme) gint i; scheme = create_cfstring_from_cstr (cscheme); + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + /* first deprecated in macOS 10.15 - Use LSCopyApplicationURLsForURL() instead */ bundle_list = LSCopyAllHandlersForURLScheme (scheme); + G_GNUC_END_IGNORE_DEPRECATIONS CFRelease (scheme); if (!bundle_list) @@ -795,7 +798,10 @@ g_app_info_get_default_for_uri_scheme_impl (const char *uri_scheme) NSBundle *bundle; scheme = create_cfstring_from_cstr (uri_scheme); + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + /* first deprecated in macOS 10.15 - Use LSCopyDefaultApplicationURLForURL() instead. */ bundle_id = LSCopyDefaultHandlerForURLScheme (scheme); + G_GNUC_END_IGNORE_DEPRECATIONS CFRelease (scheme); if (!bundle_id) From 9af1726cd70a4d9f04b72629c720f2e8e8e928c8 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 12 Sep 2024 22:05:41 +0000 Subject: [PATCH 2/2] ci: Re-add contextual links for a FIXME message To avoid people having to do git archaeology in future to work out why `--wrap-mode=nodownload` is such a good idea. --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ad2372122..7726fa7af 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -701,7 +701,9 @@ macos-arm64: - pip3 install meson==1.2.3 ninja==1.11.1.1 packaging==23.2 script: # FIXME: These should use --wrap-mode=nodownload but the macOS CI machine - # isn't currently set up for that. + # isn't currently set up for that. See: + # - https://gitlab.gnome.org/GNOME/glib/merge_requests/388 + # - https://gitlab.gnome.org/Infrastructure/Infrastructure/issues/225 - meson setup ${MESON_COMMON_OPTIONS} --wrap-mode=default --werror