Merge branch 'macos_arm' into 'main'

Move macOS CI to Apple Silicon runner

Closes #3289

See merge request GNOME/glib!3965
This commit is contained in:
Philip Withnall 2024-09-12 22:28:10 +00:00
commit 6d408ea76e
3 changed files with 30 additions and 15 deletions

View File

@ -681,12 +681,16 @@ freebsd-13-x86_64:
- "_build/glib/glibconfig.h" - "_build/glib/glibconfig.h"
- "_build/meson-logs" - "_build/meson-logs"
macos-x86_64: macos-arm64:
# The macOS runner is not allowed in forks. This is about trust, not capacity. only:
extends: .only-origin - branches@GNOME/glib
# runner's maintainer
- branches@dehesselle/glib
except:
- tags
stage: build stage: build
tags: tags:
- macosintel - macosarm
needs: [] needs: []
cache: [] cache: []
variables: variables:
@ -695,31 +699,29 @@ macos-x86_64:
# libpcre2 gets built as a subproject, but the default Clang options on # 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 # macOS limit string lengths to 4095B — pcre2_error.c has a string of length
# 4380B # 4380B
CFLAGS: "-Wno-overlength-strings" CFLAGS: -Wno-overlength-strings
# redirect to the runner's volatile temporary directory # redirect to the runner's volatile temporary directory
TMPDIR: /Users/Shared/work/tmp TMPDIR: /Users/Shared/work/tmp
# keep the user profile clean # 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 PIPENV_CACHE_DIR: $PIP_CACHE_DIR
PYTHONPYCACHEPREFIX: $PIP_CACHE_DIR PYTHONPYCACHEPREFIX: $PIP_CACHE_DIR
# target OS X 10.9 Mavericks for backward compatibility # target macOS 11 Big Sur
SDKROOT: /opt/sdks/MacOSX10.9.sdk SDKROOT: /opt/sdks/MacOSX11.3.sdk
# use the runner's ccache directory # use the runner's ccache directory
CCACHE_DIR: /Users/Shared/work/ccache CCACHE_DIR: /Users/Shared/work/ccache
before_script: before_script:
- bash .gitlab-ci/show-execution-environment.sh - bash .gitlab-ci/show-execution-environment.sh
- python3 -m venv .venv - python3 -m venv .venv
- ln -s /opt/cmake/CMake.app/Contents/bin/cmake .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
- ln -s /opt/ccache/ccache .venv/bin
- source .venv/bin/activate - source .venv/bin/activate
- pip3 install meson==1.4.2 - pip3 install meson==1.4.2 ninja==1.11.1.1 packaging==23.2
- pip3 install ninja==1.11.1
script: script:
# FIXME: Use --wrap-mode=default so we download dependencies each time, # FIXME: These should use --wrap-mode=nodownload but the macOS CI machine
# until the macOS runner is a VM where we can use a pre-made image which # isn't currently set up for that. See:
# already contains the dependencies. See:
# - https://gitlab.gnome.org/GNOME/glib/merge_requests/388 # - https://gitlab.gnome.org/GNOME/glib/merge_requests/388
# - https://gitlab.gnome.org/Infrastructure/Infrastructure/issues/225 # - https://gitlab.gnome.org/Infrastructure/Infrastructure/issues/225
# FIXME: Override c_std to not be a list, until # FIXME: Override c_std to not be a list, until
# https://github.com/mesonbuild/meson/issues/13639 is fixed. # https://github.com/mesonbuild/meson/issues/13639 is fixed.
- meson setup ${MESON_COMMON_OPTIONS} - meson setup ${MESON_COMMON_OPTIONS}

View File

@ -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<NSUserNotificationCenterDelegate> @end @interface GNotificationCenterDelegate : NSObject<NSUserNotificationCenterDelegate> @end
@implementation GNotificationCenterDelegate @implementation GNotificationCenterDelegate
@ -263,6 +268,8 @@ g_cocoa_notification_backend_withdraw_notification (GNotificationBackend *backen
[str_id release]; [str_id release];
} }
G_GNUC_END_IGNORE_DEPRECATIONS
static void static void
g_cocoa_notification_backend_init (GCocoaNotificationBackend *backend) g_cocoa_notification_backend_init (GCocoaNotificationBackend *backend)
{ {

View File

@ -656,7 +656,10 @@ g_osx_app_info_get_all_for_scheme (const char *cscheme)
gint i; gint i;
scheme = create_cfstring_from_cstr (cscheme); scheme = create_cfstring_from_cstr (cscheme);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* first deprecated in macOS 10.15 - Use LSCopyApplicationURLsForURL() instead */
bundle_list = LSCopyAllHandlersForURLScheme (scheme); bundle_list = LSCopyAllHandlersForURLScheme (scheme);
G_GNUC_END_IGNORE_DEPRECATIONS
CFRelease (scheme); CFRelease (scheme);
if (!bundle_list) if (!bundle_list)
@ -795,7 +798,10 @@ g_app_info_get_default_for_uri_scheme_impl (const char *uri_scheme)
NSBundle *bundle; NSBundle *bundle;
scheme = create_cfstring_from_cstr (uri_scheme); 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); bundle_id = LSCopyDefaultHandlerForURLScheme (scheme);
G_GNUC_END_IGNORE_DEPRECATIONS
CFRelease (scheme); CFRelease (scheme);
if (!bundle_id) if (!bundle_id)