From a79b08f4c599bed17d9489b9614448b2c57912db Mon Sep 17 00:00:00 2001 From: renaud gaudin Date: Tue, 7 Nov 2023 13:52:28 +0000 Subject: [PATCH 1/7] build on macos-13 with xcode 15.0.1 --- .github/workflows/ci.yml | 5 ++++- .github/workflows/releaseNigthly.yml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29b2c4f..c32e223 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -152,11 +152,14 @@ jobs: - macOS_arm64_static - macOS_arm64_mixed - macOS_x86_64 - runs-on: macos-11 + runs-on: macos-13 env: SSH_KEY: /tmp/id_rsa OS_NAME: macos steps: + - name: Set Xcode version (15.0.1) + # https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode + run: sudo xcode-select -s /Applications/Xcode_15.0.1.app - name: Checkout code uses: actions/checkout@v3 - name: Setup python 3.8 diff --git a/.github/workflows/releaseNigthly.yml b/.github/workflows/releaseNigthly.yml index b486ed7..2166e66 100644 --- a/.github/workflows/releaseNigthly.yml +++ b/.github/workflows/releaseNigthly.yml @@ -138,7 +138,7 @@ jobs: - native_mixed - macOS_arm64_static - macOS_arm64_mixed - runs-on: macos-11 + runs-on: macos-13 env: SSH_KEY: /tmp/id_rsa OS_NAME: macos @@ -148,6 +148,9 @@ jobs: KEYCHAIN_PASSWORD: mysecretpassword KEYCHAIN_PROFILE: build-profile steps: + - name: Set Xcode version (15.0.1) + # https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode + run: sudo xcode-select -s /Applications/Xcode_15.0.1.app - name: Checkout code uses: actions/checkout@v3 - name: Setup python 3.8 From fbc1ca11f263c335091fdcb09a626b4366b07eb2 Mon Sep 17 00:00:00 2001 From: renaud gaudin Date: Tue, 7 Nov 2023 13:53:19 +0000 Subject: [PATCH 2/7] removed -stdlib=libc++ flag to clang as required by xcode 15 --- kiwixbuild/platforms/ios.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/kiwixbuild/platforms/ios.py b/kiwixbuild/platforms/ios.py index 9ed9a4d..5e591d3 100644 --- a/kiwixbuild/platforms/ios.py +++ b/kiwixbuild/platforms/ios.py @@ -44,14 +44,12 @@ class ApplePlatformInfo(PlatformInfo): '-isysroot', self.root_path, '-arch', self.arch, '-target', self.target, - '-stdlib=libc++' ], 'extra_cflags': [ '-fembed-bitcode', '-isysroot', self.root_path, '-arch', self.arch, '-target', self.target, - '-stdlib=libc++', *('-I{}'.format(include_dir) for include_dir in self.get_include_dirs()) ], 'host_machine': { @@ -87,7 +85,6 @@ class ApplePlatformInfo(PlatformInfo): env['CFLAGS'] = ' '.join(cflags) env['CXXFLAGS'] = ' '.join([ env['CFLAGS'], - '-stdlib=libc++', '-std=c++11', env['CXXFLAGS'], ]) From 09dacaa25e6c2481877404bf3e2dd06257947a86 Mon Sep 17 00:00:00 2001 From: renaud gaudin Date: Tue, 7 Nov 2023 14:00:06 +0000 Subject: [PATCH 3/7] disabled bitcode support, as deprecated since xcode14 See https://stackoverflow.com/questions/72543728/xcode-14-deprecates-bitcode-but-why --- kiwixbuild/dependencies/libkiwix.py | 2 -- kiwixbuild/dependencies/libzim.py | 2 -- kiwixbuild/platforms/ios.py | 3 --- 3 files changed, 7 deletions(-) diff --git a/kiwixbuild/dependencies/libkiwix.py b/kiwixbuild/dependencies/libkiwix.py index 7960350..22c15d6 100644 --- a/kiwixbuild/dependencies/libkiwix.py +++ b/kiwixbuild/dependencies/libkiwix.py @@ -24,8 +24,6 @@ class Libkiwix(Dependency): platformInfo = self.buildEnv.platformInfo if platformInfo.build == 'android': return '-Dstatic-linkage=true -Dwerror=false' - if platformInfo.build == 'iOS': - return '-Db_bitcode=true' if platformInfo.name == 'flatpak': return '--wrap-mode=nodownload' if platformInfo.mixed and option('target') == 'libkiwix': diff --git a/kiwixbuild/dependencies/libzim.py b/kiwixbuild/dependencies/libzim.py index 0d96d75..a79cb76 100644 --- a/kiwixbuild/dependencies/libzim.py +++ b/kiwixbuild/dependencies/libzim.py @@ -30,8 +30,6 @@ class Libzim(Dependency): if platformInfo.build == 'android': config_options.append("-DUSE_BUFFER_HEADER=false") config_options.append("-Dstatic-linkage=true") - if platformInfo.build == 'iOS': - config_options.append("-Db_bitcode=true") if platformInfo.mixed and option('target') == 'libzim': config_options.append("-Dstatic-linkage=true") if platformInfo.name == "flatpak": diff --git a/kiwixbuild/platforms/ios.py b/kiwixbuild/platforms/ios.py index 5e591d3..ce86f87 100644 --- a/kiwixbuild/platforms/ios.py +++ b/kiwixbuild/platforms/ios.py @@ -40,13 +40,11 @@ class ApplePlatformInfo(PlatformInfo): 'binaries': self.binaries, 'exe_wrapper_def': '', 'extra_libs': [ - '-fembed-bitcode', '-isysroot', self.root_path, '-arch', self.arch, '-target', self.target, ], 'extra_cflags': [ - '-fembed-bitcode', '-isysroot', self.root_path, '-arch', self.arch, '-target', self.target, @@ -74,7 +72,6 @@ class ApplePlatformInfo(PlatformInfo): def set_comp_flags(self, env): super().set_comp_flags(env) cflags = [ - '-fembed-bitcode', '-isysroot {}'.format(self.root_path), '-arch {}'.format(self.arch), '-target {}'.format(self.target), From 7be0b3b586fb270db36f5a8ffc569d6b73d1c4e3 Mon Sep 17 00:00:00 2001 From: renaud gaudin Date: Tue, 7 Nov 2023 14:17:00 +0000 Subject: [PATCH 4/7] generalized min macOS/iOS target versions. bumped to iOS15 and macOS12 --- kiwixbuild/platforms/ios.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/kiwixbuild/platforms/ios.py b/kiwixbuild/platforms/ios.py index ce86f87..31273a9 100644 --- a/kiwixbuild/platforms/ios.py +++ b/kiwixbuild/platforms/ios.py @@ -14,6 +14,7 @@ class ApplePlatformInfo(PlatformInfo): target = None sdk_name = None min_iphoneos_version = None + min_macos_version = None def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -62,11 +63,19 @@ class ApplePlatformInfo(PlatformInfo): if self.min_iphoneos_version: config['extra_libs'].append('-miphoneos-version-min={}'.format(self.min_iphoneos_version)) config['extra_cflags'].append('-miphoneos-version-min={}'.format(self.min_iphoneos_version)) + if self.min_macos_version: + config['extra_libs'].append('-mmacosx-version-min={}'.format(self.min_macos_version)) + config['extra_cflags'].append('-mmacosx-version-min={}'.format(self.min_macos_version)) return config def get_env(self): env = super().get_env() - env['MACOSX_DEPLOYMENT_TARGET'] = '10.15' + cflags = [env['CFLAGS']] + if self.min_iphoneos_version: + cflags.append('-miphoneos-version-min={}'.format(self.min_iphoneos_version)) + if self.min_macos_version: + cflags.append('-mmacosx-version-min={}'.format(self.min_macos_version)) + env['CFLAGS'] = ' '.join(cflags) return env def set_comp_flags(self, env): @@ -116,7 +125,7 @@ class iOSArm64(ApplePlatformInfo): host = 'arm-apple-darwin' target = 'aarch64-apple-ios' sdk_name = 'iphoneos' - min_iphoneos_version = '13.0' + min_iphoneos_version = '15.0' class iOSx64(ApplePlatformInfo): @@ -125,7 +134,7 @@ class iOSx64(ApplePlatformInfo): host = 'x86_64-apple-darwin' target = 'x86_64-apple-ios' sdk_name = 'iphonesimulator' - min_iphoneos_version = '13.0' + min_iphoneos_version = '15.0' class iOSMacABI(ApplePlatformInfo): @@ -134,34 +143,37 @@ class iOSMacABI(ApplePlatformInfo): host = 'x86_64-apple-darwin' target = 'x86_64-apple-ios14.0-macabi' sdk_name = 'macosx' - min_iphoneos_version = '14.0' + min_iphoneos_version = '15.0' class macOSArm64(ApplePlatformInfo): name = 'macOS_arm64_static' arch = cpu = 'arm64' host = 'aarch64-apple-darwin' - target = 'arm64-apple-macos11' + target = 'arm64-apple-macos' sdk_name = 'macosx' min_iphoneos_version = None + min_macos_version = '12.0' class macOSArm64Mixed(MixedMixin('macOS_arm64_static'), ApplePlatformInfo): name = 'macOS_arm64_mixed' arch = cpu = 'arm64' host = 'aarch64-apple-darwin' - target = 'arm64-apple-macos11' + target = 'arm64-apple-macos' sdk_name = 'macosx' min_iphoneos_version = None + min_macos_version = '12.0' class macOSx64(ApplePlatformInfo): name = 'macOS_x86_64' arch = cpu = 'x86_64' host = 'x86_64-apple-darwin' - target = 'x86_64-apple-macos10.12' + target = 'x86_64-apple-macos' sdk_name = 'macosx' min_iphoneos_version = None + min_macos_version = '12.0' class IOS(MetaPlatformInfo): From 670bbb04177b5ff2cefbac21b6b503311120c4a5 Mon Sep 17 00:00:00 2001 From: renaud gaudin Date: Tue, 7 Nov 2023 14:18:35 +0000 Subject: [PATCH 5/7] removed iOSMacABI target as useless --- .github/scripts/build_definition.py | 1 - .github/workflows/ci.yml | 1 - kiwixbuild/platforms/ios.py | 9 --------- 3 files changed, 11 deletions(-) diff --git a/.github/scripts/build_definition.py b/.github/scripts/build_definition.py index a706daa..c59dcc0 100644 --- a/.github/scripts/build_definition.py +++ b/.github/scripts/build_definition.py @@ -27,7 +27,6 @@ BUILD_DEF = """ | macos | native_mixed | BP | BP | | | | macos-x86_64 | | macos | iOS_arm64 | dB | B | | | | | | macos | iOS_x86_64 | dB | B | | | | | - | macos | iOS_Mac_ABI | B | B | | | | | | macos | macOS_arm64_static | | | | | | | | macos | macOS_arm64_mixed | BP | BP | | | | macos-arm64 | | macos | macOS_x86_64 | B | B | | | | | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c32e223..77a0d44 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -148,7 +148,6 @@ jobs: - native_mixed - iOS_arm64 - iOS_x86_64 - - iOS_Mac_ABI - macOS_arm64_static - macOS_arm64_mixed - macOS_x86_64 diff --git a/kiwixbuild/platforms/ios.py b/kiwixbuild/platforms/ios.py index 31273a9..065a62c 100644 --- a/kiwixbuild/platforms/ios.py +++ b/kiwixbuild/platforms/ios.py @@ -137,15 +137,6 @@ class iOSx64(ApplePlatformInfo): min_iphoneos_version = '15.0' -class iOSMacABI(ApplePlatformInfo): - name = 'iOS_Mac_ABI' - arch = cpu = 'x86_64' - host = 'x86_64-apple-darwin' - target = 'x86_64-apple-ios14.0-macabi' - sdk_name = 'macosx' - min_iphoneos_version = '15.0' - - class macOSArm64(ApplePlatformInfo): name = 'macOS_arm64_static' arch = cpu = 'arm64' From 1000bfecbea79e0839a686d66f2cb6bf2475d77e Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Fri, 10 Nov 2023 11:47:31 +0100 Subject: [PATCH 6/7] Set `min_macos_version` also on native platform. `-min_macos_version` define our minimum targeted macos version. We need to set it even if we build native on macos. --- kiwixbuild/platforms/ios.py | 8 +++++--- kiwixbuild/platforms/native.py | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/kiwixbuild/platforms/ios.py b/kiwixbuild/platforms/ios.py index 065a62c..69cd54d 100644 --- a/kiwixbuild/platforms/ios.py +++ b/kiwixbuild/platforms/ios.py @@ -5,6 +5,8 @@ from kiwixbuild.utils import pj, xrun_find from .base import PlatformInfo, MetaPlatformInfo, MixedMixin +MIN_MACOS_VERSION = '12.0' + class ApplePlatformInfo(PlatformInfo): build = 'iOS' static = True @@ -144,7 +146,7 @@ class macOSArm64(ApplePlatformInfo): target = 'arm64-apple-macos' sdk_name = 'macosx' min_iphoneos_version = None - min_macos_version = '12.0' + min_macos_version = MIN_MACOS_VERSION class macOSArm64Mixed(MixedMixin('macOS_arm64_static'), ApplePlatformInfo): @@ -154,7 +156,7 @@ class macOSArm64Mixed(MixedMixin('macOS_arm64_static'), ApplePlatformInfo): target = 'arm64-apple-macos' sdk_name = 'macosx' min_iphoneos_version = None - min_macos_version = '12.0' + min_macos_version = MIN_MACOS_VERSION class macOSx64(ApplePlatformInfo): @@ -164,7 +166,7 @@ class macOSx64(ApplePlatformInfo): target = 'x86_64-apple-macos' sdk_name = 'macosx' min_iphoneos_version = None - min_macos_version = '12.0' + min_macos_version = MIN_MACOS_VERSION class IOS(MetaPlatformInfo): diff --git a/kiwixbuild/platforms/native.py b/kiwixbuild/platforms/native.py index 8e10401..94005a6 100644 --- a/kiwixbuild/platforms/native.py +++ b/kiwixbuild/platforms/native.py @@ -2,7 +2,7 @@ from .base import PlatformInfo, MixedMixin from kiwixbuild.utils import pj from kiwixbuild._global import option, neutralEnv - +from kiwixbuild.platforms.ios import MIN_MACOS_VERSION class NativePlatformInfo(PlatformInfo): build = 'native' @@ -11,6 +11,8 @@ class NativePlatformInfo(PlatformInfo): env = super().get_env() if neutralEnv('distname') == 'fedora': env['QT_SELECT'] = "5-64" + if neutralEnv('distname') == 'Darwin': + env['CFLAGS'] += ' '.join([env['CFLAGS'], f'-mmacosx-version-min={MIN_MACOS_VERSION}']) return env From 12b176bf85120fa76d25e72c0374d89fd6b6e55d Mon Sep 17 00:00:00 2001 From: renaud gaudin Date: Fri, 10 Nov 2023 11:25:32 +0000 Subject: [PATCH 7/7] fixed typo in native (using min-macos-version) --- kiwixbuild/platforms/native.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kiwixbuild/platforms/native.py b/kiwixbuild/platforms/native.py index 94005a6..deac809 100644 --- a/kiwixbuild/platforms/native.py +++ b/kiwixbuild/platforms/native.py @@ -11,8 +11,8 @@ class NativePlatformInfo(PlatformInfo): env = super().get_env() if neutralEnv('distname') == 'fedora': env['QT_SELECT'] = "5-64" - if neutralEnv('distname') == 'Darwin': - env['CFLAGS'] += ' '.join([env['CFLAGS'], f'-mmacosx-version-min={MIN_MACOS_VERSION}']) + if neutralEnv('distname') == 'Darwin': + env['CFLAGS'] += f'-mmacosx-version-min={MIN_MACOS_VERSION}' return env