diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d47dd0ab..cfac5329d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,10 +3,11 @@ name: CI on: # Every PR pull_request: - # Once merged into `master`, and on `ci-full` to enable testing a full run push: branches: + # Once merged into `master` - master + # And on `ci-full` to allow running time-consuming checks. - ci-full # Every monday at 09:00 in the morning schedule: @@ -44,13 +45,19 @@ env: --package=objc2-exception-helper # BEGIN AUTOMATICALLY GENERATED - FRAMEWORKS_MACOS_10_12: --package=objc2-accounts --package=objc2-app-kit --package=objc2-automator --package=objc2-av-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-image --package=objc2-core-location --package=objc2-core-wlan --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-input-method-kit --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-multipeer-connectivity --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-saver --package=objc2-service-management --package=objc2-social --package=objc2-store-kit --package=objc2-web-kit - FRAMEWORKS_MACOS_10_13: --package=objc2-accounts --package=objc2-app-kit --package=objc2-automator --package=objc2-av-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-wlan --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-external-accessory --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-input-method-kit --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-multipeer-connectivity --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-saver --package=objc2-service-management --package=objc2-social --package=objc2-store-kit --package=objc2-vision --package=objc2-web-kit + FRAMEWORKS_MACOS_10_12: --package=objc2-accounts --package=objc2-automator --package=objc2-av-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-image --package=objc2-core-location --package=objc2-core-wlan --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-input-method-kit --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-multipeer-connectivity --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-saver --package=objc2-service-management --package=objc2-social --package=objc2-store-kit --package=objc2-web-kit + FRAMEWORKS_MACOS_10_13: --package=objc2-accounts --package=objc2-automator --package=objc2-av-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-wlan --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-external-accessory --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-input-method-kit --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-multipeer-connectivity --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-saver --package=objc2-service-management --package=objc2-social --package=objc2-store-kit --package=objc2-vision --package=objc2-web-kit FRAMEWORKS_MACOS_11: --package=objc2-accessibility --package=objc2-accounts --package=objc2-ad-support --package=objc2-app-kit --package=objc2-app-tracking-transparency --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-kit --package=objc2-business-chat --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-wlan --package=objc2-device-check --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-external-accessory --package=objc2-file-provider --package=objc2-file-provider-ui --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-identity-lookup --package=objc2-input-method-kit --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-ml-compute --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-saver --package=objc2-service-management --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-system-extensions --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-virtualization --package=objc2-vision --package=objc2-web-kit FRAMEWORKS_MACOS_12: --package=objc2-accessibility --package=objc2-accounts --package=objc2-ad-services --package=objc2-ad-support --package=objc2-app-kit --package=objc2-app-tracking-transparency --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-kit --package=objc2-business-chat --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-wlan --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-external-accessory --package=objc2-file-provider --package=objc2-file-provider-ui --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-identity-lookup --package=objc2-input-method-kit --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-mail-kit --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-saver --package=objc2-service-management --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-system-extensions --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-virtualization --package=objc2-vision --package=objc2-web-kit FRAMEWORKS_MACOS_13: --package=objc2-accessibility --package=objc2-accounts --package=objc2-ad-services --package=objc2-ad-support --package=objc2-app-kit --package=objc2-app-tracking-transparency --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-kit --package=objc2-background-assets --package=objc2-business-chat --package=objc2-call-kit --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-wlan --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-extension-kit --package=objc2-external-accessory --package=objc2-file-provider --package=objc2-file-provider-ui --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-health-kit --package=objc2-identity-lookup --package=objc2-input-method-kit --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-mail-kit --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-capture-kit --package=objc2-screen-saver --package=objc2-service-management --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-system-extensions --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-virtualization --package=objc2-vision --package=objc2-web-kit FRAMEWORKS_MACOS_14: --package=objc2-accessibility --package=objc2-accounts --package=objc2-ad-services --package=objc2-ad-support --package=objc2-app-kit --package=objc2-app-tracking-transparency --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-kit --package=objc2-background-assets --package=objc2-business-chat --package=objc2-call-kit --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-wlan --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-extension-kit --package=objc2-external-accessory --package=objc2-file-provider --package=objc2-file-provider-ui --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-health-kit --package=objc2-identity-lookup --package=objc2-input-method-kit --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-mail-kit --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-capture-kit --package=objc2-screen-saver --package=objc2-sensitive-content-analysis --package=objc2-service-management --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-extensions --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-virtualization --package=objc2-vision --package=objc2-web-kit + FRAMEWORKS_MACOS_15: --package=objc2-accessibility --package=objc2-accounts --package=objc2-ad-services --package=objc2-ad-support --package=objc2-app-kit --package=objc2-app-tracking-transparency --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-kit --package=objc2-background-assets --package=objc2-business-chat --package=objc2-call-kit --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-wlan --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-extension-kit --package=objc2-external-accessory --package=objc2-file-provider --package=objc2-file-provider-ui --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-health-kit --package=objc2-identity-lookup --package=objc2-input-method-kit --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-mail-kit --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-capture-kit --package=objc2-screen-saver --package=objc2-sensitive-content-analysis --package=objc2-service-management --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-extensions --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-virtualization --package=objc2-vision --package=objc2-web-kit FRAMEWORKS_IOS_10: --package=objc2-accounts --package=objc2-ad-support --package=objc2-av-kit --package=objc2-call-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-image --package=objc2-core-location --package=objc2-core-motion --package=objc2-event-kit --package=objc2-external-accessory --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-health-kit --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-multipeer-connectivity --package=objc2-network-extension --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-social --package=objc2-speech --package=objc2-store-kit --package=objc2-ui-kit --package=objc2-user-notifications + FRAMEWORKS_IOS_17: --package=objc2-accessibility --package=objc2-accounts --package=objc2-ad-services --package=objc2-ad-support --package=objc2-app-tracking-transparency --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-av-kit --package=objc2-background-assets --package=objc2-background-tasks --package=objc2-business-chat --package=objc2-call-kit --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --package=objc2-extension-kit --package=objc2-external-accessory --package=objc2-file-provider --package=objc2-file-provider-ui --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-health-kit --package=objc2-identity-lookup --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-metric-kit --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-sensitive-content-analysis --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-symbols --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-vision --package=objc2-web-kit + FRAMEWORKS_TVOS_17: --package=objc2-accessibility --package=objc2-ad-support --package=objc2-app-tracking-transparency --package=objc2-authentication-services --package=objc2-av-kit --package=objc2-background-tasks --package=objc2-cloud-kit --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-data-detection --package=objc2-device-check --package=objc2-extension-kit --package=objc2-external-accessory --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-link-presentation --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-ml-compute --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-network-extension --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-sound-analysis --package=objc2-store-kit --package=objc2-symbols --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-vision + FRAMEWORKS_MAC_CATALYST_17: --package=objc2-accessibility --package=objc2-accounts --package=objc2-ad-services --package=objc2-ad-support --package=objc2-app-kit --package=objc2-app-tracking-transparency --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-kit --package=objc2-background-assets --package=objc2-background-tasks --package=objc2-business-chat --package=objc2-call-kit --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-wlan --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-extension-kit --package=objc2-external-accessory --package=objc2-file-provider-ui --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-health-kit --package=objc2-identity-lookup --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-sensitive-content-analysis --package=objc2-service-management --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-symbols --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-vision --package=objc2-web-kit + FRAMEWORKS_VISIONOS_1: --package=objc2-accessibility --package=objc2-ad-services --package=objc2-app-tracking-transparency --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-av-kit --package=objc2-background-assets --package=objc2-background-tasks --package=objc2-call-kit --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --package=objc2-extension-kit --package=objc2-external-accessory --package=objc2-file-provider --package=objc2-file-provider-ui --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-health-kit --package=objc2-identity-lookup --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metric-kit --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-network-extension --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-symbols --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-vision --package=objc2-web-kit + FRAMEWORKS_WATCHOS_10: --package=objc2-accessibility --package=objc2-authentication-services --package=objc2-av-kit --package=objc2-call-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --package=objc2-extension-kit --package=objc2-foundation --package=objc2-game-kit --package=objc2-health-kit --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-player --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-photos-ui --package=objc2-sound-analysis --package=objc2-store-kit --package=objc2-symbols --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications FRAMEWORKS_GNUSTEP: --package=objc2-app-kit --package=objc2-foundation # END AUTOMATICALLY GENERATED @@ -67,11 +74,6 @@ env: ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ - # Only enable time-consuming checks when about to do a new release - # - # This condition is duplicated a few places, since there's no good way to - # deduplicate such information in GitHub Actions... - FULL: ${{ (github.head_ref == 'new-versions' || github.ref_name == 'ci-full') && true || '' }} jobs: fmt: @@ -100,20 +102,32 @@ jobs: fail-fast: false matrix: include: - - name: macOS 64bit - target: aarch64-apple-darwin + # Check three major architectures (x86_64, Aarch64 and any 32bit), and + # test three OS'es (macOS, iOS and a more obscure one, visionOS simulator). + # + # This should give us fairly good coverage for normal PRs. + - name: macOS x86_64 + target: x86_64-apple-darwin args: $PUBLIC_CRATES $FRAMEWORKS_MACOS_14 $INTERESTING_FEATURES - - name: iOS 32bit + - name: iOS ARMv7s target: armv7s-apple-ios build-std: true # `cc` works poorly when cross-compiling, so let's ignore `objc2-exception-helper` for now. - args: --package=block2 --package=objc2 --package=objc2-encode --package=objc2-proc-macros $FRAMEWORKS_IOS_10 $INTERESTING_FEATURES -Zbuild-std + args: --package=block2 --package=objc2 --package=objc2-encode --package=objc2-proc-macros $FRAMEWORKS_IOS_17 $INTERESTING_FEATURES -Zbuild-std + - name: visionOS Aarch64 simulator + target: aarch64-apple-visionos-sim + build-std: true + # `cc` works poorly when cross-compiling, so let's ignore `objc2-exception-helper` for now. + args: --package=block2 --package=objc2 --package=objc2-encode --package=objc2-proc-macros $FRAMEWORKS_VISIONOS_1 $INTERESTING_FEATURES -Zbuild-std + - name: GNUStep + exceptions target: x86_64-unknown-linux-gnu args: $PUBLIC_CRATES $FRAMEWORKS_GNUSTEP $INTERESTING_FEATURES --features=gnustep-1-9,catch-all + - name: header-translator target: x86_64-unknown-linux-gnu args: -pheader-translator + - name: test-assembly target: x86_64-unknown-linux-gnu args: -ptest-assembly @@ -257,7 +271,7 @@ jobs: run: cargo run --bin=test-assembly -- -Z build-std --target=x86_64-apple-darwin - name: Run all assembly tests - if: ${{ env.FULL }} + if: ${{ github.ref_name == 'ci-full' }} run: ./helper-scripts/run-assembly-tests.sh - name: Check diff @@ -266,7 +280,7 @@ jobs: header-translator: name: Verify header translator output - runs-on: macos-15 + runs-on: macos-15 # Aarch64 needs: - fmt - lint @@ -295,11 +309,10 @@ jobs: run: git diff --exit-code --submodule=diff check-framework-features: - # if: ${{ env.FULL }} # This will take ~40 minutes - if: ${{ github.head_ref == 'new-versions' || github.ref_name == 'ci-full' }} + if: ${{ github.ref_name == 'ci-full' }} name: Check framework features - runs-on: macos-12 + runs-on: macos-15 # Aarch64 needs: - fmt - lint @@ -321,9 +334,11 @@ jobs: - name: Check frameworks with each feature enabled separately run: cargo run --bin=check_framework_features + # We make sure to have at least one check on macOS that actually runs the code, + # but all other tests are only run if absolutely needed (see `test-apple` below). test-macos: - name: Test macOS 12 - runs-on: macos-12 + name: Test macOS 15 Aarch64 + runs-on: macos-15 # Aarch64 needs: - fmt # Currently the slowest check, so let's get it started as soon as possible @@ -352,10 +367,9 @@ jobs: run: cargo test $PUBLIC_CRATES $FRAMEWORKS_MACOS_10_12 -ptests $INTERESTING_FEATURES test-apple: - # if: ${{ env.FULL }} - if: ${{ github.head_ref == 'new-versions' || github.ref_name == 'ci-full' }} - name: ${{ matrix.name }} - runs-on: ${{ matrix.os || 'macos-latest' }} + if: ${{ github.ref_name == 'ci-full' }} + name: ${{ matrix.test && 'Test' || 'Build' }} ${{ matrix.name }} + runs-on: ${{ matrix.os }} needs: - fmt - lint @@ -366,53 +380,83 @@ jobs: fail-fast: true matrix: include: - - name: Test macOS 13 + # Reasonably varied set of macOS targets. + - name: macOS 12 x86_64 target: x86_64-apple-darwin - os: macos-13 + os: macos-12 # x86_64 frameworks: MACOS_13 - - name: Test macOS 14 + test: true + - name: macOS 15 AArch64 target: aarch64-apple-darwin - os: macos-14 - frameworks: MACOS_14 - - name: Build macOS AArch64 - target: aarch64-apple-darwin - frameworks: MACOS_11 - - name: Test macOS old SDK - target: x86_64-apple-darwin - # Oldest macOS version we support - sdk: "10.12" - frameworks: MACOS_10_12 - # The SDK itself only supports compiling build scripts for x86_64 - os: macos-13 - - name: Test macOS nightly + os: macos-15 # Aarch64 + frameworks: MACOS_15 + test: true + - name: macOS 14 Aarch64 nightly target: aarch64-apple-darwin + os: macos-14 # Aarch64 + frameworks: MACOS_14 nightly: true - frameworks: MACOS_11 - - name: Build macOS 32bit + test: true + + # Old macOS targets. + - name: macOS 13 x86 with 10.13 SDK target: i686-apple-darwin + # The SDK itself only supports compiling build scripts for x86_64 + os: macos-13 # x86_64 + frameworks: MACOS_10_13 nightly: true build-std: true # Newest SDK that supports 32-bit sdk: "10.13" - frameworks: MACOS_10_13 - # The SDK itself only supports compiling build scripts for x86_64 - os: macos-13 - - name: Build iOS simulator ARM64 - target: aarch64-apple-ios-sim - frameworks: IOS_10 - - name: Build iOS ARM64 - target: aarch64-apple-ios - frameworks: IOS_10 - - name: Build iOS ARMv7s - target: armv7s-apple-ios + - name: macOS 13 x86_64 with 10.12 SDK + target: x86_64-apple-darwin + os: macos-13 # x86_64 + frameworks: MACOS_10_12 + # Oldest macOS version we support. + # The SDK itself only supports compiling build scripts for x86_64. + sdk: "10.12" + test: true + + # A reasonably varied set of iOS/tvOS/watchOS/visionOS targets. + - name: iOS x86_64 simulator + target: x86_64-apple-ios + os: macos-14 # Aarch64 + frameworks: IOS_17 + - name: Mac Catalyst Aarch64 + target: aarch64-apple-ios-macabi + os: macos-14 # Aarch64 + frameworks: MAC_CATALYST_17 + test: true + - name: visionOS Aarch64 + target: aarch64-apple-visionos + os: macos-14 # Aarch64 + frameworks: VISIONOS_1 nightly: true build-std: true + - name: tvOS Aarch64 + target: aarch64-apple-tvos + os: macos-14 # Aarch64 + frameworks: TVOS_17 + nightly: true + build-std: true + - name: watchOS ARM64_32 + target: arm64_32-apple-watchos + os: macos-14 # Aarch64 + frameworks: WATCHOS_10 + nightly: true + build-std: true + - name: iOS ARMv7s + target: armv7s-apple-ios + os: macos-14 # Aarch64 frameworks: IOS_10 - - name: Build iOS 32bit x86 - target: i386-apple-ios nightly: true build-std: true + - name: iOS x86 + target: i386-apple-ios + os: macos-14 # Aarch64 frameworks: IOS_10 + nightly: true + build-std: true env: CARGO_BUILD_TARGET: ${{ matrix.target }} @@ -420,7 +464,9 @@ jobs: # So we pass `--no-run` when building for other targets. ARGS: >- ${{ matrix.build-std && '-Zbuild-std -Zdoctest-xcompile' }} - ${{ matrix.target && '--no-run' }} + ${{ matrix.test && '' || '--no-run' }} + # Mac Catalyst requires a higher version. + IPHONEOS_DEPLOYMENT_TARGET: ${{ contains(matrix.target, 'macabi') && '13.1' || '10.0' }} steps: - uses: actions/checkout@v4 @@ -497,17 +543,16 @@ jobs: # TODO: Re-enable this on all of Foundation once we do some form of # availability checking. - name: Test static class and selectors - if: ${{ !contains(matrix.frameworks, 'IOS') && !contains(matrix.frameworks, 'MACOS_10_12') }} + if: ${{ matrix.frameworks == 'MACOS_15' }} run: >- cargo test $ARGS $PUBLIC_CRATES -ptests -pobjc2-foundation --features=unstable-static-sel,unstable-static-class,unstable-static-nsstring --features=NSString test-ios: - # if: ${{ env.FULL }} - if: ${{ github.head_ref == 'new-versions' || github.ref_name == 'ci-full' }} + if: ${{ github.ref_name == 'ci-full' }} name: Test on iOS simulator w. dinghy - runs-on: macos-13 + runs-on: macos-13 # x86_64 needs: - fmt - lint @@ -752,12 +797,12 @@ jobs: run: cargo test --features=${{ matrix.runtime }} $PUBLIC_CRATES $INTERESTING_FEATURES -ptests -pobjc2-foundation --features=catch-all - name: Test all frameworks - if: ${{ env.FULL && matrix.target == 'x86_64-unknown-linux-gnu' }} + if: ${{ github.ref_name == 'ci-full' && matrix.target == 'x86_64-unknown-linux-gnu' }} run: cargo test --features=${{ matrix.runtime }} $PUBLIC_CRATES $INTERESTING_FEATURES -ptests $FRAMEWORKS_GNUSTEP --features=catch-all - name: Test in release mode # Disabled on GNUStep 2.1 for now - if: ${{ env.FULL && matrix.runtime != 'gnustep-2-1' }} + if: ${{ github.ref_name == 'ci-full' && matrix.runtime != 'gnustep-2-1' }} run: cargo test --features=${{ matrix.runtime }} $PUBLIC_CRATES -pobjc2-foundation --release - name: Run fuzzing diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 63f0ffa43..de2048c23 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -73,7 +73,7 @@ If you're confused about this, don't worry too much about it, if you enable Copy and fill out the following checklist into the release PR: ```markdown -- [ ] The branch is named `new-versions`, such that the full CI will run. +- [ ] The branch is named `ci-full`, such that the full CI will run. - [ ] Changelogs have only been modified under the `Unreleased` header. - [ ] Version numbers are bumped in the following order: - `objc2-proc-macros` diff --git a/crates/header-translator/src/main.rs b/crates/header-translator/src/main.rs index 07fb80520..3bfe88033 100644 --- a/crates/header-translator/src/main.rs +++ b/crates/header-translator/src/main.rs @@ -490,7 +490,7 @@ fn update_ci(workspace_dir: &Path, config: &Config) -> io::Result<()> { .is_some_and(|v| VersionReq::parse("<=10.12").unwrap().matches(v)) // HACK: These depend on `objc2-uniform-type-identifiers`, which // is not available on macOS 10.12, but will be enabled by `"all"` - && !["objc2-file-provider", "objc2-health-kit", "objc2-photos"].contains(&&*lib.krate) + && !["objc2-app-kit", "objc2-file-provider", "objc2-health-kit", "objc2-photos"].contains(&&*lib.krate) })?; writer(&mut ci, config, "FRAMEWORKS_MACOS_10_13", |lib| { lib.macos @@ -498,7 +498,7 @@ fn update_ci(workspace_dir: &Path, config: &Config) -> io::Result<()> { .is_some_and(|v| VersionReq::parse("<=10.13").unwrap().matches(v)) // HACK: These depend on `objc2-uniform-type-identifiers`, which // is not available on macOS 10.13, but will be enabled by `"all"` - && !["objc2-file-provider", "objc2-health-kit", "objc2-photos"].contains(&&*lib.krate) + && !["objc2-app-kit", "objc2-file-provider", "objc2-health-kit", "objc2-photos"].contains(&&*lib.krate) })?; writer(&mut ci, config, "FRAMEWORKS_MACOS_11", |lib| { lib.macos @@ -520,11 +520,43 @@ fn update_ci(workspace_dir: &Path, config: &Config) -> io::Result<()> { .as_ref() .is_some_and(|v| VersionReq::parse("<=14.0").unwrap().matches(v)) })?; + writer(&mut ci, config, "FRAMEWORKS_MACOS_15", |lib| { + lib.macos + .as_ref() + .is_some_and(|v| VersionReq::parse("<=15.0").unwrap().matches(v)) + })?; writer(&mut ci, config, "FRAMEWORKS_IOS_10", |lib| { lib.ios .as_ref() .is_some_and(|v| VersionReq::parse("<=10.0").unwrap().matches(v)) })?; + writer(&mut ci, config, "FRAMEWORKS_IOS_17", |lib| { + lib.ios + .as_ref() + .is_some_and(|v| VersionReq::parse("<=17.0").unwrap().matches(v)) + // HACK: MLCompute and MetalFX are only available on Aarch64 + && !["objc2-ml-compute", "objc2-metal-fx"].contains(&&*lib.krate) + })?; + writer(&mut ci, config, "FRAMEWORKS_TVOS_17", |lib| { + lib.tvos + .as_ref() + .is_some_and(|v| VersionReq::parse("<=17.0").unwrap().matches(v)) + })?; + writer(&mut ci, config, "FRAMEWORKS_MAC_CATALYST_17", |lib| { + lib.maccatalyst + .as_ref() + .is_some_and(|v| VersionReq::parse("<=17.0").unwrap().matches(v)) + })?; + writer(&mut ci, config, "FRAMEWORKS_VISIONOS_1", |lib| { + lib.visionos + .as_ref() + .is_some_and(|v| VersionReq::parse("<=1.0").unwrap().matches(v)) + })?; + writer(&mut ci, config, "FRAMEWORKS_WATCHOS_10", |lib| { + lib.watchos + .as_ref() + .is_some_and(|v| VersionReq::parse("<=10.0").unwrap().matches(v)) + })?; writer(&mut ci, config, "FRAMEWORKS_GNUSTEP", |lib| lib.gnustep)?; write!(&mut ci, " # END AUTOMATICALLY GENERATED{after}")?; diff --git a/crates/objc2/Cargo.toml b/crates/objc2/Cargo.toml index 7d99d14dd..2c5591e65 100644 --- a/crates/objc2/Cargo.toml +++ b/crates/objc2/Cargo.toml @@ -123,6 +123,7 @@ static_assertions = "1.1.0" memoffset = "0.9.0" block2 = { path = "../block2", default-features = false } objc2-foundation = { path = "../../framework-crates/objc2-foundation", default-features = false, features = [ + "NSArray", "NSDate", "NSDictionary", "NSEnumerator", diff --git a/framework-crates/objc2-metal/examples/triangle.rs b/framework-crates/objc2-metal/examples/triangle.rs index 19314d92a..5d8b796f4 100644 --- a/framework-crates/objc2-metal/examples/triangle.rs +++ b/framework-crates/objc2-metal/examples/triangle.rs @@ -1,5 +1,6 @@ #![deny(unsafe_op_in_unsafe_fn)] #![allow(clippy::incompatible_msrv)] +#![cfg_attr(not(target_os = "macos"), allow(dead_code, unused))] use core::{cell::OnceCell, ptr::NonNull}; @@ -8,6 +9,7 @@ use objc2::runtime::ProtocolObject; use objc2::{ declare_class, msg_send_id, ClassType, DeclaredClass, MainThreadMarker, MainThreadOnly, }; +#[cfg(target_os = "macos")] use objc2_app_kit::{ NSApplication, NSApplicationActivationPolicy, NSApplicationDelegate, NSBackingStoreType, NSWindow, NSWindowStyleMask, @@ -20,6 +22,7 @@ use objc2_metal::{ MTLLibrary, MTLPackedFloat3, MTLPrimitiveType, MTLRenderCommandEncoder, MTLRenderPipelineDescriptor, MTLRenderPipelineState, }; +#[cfg(target_os = "macos")] use objc2_metal_kit::{MTKView, MTKViewDelegate}; #[derive(Copy, Clone)] @@ -58,6 +61,7 @@ struct Ivars { start_date: Retained, command_queue: OnceCell>>, pipeline_state: OnceCell>>, + #[cfg(target_os = "macos")] window: OnceCell>, } @@ -82,6 +86,7 @@ declare_class!( unsafe impl NSObjectProtocol for Delegate {} // define the delegate methods for the `NSApplicationDelegate` protocol + #[cfg(target_os = "macos")] unsafe impl NSApplicationDelegate for Delegate { #[method(applicationDidFinishLaunching:)] #[allow(non_snake_case)] @@ -176,6 +181,7 @@ declare_class!( } // define the delegate methods for the `MTKViewDelegate` protocol + #[cfg(target_os = "macos")] // TODO: Support iOS unsafe impl MTKViewDelegate for Delegate { #[method(drawInMTKView:)] #[allow(non_snake_case)] @@ -288,12 +294,14 @@ impl Delegate { start_date: unsafe { NSDate::now() }, command_queue: OnceCell::default(), pipeline_state: OnceCell::default(), + #[cfg(target_os = "macos")] window: OnceCell::default(), }); unsafe { msg_send_id![super(this), init] } } } +#[cfg(target_os = "macos")] fn main() { let mtm = MainThreadMarker::new().unwrap(); // configure the app @@ -308,3 +316,8 @@ fn main() { // run the app app.run(); } + +#[cfg(not(target_os = "macos"))] +fn main() { + panic!("This example is currently only supported on macOS"); +} diff --git a/framework-crates/objc2-web-kit/examples/browser.rs b/framework-crates/objc2-web-kit/examples/browser.rs index b8768f24b..0d49c05f2 100644 --- a/framework-crates/objc2-web-kit/examples/browser.rs +++ b/framework-crates/objc2-web-kit/examples/browser.rs @@ -1,5 +1,6 @@ #![deny(unsafe_op_in_unsafe_fn)] #![allow(clippy::incompatible_msrv)] +#![cfg_attr(not(target_os = "macos"), allow(dead_code, unused))] use core::cell::OnceCell; use objc2::{ @@ -9,6 +10,7 @@ use objc2::{ sel, ClassType, DeclaredClass, MainThreadMarker, MainThreadOnly, }; #[allow(deprecated)] +#[cfg(target_os = "macos")] use objc2_app_kit::{ NSApplication, NSApplicationActivationPolicy, NSApplicationDelegate, NSBackingStoreType, NSBezelStyle, NSButton, NSColor, NSControl, NSControlTextEditingDelegate, NSLayoutAttribute, @@ -19,6 +21,7 @@ use objc2_foundation::{ ns_string, NSNotification, NSObject, NSObjectProtocol, NSPoint, NSRect, NSSize, NSURLRequest, NSURL, }; +#[cfg(target_os = "macos")] use objc2_web_kit::{WKNavigation, WKNavigationDelegate, WKWebView}; macro_rules! idcell { @@ -41,8 +44,11 @@ macro_rules! idcell { #[derive(Default)] struct Ivars { + #[cfg(target_os = "macos")] nav_url: OnceCell>, + #[cfg(target_os = "macos")] web_view: OnceCell>, + #[cfg(target_os = "macos")] window: OnceCell>, } @@ -65,6 +71,7 @@ declare_class!( unsafe impl NSObjectProtocol for Delegate {} + #[cfg(target_os = "macos")] unsafe impl NSApplicationDelegate for Delegate { #[method(applicationDidFinishLaunching:)] #[allow(non_snake_case)] @@ -245,6 +252,7 @@ declare_class!( } } + #[cfg(target_os = "macos")] unsafe impl NSControlTextEditingDelegate for Delegate { #[method(control:textView:doCommandBySelector:)] #[allow(non_snake_case)] @@ -265,8 +273,10 @@ declare_class!( } } + #[cfg(target_os = "macos")] unsafe impl NSTextFieldDelegate for Delegate {} + #[cfg(target_os = "macos")] // TODO: Enable this on iOS unsafe impl WKNavigationDelegate for Delegate { #[method(webView:didFinishNavigation:)] #[allow(non_snake_case)] @@ -293,6 +303,7 @@ impl Delegate { } } +#[cfg(target_os = "macos")] fn main() { let mtm = MainThreadMarker::new().unwrap(); let app = NSApplication::sharedApplication(mtm); @@ -306,3 +317,8 @@ fn main() { // run the app app.run(); } + +#[cfg(not(target_os = "macos"))] +fn main() { + panic!("This example is currently only supported on macOS"); +} diff --git a/helper-scripts/test-local.sh b/helper-scripts/test-local.sh index c5d636816..08557fd58 100644 --- a/helper-scripts/test-local.sh +++ b/helper-scripts/test-local.sh @@ -6,7 +6,7 @@ set -euxo pipefail export CARGO_TARGET_DIR=$HOME/Desktop/objc2-target export MACOSX_DEPLOYMENT_TARGET=10.12 export CRATES='--package=block2 --package=objc2 --package=objc2-encode --package=objc2-proc-macros --package=tests' -export FRAMEWORKS_MACOS_10_12='--package=objc2-accounts --package=objc2-app-kit --package=objc2-automator --package=objc2-av-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-image --package=objc2-core-location --package=objc2-core-wlan --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-input-method-kit --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-multipeer-connectivity --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-saver --package=objc2-service-management --package=objc2-social --package=objc2-store-kit --package=objc2-web-kit' +export FRAMEWORKS_MACOS_10_12='--package=objc2-accounts --package=objc2-automator --package=objc2-av-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-image --package=objc2-core-location --package=objc2-core-wlan --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-input-method-kit --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-multipeer-connectivity --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-saver --package=objc2-service-management --package=objc2-social --package=objc2-store-kit --package=objc2-web-kit' export FRAMEWORKS_IOS_9='--package=objc2-foundation --package=objc2-metal' # Test on macOS 32bit