diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c0274f60..57b19b159 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,17 +48,17 @@ env: # BEGIN AUTOMATICALLY GENERATED FRAMEWORKS_MACOS_10_12: --package=objc2-accounts --package=objc2-app-kit --package=objc2-application-services --package=objc2-audio-toolbox --package=objc2-automator --package=objc2-carbon --package=objc2-cf-network --package=objc2-cloud-kit --package=objc2-collaboration --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-kit --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-media-io --package=objc2-core-midi --package=objc2-core-services --package=objc2-core-telephony --package=objc2-core-text --package=objc2-core-video --package=objc2-core-wlan --package=objc2-crypto-token-kit --package=objc2-disk-arbitration --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-gameplay-kit --package=objc2-gl-kit --package=objc2-image-capture-core --package=objc2-image-io --package=objc2-input-method-kit --package=objc2-io-bluetooth --package=objc2-io-bluetooth-ui --package=objc2-io-kit --package=objc2-io-surface --package=objc2-javascript-core --package=objc2-latent-semantic-mapping --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-accessibility --package=objc2-media-toolbox --package=objc2-metal --package=objc2-metal-kit --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-network-extension --package=objc2-notification-center --package=objc2-open-directory --package=objc2-open-gl --package=objc2-osa-kit --package=objc2-preference-panes --package=objc2-quartz --package=objc2-quartz-core --package=objc2-quick-look --package=objc2-safari-services --package=objc2-screen-saver --package=objc2-scripting-bridge --package=objc2-security --package=objc2-security-foundation --package=objc2-security-interface --package=objc2-service-management --package=objc2-social --package=objc2-store-kit --package=objc2-system-configuration --package=objc2-video-toolbox --package=objc2-web-kit FRAMEWORKS_MACOS_10_13: --package=objc2-accounts --package=objc2-app-kit --package=objc2-application-services --package=objc2-audio-toolbox --package=objc2-automator --package=objc2-carbon --package=objc2-cf-network --package=objc2-cloud-kit --package=objc2-collaboration --package=objc2-color-sync --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-kit --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-media-io --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-services --package=objc2-core-spotlight --package=objc2-core-telephony --package=objc2-core-text --package=objc2-core-video --package=objc2-core-wlan --package=objc2-crypto-token-kit --package=objc2-disk-arbitration --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-gameplay-kit --package=objc2-gl-kit --package=objc2-image-capture-core --package=objc2-image-io --package=objc2-input-method-kit --package=objc2-io-bluetooth --package=objc2-io-bluetooth-ui --package=objc2-io-kit --package=objc2-io-surface --package=objc2-javascript-core --package=objc2-latent-semantic-mapping --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-accessibility --package=objc2-media-toolbox --package=objc2-metal --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-network-extension --package=objc2-notification-center --package=objc2-open-directory --package=objc2-open-gl --package=objc2-osa-kit --package=objc2-preference-panes --package=objc2-quartz --package=objc2-quartz-core --package=objc2-quick-look --package=objc2-safari-services --package=objc2-screen-saver --package=objc2-scripting-bridge --package=objc2-security --package=objc2-security-foundation --package=objc2-security-interface --package=objc2-service-management --package=objc2-social --package=objc2-store-kit --package=objc2-system-configuration --package=objc2-video-toolbox --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-application-services --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-avf-audio --package=objc2-business-chat --package=objc2-carbon --package=objc2-cf-network --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-collaboration --package=objc2-color-sync --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-kit --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-media-io --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-services --package=objc2-core-spotlight --package=objc2-core-telephony --package=objc2-core-text --package=objc2-core-video --package=objc2-core-wlan --package=objc2-crypto-token-kit --package=objc2-device-check --package=objc2-disk-arbitration --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-execution-policy --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-gameplay-kit --package=objc2-gl-kit --package=objc2-identity-lookup --package=objc2-image-capture-core --package=objc2-image-io --package=objc2-input-method-kit --package=objc2-io-bluetooth --package=objc2-io-bluetooth-ui --package=objc2-io-kit --package=objc2-io-surface --package=objc2-io-usb-host --package=objc2-itunes-library --package=objc2-javascript-core --package=objc2-latent-semantic-mapping --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-accessibility --package=objc2-media-player --package=objc2-media-toolbox --package=objc2-metal --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-ml-compute --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-notification-center --package=objc2-open-directory --package=objc2-open-gl --package=objc2-os-log --package=objc2-osa-kit --package=objc2-paravirtualized-graphics --package=objc2-pass-kit --package=objc2-pdf-kit --package=objc2-pencil-kit --package=objc2-photos --package=objc2-photos-ui --package=objc2-preference-panes --package=objc2-push-kit --package=objc2-quartz --package=objc2-quartz-core --package=objc2-quick-look --package=objc2-quick-look-thumbnailing --package=objc2-replay-kit --package=objc2-safari-services --package=objc2-scene-kit --package=objc2-screen-saver --package=objc2-screen-time --package=objc2-scripting-bridge --package=objc2-security --package=objc2-security-foundation --package=objc2-security-interface --package=objc2-service-management --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-system-configuration --package=objc2-system-extensions --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-user-notifications-ui --package=objc2-video-subscriber-account --package=objc2-video-toolbox --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-application-services --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-avf-audio --package=objc2-business-chat --package=objc2-carbon --package=objc2-cf-network --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-collaboration --package=objc2-color-sync --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-kit --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-media-io --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-services --package=objc2-core-spotlight --package=objc2-core-telephony --package=objc2-core-text --package=objc2-core-video --package=objc2-core-wlan --package=objc2-crypto-token-kit --package=objc2-data-detection --package=objc2-device-check --package=objc2-disk-arbitration --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-execution-policy --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-gameplay-kit --package=objc2-gl-kit --package=objc2-identity-lookup --package=objc2-image-capture-core --package=objc2-image-io --package=objc2-input-method-kit --package=objc2-intents --package=objc2-intents-ui --package=objc2-io-bluetooth --package=objc2-io-bluetooth-ui --package=objc2-io-kit --package=objc2-io-surface --package=objc2-io-usb-host --package=objc2-itunes-library --package=objc2-javascript-core --package=objc2-latent-semantic-mapping --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-accessibility --package=objc2-media-player --package=objc2-media-toolbox --package=objc2-metal --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-notification-center --package=objc2-open-directory --package=objc2-open-gl --package=objc2-os-log --package=objc2-osa-kit --package=objc2-paravirtualized-graphics --package=objc2-pass-kit --package=objc2-pdf-kit --package=objc2-pencil-kit --package=objc2-phase --package=objc2-photos --package=objc2-photos-ui --package=objc2-preference-panes --package=objc2-push-kit --package=objc2-quartz --package=objc2-quartz-core --package=objc2-quick-look --package=objc2-quick-look-thumbnailing --package=objc2-quick-look-ui --package=objc2-replay-kit --package=objc2-safari-services --package=objc2-scene-kit --package=objc2-screen-saver --package=objc2-screen-time --package=objc2-scripting-bridge --package=objc2-security --package=objc2-security-foundation --package=objc2-security-interface --package=objc2-service-management --package=objc2-shazam-kit --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-system-configuration --package=objc2-system-extensions --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-user-notifications-ui --package=objc2-video-subscriber-account --package=objc2-video-toolbox --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-application-services --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-av-routing --package=objc2-avf-audio --package=objc2-background-assets --package=objc2-business-chat --package=objc2-call-kit --package=objc2-carbon --package=objc2-cf-network --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-collaboration --package=objc2-color-sync --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-kit --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-media-io --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-services --package=objc2-core-spotlight --package=objc2-core-telephony --package=objc2-core-text --package=objc2-core-video --package=objc2-core-wlan --package=objc2-crypto-token-kit --package=objc2-data-detection --package=objc2-device-check --package=objc2-disk-arbitration --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-execution-policy --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-gameplay-kit --package=objc2-gl-kit --package=objc2-health-kit --package=objc2-identity-lookup --package=objc2-image-capture-core --package=objc2-image-io --package=objc2-input-method-kit --package=objc2-intents --package=objc2-intents-ui --package=objc2-io-bluetooth --package=objc2-io-bluetooth-ui --package=objc2-io-kit --package=objc2-io-surface --package=objc2-io-usb-host --package=objc2-itunes-library --package=objc2-javascript-core --package=objc2-latent-semantic-mapping --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-accessibility --package=objc2-media-player --package=objc2-media-toolbox --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-notification-center --package=objc2-open-directory --package=objc2-open-gl --package=objc2-os-log --package=objc2-osa-kit --package=objc2-paravirtualized-graphics --package=objc2-pass-kit --package=objc2-pdf-kit --package=objc2-pencil-kit --package=objc2-phase --package=objc2-photos --package=objc2-photos-ui --package=objc2-preference-panes --package=objc2-push-kit --package=objc2-quartz --package=objc2-quartz-core --package=objc2-quick-look --package=objc2-quick-look-thumbnailing --package=objc2-quick-look-ui --package=objc2-replay-kit --package=objc2-safari-services --package=objc2-safety-kit --package=objc2-scene-kit --package=objc2-screen-capture-kit --package=objc2-screen-saver --package=objc2-screen-time --package=objc2-scripting-bridge --package=objc2-security --package=objc2-security-foundation --package=objc2-security-interface --package=objc2-service-management --package=objc2-shared-with-you --package=objc2-shared-with-you-core --package=objc2-shazam-kit --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-system-configuration --package=objc2-system-extensions --package=objc2-thread-network --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-user-notifications-ui --package=objc2-video-subscriber-account --package=objc2-video-toolbox --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-application-services --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-av-routing --package=objc2-avf-audio --package=objc2-background-assets --package=objc2-business-chat --package=objc2-call-kit --package=objc2-carbon --package=objc2-cf-network --package=objc2-cinematic --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-collaboration --package=objc2-color-sync --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-kit --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-media-io --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-services --package=objc2-core-spotlight --package=objc2-core-telephony --package=objc2-core-text --package=objc2-core-video --package=objc2-core-wlan --package=objc2-crypto-token-kit --package=objc2-data-detection --package=objc2-device-check --package=objc2-disk-arbitration --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-execution-policy --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-gameplay-kit --package=objc2-gl-kit --package=objc2-health-kit --package=objc2-identity-lookup --package=objc2-image-capture-core --package=objc2-image-io --package=objc2-input-method-kit --package=objc2-intents --package=objc2-intents-ui --package=objc2-io-bluetooth --package=objc2-io-bluetooth-ui --package=objc2-io-kit --package=objc2-io-surface --package=objc2-io-usb-host --package=objc2-itunes-library --package=objc2-javascript-core --package=objc2-latent-semantic-mapping --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-accessibility --package=objc2-media-player --package=objc2-media-toolbox --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-notification-center --package=objc2-open-directory --package=objc2-open-gl --package=objc2-os-log --package=objc2-osa-kit --package=objc2-paravirtualized-graphics --package=objc2-pass-kit --package=objc2-pdf-kit --package=objc2-pencil-kit --package=objc2-phase --package=objc2-photos --package=objc2-photos-ui --package=objc2-preference-panes --package=objc2-push-kit --package=objc2-quartz --package=objc2-quartz-core --package=objc2-quick-look --package=objc2-quick-look-thumbnailing --package=objc2-quick-look-ui --package=objc2-replay-kit --package=objc2-safari-services --package=objc2-safety-kit --package=objc2-scene-kit --package=objc2-screen-capture-kit --package=objc2-screen-saver --package=objc2-screen-time --package=objc2-scripting-bridge --package=objc2-security --package=objc2-security-foundation --package=objc2-security-interface --package=objc2-sensitive-content-analysis --package=objc2-service-management --package=objc2-shared-with-you --package=objc2-shared-with-you-core --package=objc2-shazam-kit --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-configuration --package=objc2-system-extensions --package=objc2-thread-network --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-user-notifications-ui --package=objc2-video-subscriber-account --package=objc2-video-toolbox --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-application-services --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-av-routing --package=objc2-avf-audio --package=objc2-background-assets --package=objc2-business-chat --package=objc2-call-kit --package=objc2-carbon --package=objc2-cf-network --package=objc2-cinematic --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-collaboration --package=objc2-color-sync --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-kit --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-media-io --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-services --package=objc2-core-spotlight --package=objc2-core-telephony --package=objc2-core-text --package=objc2-core-video --package=objc2-core-wlan --package=objc2-crypto-token-kit --package=objc2-data-detection --package=objc2-device-check --package=objc2-device-discovery-extension --package=objc2-disk-arbitration --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-execution-policy --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-gameplay-kit --package=objc2-gl-kit --package=objc2-health-kit --package=objc2-identity-lookup --package=objc2-image-capture-core --package=objc2-image-io --package=objc2-input-method-kit --package=objc2-intents --package=objc2-intents-ui --package=objc2-io-bluetooth --package=objc2-io-bluetooth-ui --package=objc2-io-kit --package=objc2-io-surface --package=objc2-io-usb-host --package=objc2-itunes-library --package=objc2-javascript-core --package=objc2-latent-semantic-mapping --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-accessibility --package=objc2-media-extension --package=objc2-media-player --package=objc2-media-toolbox --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-notification-center --package=objc2-open-directory --package=objc2-open-gl --package=objc2-os-log --package=objc2-osa-kit --package=objc2-paravirtualized-graphics --package=objc2-pass-kit --package=objc2-pdf-kit --package=objc2-pencil-kit --package=objc2-phase --package=objc2-photos --package=objc2-photos-ui --package=objc2-preference-panes --package=objc2-push-kit --package=objc2-quartz --package=objc2-quartz-core --package=objc2-quick-look --package=objc2-quick-look-thumbnailing --package=objc2-quick-look-ui --package=objc2-replay-kit --package=objc2-safari-services --package=objc2-safety-kit --package=objc2-scene-kit --package=objc2-screen-capture-kit --package=objc2-screen-saver --package=objc2-screen-time --package=objc2-scripting-bridge --package=objc2-security --package=objc2-security-foundation --package=objc2-security-interface --package=objc2-sensitive-content-analysis --package=objc2-service-management --package=objc2-shared-with-you --package=objc2-shared-with-you-core --package=objc2-shazam-kit --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-configuration --package=objc2-system-extensions --package=objc2-thread-network --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-user-notifications-ui --package=objc2-video-subscriber-account --package=objc2-video-toolbox --package=objc2-virtualization --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-application-services --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-avf-audio --package=objc2-business-chat --package=objc2-carbon --package=objc2-cf-network --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-collaboration --package=objc2-color-sync --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-kit --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-media-io --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-services --package=objc2-core-spotlight --package=objc2-core-telephony --package=objc2-core-text --package=objc2-core-video --package=objc2-core-wlan --package=objc2-crypto-token-kit --package=objc2-device-check --package=objc2-disk-arbitration --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-execution-policy --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-gameplay-kit --package=objc2-gl-kit --package=objc2-identity-lookup --package=objc2-image-capture-core --package=objc2-image-io --package=objc2-input-method-kit --package=objc2-io-bluetooth --package=objc2-io-bluetooth-ui --package=objc2-io-kit --package=objc2-io-surface --package=objc2-io-usb-host --package=objc2-itunes-library --package=objc2-javascript-core --package=objc2-latent-semantic-mapping --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-accessibility --package=objc2-media-player --package=objc2-media-toolbox --package=objc2-metal --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-ml-compute --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network --package=objc2-network-extension --package=objc2-notification-center --package=objc2-open-directory --package=objc2-open-gl --package=objc2-os-log --package=objc2-osa-kit --package=objc2-paravirtualized-graphics --package=objc2-pass-kit --package=objc2-pdf-kit --package=objc2-pencil-kit --package=objc2-photos --package=objc2-photos-ui --package=objc2-preference-panes --package=objc2-push-kit --package=objc2-quartz --package=objc2-quartz-core --package=objc2-quick-look --package=objc2-quick-look-thumbnailing --package=objc2-replay-kit --package=objc2-safari-services --package=objc2-scene-kit --package=objc2-screen-saver --package=objc2-screen-time --package=objc2-scripting-bridge --package=objc2-security --package=objc2-security-foundation --package=objc2-security-interface --package=objc2-service-management --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-system-configuration --package=objc2-system-extensions --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-user-notifications-ui --package=objc2-video-subscriber-account --package=objc2-video-toolbox --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-application-services --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-avf-audio --package=objc2-business-chat --package=objc2-carbon --package=objc2-cf-network --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-collaboration --package=objc2-color-sync --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-kit --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-media-io --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-services --package=objc2-core-spotlight --package=objc2-core-telephony --package=objc2-core-text --package=objc2-core-video --package=objc2-core-wlan --package=objc2-crypto-token-kit --package=objc2-data-detection --package=objc2-device-check --package=objc2-disk-arbitration --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-execution-policy --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-gameplay-kit --package=objc2-gl-kit --package=objc2-identity-lookup --package=objc2-image-capture-core --package=objc2-image-io --package=objc2-input-method-kit --package=objc2-intents --package=objc2-intents-ui --package=objc2-io-bluetooth --package=objc2-io-bluetooth-ui --package=objc2-io-kit --package=objc2-io-surface --package=objc2-io-usb-host --package=objc2-itunes-library --package=objc2-javascript-core --package=objc2-latent-semantic-mapping --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-accessibility --package=objc2-media-player --package=objc2-media-toolbox --package=objc2-metal --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network --package=objc2-network-extension --package=objc2-notification-center --package=objc2-open-directory --package=objc2-open-gl --package=objc2-os-log --package=objc2-osa-kit --package=objc2-paravirtualized-graphics --package=objc2-pass-kit --package=objc2-pdf-kit --package=objc2-pencil-kit --package=objc2-phase --package=objc2-photos --package=objc2-photos-ui --package=objc2-preference-panes --package=objc2-push-kit --package=objc2-quartz --package=objc2-quartz-core --package=objc2-quick-look --package=objc2-quick-look-thumbnailing --package=objc2-quick-look-ui --package=objc2-replay-kit --package=objc2-safari-services --package=objc2-scene-kit --package=objc2-screen-saver --package=objc2-screen-time --package=objc2-scripting-bridge --package=objc2-security --package=objc2-security-foundation --package=objc2-security-interface --package=objc2-service-management --package=objc2-shazam-kit --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-system-configuration --package=objc2-system-extensions --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-user-notifications-ui --package=objc2-video-subscriber-account --package=objc2-video-toolbox --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-application-services --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-av-routing --package=objc2-avf-audio --package=objc2-background-assets --package=objc2-business-chat --package=objc2-call-kit --package=objc2-carbon --package=objc2-cf-network --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-collaboration --package=objc2-color-sync --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-kit --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-media-io --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-services --package=objc2-core-spotlight --package=objc2-core-telephony --package=objc2-core-text --package=objc2-core-video --package=objc2-core-wlan --package=objc2-crypto-token-kit --package=objc2-data-detection --package=objc2-device-check --package=objc2-disk-arbitration --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-execution-policy --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-gameplay-kit --package=objc2-gl-kit --package=objc2-health-kit --package=objc2-identity-lookup --package=objc2-image-capture-core --package=objc2-image-io --package=objc2-input-method-kit --package=objc2-intents --package=objc2-intents-ui --package=objc2-io-bluetooth --package=objc2-io-bluetooth-ui --package=objc2-io-kit --package=objc2-io-surface --package=objc2-io-usb-host --package=objc2-itunes-library --package=objc2-javascript-core --package=objc2-latent-semantic-mapping --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-accessibility --package=objc2-media-player --package=objc2-media-toolbox --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network --package=objc2-network-extension --package=objc2-notification-center --package=objc2-open-directory --package=objc2-open-gl --package=objc2-os-log --package=objc2-osa-kit --package=objc2-paravirtualized-graphics --package=objc2-pass-kit --package=objc2-pdf-kit --package=objc2-pencil-kit --package=objc2-phase --package=objc2-photos --package=objc2-photos-ui --package=objc2-preference-panes --package=objc2-push-kit --package=objc2-quartz --package=objc2-quartz-core --package=objc2-quick-look --package=objc2-quick-look-thumbnailing --package=objc2-quick-look-ui --package=objc2-replay-kit --package=objc2-safari-services --package=objc2-safety-kit --package=objc2-scene-kit --package=objc2-screen-capture-kit --package=objc2-screen-saver --package=objc2-screen-time --package=objc2-scripting-bridge --package=objc2-security --package=objc2-security-foundation --package=objc2-security-interface --package=objc2-service-management --package=objc2-shared-with-you --package=objc2-shared-with-you-core --package=objc2-shazam-kit --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-system-configuration --package=objc2-system-extensions --package=objc2-thread-network --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-user-notifications-ui --package=objc2-video-subscriber-account --package=objc2-video-toolbox --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-application-services --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-av-routing --package=objc2-avf-audio --package=objc2-background-assets --package=objc2-business-chat --package=objc2-call-kit --package=objc2-carbon --package=objc2-cf-network --package=objc2-cinematic --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-collaboration --package=objc2-color-sync --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-kit --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-media-io --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-services --package=objc2-core-spotlight --package=objc2-core-telephony --package=objc2-core-text --package=objc2-core-video --package=objc2-core-wlan --package=objc2-crypto-token-kit --package=objc2-data-detection --package=objc2-device-check --package=objc2-disk-arbitration --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-execution-policy --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-gameplay-kit --package=objc2-gl-kit --package=objc2-health-kit --package=objc2-identity-lookup --package=objc2-image-capture-core --package=objc2-image-io --package=objc2-input-method-kit --package=objc2-intents --package=objc2-intents-ui --package=objc2-io-bluetooth --package=objc2-io-bluetooth-ui --package=objc2-io-kit --package=objc2-io-surface --package=objc2-io-usb-host --package=objc2-itunes-library --package=objc2-javascript-core --package=objc2-latent-semantic-mapping --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-accessibility --package=objc2-media-player --package=objc2-media-toolbox --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network --package=objc2-network-extension --package=objc2-notification-center --package=objc2-open-directory --package=objc2-open-gl --package=objc2-os-log --package=objc2-osa-kit --package=objc2-paravirtualized-graphics --package=objc2-pass-kit --package=objc2-pdf-kit --package=objc2-pencil-kit --package=objc2-phase --package=objc2-photos --package=objc2-photos-ui --package=objc2-preference-panes --package=objc2-push-kit --package=objc2-quartz --package=objc2-quartz-core --package=objc2-quick-look --package=objc2-quick-look-thumbnailing --package=objc2-quick-look-ui --package=objc2-replay-kit --package=objc2-safari-services --package=objc2-safety-kit --package=objc2-scene-kit --package=objc2-screen-capture-kit --package=objc2-screen-saver --package=objc2-screen-time --package=objc2-scripting-bridge --package=objc2-security --package=objc2-security-foundation --package=objc2-security-interface --package=objc2-sensitive-content-analysis --package=objc2-service-management --package=objc2-shared-with-you --package=objc2-shared-with-you-core --package=objc2-shazam-kit --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-configuration --package=objc2-system-extensions --package=objc2-thread-network --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-user-notifications-ui --package=objc2-video-subscriber-account --package=objc2-video-toolbox --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-application-services --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-av-routing --package=objc2-avf-audio --package=objc2-background-assets --package=objc2-business-chat --package=objc2-call-kit --package=objc2-carbon --package=objc2-cf-network --package=objc2-cinematic --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-collaboration --package=objc2-color-sync --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-kit --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-media-io --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-services --package=objc2-core-spotlight --package=objc2-core-telephony --package=objc2-core-text --package=objc2-core-video --package=objc2-core-wlan --package=objc2-crypto-token-kit --package=objc2-data-detection --package=objc2-device-check --package=objc2-device-discovery-extension --package=objc2-disk-arbitration --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-execution-policy --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-gameplay-kit --package=objc2-gl-kit --package=objc2-health-kit --package=objc2-identity-lookup --package=objc2-image-capture-core --package=objc2-image-io --package=objc2-input-method-kit --package=objc2-intents --package=objc2-intents-ui --package=objc2-io-bluetooth --package=objc2-io-bluetooth-ui --package=objc2-io-kit --package=objc2-io-surface --package=objc2-io-usb-host --package=objc2-itunes-library --package=objc2-javascript-core --package=objc2-latent-semantic-mapping --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-accessibility --package=objc2-media-extension --package=objc2-media-player --package=objc2-media-toolbox --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network --package=objc2-network-extension --package=objc2-notification-center --package=objc2-open-directory --package=objc2-open-gl --package=objc2-os-log --package=objc2-osa-kit --package=objc2-paravirtualized-graphics --package=objc2-pass-kit --package=objc2-pdf-kit --package=objc2-pencil-kit --package=objc2-phase --package=objc2-photos --package=objc2-photos-ui --package=objc2-preference-panes --package=objc2-push-kit --package=objc2-quartz --package=objc2-quartz-core --package=objc2-quick-look --package=objc2-quick-look-thumbnailing --package=objc2-quick-look-ui --package=objc2-replay-kit --package=objc2-safari-services --package=objc2-safety-kit --package=objc2-scene-kit --package=objc2-screen-capture-kit --package=objc2-screen-saver --package=objc2-screen-time --package=objc2-scripting-bridge --package=objc2-security --package=objc2-security-foundation --package=objc2-security-interface --package=objc2-sensitive-content-analysis --package=objc2-service-management --package=objc2-shared-with-you --package=objc2-shared-with-you-core --package=objc2-shazam-kit --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-configuration --package=objc2-system-extensions --package=objc2-thread-network --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-user-notifications-ui --package=objc2-video-subscriber-account --package=objc2-video-toolbox --package=objc2-virtualization --package=objc2-vision --package=objc2-web-kit FRAMEWORKS_IOS_10: --package=objc2-accounts --package=objc2-ad-support --package=objc2-audio-toolbox --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-avf-audio --package=objc2-call-kit --package=objc2-cf-network --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-kit --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-midi --package=objc2-core-motion --package=objc2-core-spotlight --package=objc2-core-telephony --package=objc2-core-text --package=objc2-core-video --package=objc2-event-kit --package=objc2-event-kit-ui --package=objc2-external-accessory --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-gameplay-kit --package=objc2-gl-kit --package=objc2-health-kit --package=objc2-health-kit-ui --package=objc2-home-kit --package=objc2-image-io --package=objc2-intents --package=objc2-intents-ui --package=objc2-javascript-core --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-player --package=objc2-media-toolbox --package=objc2-message-ui --package=objc2-messages --package=objc2-metal --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-network-extension --package=objc2-notification-center --package=objc2-open-gl-es --package=objc2-pass-kit --package=objc2-photos --package=objc2-photos-ui --package=objc2-push-kit --package=objc2-quartz-core --package=objc2-quick-look --package=objc2-replay-kit --package=objc2-safari-services --package=objc2-scene-kit --package=objc2-security --package=objc2-social --package=objc2-speech --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-system-configuration --package=objc2-ui-kit --package=objc2-user-notifications --package=objc2-user-notifications-ui --package=objc2-video-subscriber-account --package=objc2-video-toolbox --package=objc2-watch-connectivity - FRAMEWORKS_IOS_17: --package=objc2-accessibility --package=objc2-accounts --package=objc2-ad-services --package=objc2-ad-support --package=objc2-app-clip --package=objc2-app-tracking-transparency --package=objc2-ar-kit --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-av-routing --package=objc2-avf-audio --package=objc2-background-assets --package=objc2-background-tasks --package=objc2-business-chat --package=objc2-call-kit --package=objc2-car-play --package=objc2-cf-network --package=objc2-class-kit --package=objc2-clock-kit --package=objc2-cloud-kit --package=objc2-color-sync --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-kit --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-haptics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-location-ui --package=objc2-core-media --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-nfc --package=objc2-core-services --package=objc2-core-spotlight --package=objc2-core-telephony --package=objc2-core-text --package=objc2-core-video --package=objc2-crypto-token-kit --package=objc2-data-detection --package=objc2-device-check --package=objc2-device-discovery-extension --package=objc2-event-kit --package=objc2-event-kit-ui --package=objc2-exposure-notification --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-gameplay-kit --package=objc2-gl-kit --package=objc2-health-kit --package=objc2-health-kit-ui --package=objc2-home-kit --package=objc2-identity-lookup --package=objc2-identity-lookup-ui --package=objc2-image-capture-core --package=objc2-image-io --package=objc2-intents --package=objc2-intents-ui --package=objc2-io-kit --package=objc2-io-surface --package=objc2-javascript-core --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-map-kit --package=objc2-media-accessibility --package=objc2-media-player --package=objc2-media-toolbox --package=objc2-message-ui --package=objc2-messages --package=objc2-metal --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-metric-kit --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-notification-center --package=objc2-open-gl-es --package=objc2-os-log --package=objc2-pass-kit --package=objc2-pdf-kit --package=objc2-pencil-kit --package=objc2-phase --package=objc2-photos --package=objc2-photos-ui --package=objc2-push-kit --package=objc2-push-to-talk --package=objc2-quartz-core --package=objc2-quick-look --package=objc2-quick-look-thumbnailing --package=objc2-replay-kit --package=objc2-safari-services --package=objc2-safety-kit --package=objc2-scene-kit --package=objc2-screen-time --package=objc2-security --package=objc2-sensitive-content-analysis --package=objc2-sensor-kit --package=objc2-shared-with-you --package=objc2-shared-with-you-core --package=objc2-shazam-kit --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-configuration --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-user-notifications-ui --package=objc2-video-subscriber-account --package=objc2-video-toolbox --package=objc2-vision --package=objc2-watch-connectivity --package=objc2-web-kit - FRAMEWORKS_TVOS_17: --package=objc2-accessibility --package=objc2-ad-support --package=objc2-app-tracking-transparency --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-avf-audio --package=objc2-background-tasks --package=objc2-cf-network --package=objc2-cinematic --package=objc2-cloud-kit --package=objc2-color-sync --package=objc2-core-audio --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-haptics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-services --package=objc2-core-text --package=objc2-core-video --package=objc2-crypto-token-kit --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-gameplay-kit --package=objc2-gl-kit --package=objc2-home-kit --package=objc2-image-io --package=objc2-intents --package=objc2-intents-ui --package=objc2-io-surface --package=objc2-javascript-core --package=objc2-link-presentation --package=objc2-map-kit --package=objc2-media-accessibility --package=objc2-media-player --package=objc2-media-toolbox --package=objc2-metal --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-ml-compute --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-network-extension --package=objc2-open-gl-es --package=objc2-os-log --package=objc2-phase --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-replay-kit --package=objc2-scene-kit --package=objc2-security --package=objc2-shared-with-you --package=objc2-shared-with-you-core --package=objc2-shazam-kit --package=objc2-sound-analysis --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-configuration --package=objc2-tv-ml-kit --package=objc2-tv-services --package=objc2-tv-ui-kit --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-video-subscriber-account --package=objc2-video-toolbox --package=objc2-vision - FRAMEWORKS_MAC_CATALYST_17: --package=objc2-accessibility --package=objc2-accounts --package=objc2-ad-services --package=objc2-ad-support --package=objc2-app-clip --package=objc2-app-kit --package=objc2-app-tracking-transparency --package=objc2-application-services --package=objc2-ar-kit --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-av-routing --package=objc2-avf-audio --package=objc2-background-assets --package=objc2-background-tasks --package=objc2-business-chat --package=objc2-call-kit --package=objc2-car-play --package=objc2-cf-network --package=objc2-class-kit --package=objc2-clock-kit --package=objc2-cloud-kit --package=objc2-color-sync --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-kit --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-haptics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-location-ui --package=objc2-core-media --package=objc2-core-media-io --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-nfc --package=objc2-core-services --package=objc2-core-spotlight --package=objc2-core-telephony --package=objc2-core-text --package=objc2-core-video --package=objc2-core-wlan --package=objc2-crypto-token-kit --package=objc2-data-detection --package=objc2-device-check --package=objc2-disk-arbitration --package=objc2-event-kit --package=objc2-event-kit-ui --package=objc2-exception-handling --package=objc2-execution-policy --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-gameplay-kit --package=objc2-health-kit --package=objc2-health-kit-ui --package=objc2-home-kit --package=objc2-identity-lookup --package=objc2-identity-lookup-ui --package=objc2-image-capture-core --package=objc2-image-io --package=objc2-intents --package=objc2-intents-ui --package=objc2-io-kit --package=objc2-io-surface --package=objc2-io-usb-host --package=objc2-itunes-library --package=objc2-javascript-core --package=objc2-latent-semantic-mapping --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-map-kit --package=objc2-media-accessibility --package=objc2-media-player --package=objc2-media-setup --package=objc2-media-toolbox --package=objc2-message-ui --package=objc2-messages --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-notification-center --package=objc2-open-directory --package=objc2-os-log --package=objc2-paravirtualized-graphics --package=objc2-pass-kit --package=objc2-pdf-kit --package=objc2-pencil-kit --package=objc2-phase --package=objc2-photos --package=objc2-photos-ui --package=objc2-preference-panes --package=objc2-push-kit --package=objc2-push-to-talk --package=objc2-quartz-core --package=objc2-quick-look --package=objc2-quick-look-thumbnailing --package=objc2-replay-kit --package=objc2-safari-services --package=objc2-safety-kit --package=objc2-scene-kit --package=objc2-screen-time --package=objc2-scripting-bridge --package=objc2-security --package=objc2-security-foundation --package=objc2-sensitive-content-analysis --package=objc2-service-management --package=objc2-shared-with-you --package=objc2-shared-with-you-core --package=objc2-shazam-kit --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-configuration --package=objc2-thread-network --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-user-notifications-ui --package=objc2-video-toolbox --package=objc2-vision --package=objc2-watch-connectivity --package=objc2-web-kit - FRAMEWORKS_VISIONOS_1: --package=objc2-accessibility --package=objc2-ad-services --package=objc2-app-tracking-transparency --package=objc2-ar-kit --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-av-routing --package=objc2-avf-audio --package=objc2-background-assets --package=objc2-background-tasks --package=objc2-call-kit --package=objc2-cf-network --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-color-sync --package=objc2-compositor-services --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-kit --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-haptics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-services --package=objc2-core-spotlight --package=objc2-core-text --package=objc2-core-video --package=objc2-crypto-token-kit --package=objc2-data-detection --package=objc2-device-check --package=objc2-device-discovery-extension --package=objc2-event-kit --package=objc2-event-kit-ui --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-gameplay-kit --package=objc2-health-kit --package=objc2-health-kit-ui --package=objc2-home-kit --package=objc2-identity-lookup --package=objc2-identity-lookup-ui --package=objc2-image-capture-core --package=objc2-image-io --package=objc2-intents --package=objc2-intents-ui --package=objc2-io-kit --package=objc2-io-surface --package=objc2-javascript-core --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-map-kit --package=objc2-media-accessibility --package=objc2-media-player --package=objc2-media-setup --package=objc2-media-toolbox --package=objc2-message-ui --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-metric-kit --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-network-extension --package=objc2-open-gl-es --package=objc2-os-log --package=objc2-pass-kit --package=objc2-pdf-kit --package=objc2-pencil-kit --package=objc2-phase --package=objc2-photos --package=objc2-photos-ui --package=objc2-push-kit --package=objc2-quartz-core --package=objc2-quick-look --package=objc2-quick-look-thumbnailing --package=objc2-replay-kit --package=objc2-safari-services --package=objc2-scene-kit --package=objc2-security --package=objc2-shared-with-you --package=objc2-shared-with-you-core --package=objc2-shazam-kit --package=objc2-sound-analysis --package=objc2-speech --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-configuration --package=objc2-thread-network --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-user-notifications-ui --package=objc2-video-subscriber-account --package=objc2-video-toolbox --package=objc2-vision --package=objc2-watch-connectivity --package=objc2-web-kit - FRAMEWORKS_WATCHOS_10: --package=objc2-accessibility --package=objc2-authentication-services --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-avf-audio --package=objc2-call-kit --package=objc2-clock-kit --package=objc2-cloud-kit --package=objc2-color-sync --package=objc2-contacts --package=objc2-core-audio --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-location --package=objc2-core-location-ui --package=objc2-core-media --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-services --package=objc2-core-text --package=objc2-core-video --package=objc2-crypto-token-kit --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-health-kit-ui --package=objc2-home-kit --package=objc2-image-io --package=objc2-intents --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-os-log --package=objc2-pass-kit --package=objc2-photos-ui --package=objc2-push-kit --package=objc2-scene-kit --package=objc2-security --package=objc2-shazam-kit --package=objc2-sound-analysis --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-symbols --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-watch-connectivity --package=objc2-watch-kit + FRAMEWORKS_IOS_17: --package=objc2-accessibility --package=objc2-accounts --package=objc2-ad-services --package=objc2-ad-support --package=objc2-app-clip --package=objc2-app-tracking-transparency --package=objc2-ar-kit --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-av-routing --package=objc2-avf-audio --package=objc2-background-assets --package=objc2-background-tasks --package=objc2-business-chat --package=objc2-call-kit --package=objc2-car-play --package=objc2-cf-network --package=objc2-class-kit --package=objc2-clock-kit --package=objc2-cloud-kit --package=objc2-color-sync --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-kit --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-haptics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-location-ui --package=objc2-core-media --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-nfc --package=objc2-core-services --package=objc2-core-spotlight --package=objc2-core-telephony --package=objc2-core-text --package=objc2-core-video --package=objc2-crypto-token-kit --package=objc2-data-detection --package=objc2-device-check --package=objc2-device-discovery-extension --package=objc2-event-kit --package=objc2-event-kit-ui --package=objc2-exposure-notification --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-gameplay-kit --package=objc2-gl-kit --package=objc2-health-kit --package=objc2-health-kit-ui --package=objc2-home-kit --package=objc2-identity-lookup --package=objc2-identity-lookup-ui --package=objc2-image-capture-core --package=objc2-image-io --package=objc2-intents --package=objc2-intents-ui --package=objc2-io-kit --package=objc2-io-surface --package=objc2-javascript-core --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-map-kit --package=objc2-media-accessibility --package=objc2-media-player --package=objc2-media-toolbox --package=objc2-message-ui --package=objc2-messages --package=objc2-metal --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-metric-kit --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network --package=objc2-network-extension --package=objc2-notification-center --package=objc2-open-gl-es --package=objc2-os-log --package=objc2-pass-kit --package=objc2-pdf-kit --package=objc2-pencil-kit --package=objc2-phase --package=objc2-photos --package=objc2-photos-ui --package=objc2-push-kit --package=objc2-push-to-talk --package=objc2-quartz-core --package=objc2-quick-look --package=objc2-quick-look-thumbnailing --package=objc2-replay-kit --package=objc2-safari-services --package=objc2-safety-kit --package=objc2-scene-kit --package=objc2-screen-time --package=objc2-security --package=objc2-sensitive-content-analysis --package=objc2-sensor-kit --package=objc2-shared-with-you --package=objc2-shared-with-you-core --package=objc2-shazam-kit --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-configuration --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-user-notifications-ui --package=objc2-video-subscriber-account --package=objc2-video-toolbox --package=objc2-vision --package=objc2-watch-connectivity --package=objc2-web-kit + FRAMEWORKS_TVOS_17: --package=objc2-accessibility --package=objc2-ad-support --package=objc2-app-tracking-transparency --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-avf-audio --package=objc2-background-tasks --package=objc2-cf-network --package=objc2-cinematic --package=objc2-cloud-kit --package=objc2-color-sync --package=objc2-core-audio --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-haptics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-services --package=objc2-core-text --package=objc2-core-video --package=objc2-crypto-token-kit --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-gameplay-kit --package=objc2-gl-kit --package=objc2-home-kit --package=objc2-image-io --package=objc2-intents --package=objc2-intents-ui --package=objc2-io-surface --package=objc2-javascript-core --package=objc2-link-presentation --package=objc2-map-kit --package=objc2-media-accessibility --package=objc2-media-player --package=objc2-media-toolbox --package=objc2-metal --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-ml-compute --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-network --package=objc2-network-extension --package=objc2-open-gl-es --package=objc2-os-log --package=objc2-phase --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-replay-kit --package=objc2-scene-kit --package=objc2-security --package=objc2-shared-with-you --package=objc2-shared-with-you-core --package=objc2-shazam-kit --package=objc2-sound-analysis --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-configuration --package=objc2-tv-ml-kit --package=objc2-tv-services --package=objc2-tv-ui-kit --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-video-subscriber-account --package=objc2-video-toolbox --package=objc2-vision + FRAMEWORKS_MAC_CATALYST_17: --package=objc2-accessibility --package=objc2-accounts --package=objc2-ad-services --package=objc2-ad-support --package=objc2-app-clip --package=objc2-app-kit --package=objc2-app-tracking-transparency --package=objc2-application-services --package=objc2-ar-kit --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-av-routing --package=objc2-avf-audio --package=objc2-background-assets --package=objc2-background-tasks --package=objc2-business-chat --package=objc2-call-kit --package=objc2-car-play --package=objc2-cf-network --package=objc2-class-kit --package=objc2-clock-kit --package=objc2-cloud-kit --package=objc2-color-sync --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-kit --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-haptics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-location-ui --package=objc2-core-media --package=objc2-core-media-io --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-nfc --package=objc2-core-services --package=objc2-core-spotlight --package=objc2-core-telephony --package=objc2-core-text --package=objc2-core-video --package=objc2-core-wlan --package=objc2-crypto-token-kit --package=objc2-data-detection --package=objc2-device-check --package=objc2-disk-arbitration --package=objc2-event-kit --package=objc2-event-kit-ui --package=objc2-exception-handling --package=objc2-execution-policy --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-gameplay-kit --package=objc2-health-kit --package=objc2-health-kit-ui --package=objc2-home-kit --package=objc2-identity-lookup --package=objc2-identity-lookup-ui --package=objc2-image-capture-core --package=objc2-image-io --package=objc2-intents --package=objc2-intents-ui --package=objc2-io-kit --package=objc2-io-surface --package=objc2-io-usb-host --package=objc2-itunes-library --package=objc2-javascript-core --package=objc2-latent-semantic-mapping --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-map-kit --package=objc2-media-accessibility --package=objc2-media-player --package=objc2-media-setup --package=objc2-media-toolbox --package=objc2-message-ui --package=objc2-messages --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network --package=objc2-network-extension --package=objc2-notification-center --package=objc2-open-directory --package=objc2-os-log --package=objc2-paravirtualized-graphics --package=objc2-pass-kit --package=objc2-pdf-kit --package=objc2-pencil-kit --package=objc2-phase --package=objc2-photos --package=objc2-photos-ui --package=objc2-preference-panes --package=objc2-push-kit --package=objc2-push-to-talk --package=objc2-quartz-core --package=objc2-quick-look --package=objc2-quick-look-thumbnailing --package=objc2-replay-kit --package=objc2-safari-services --package=objc2-safety-kit --package=objc2-scene-kit --package=objc2-screen-time --package=objc2-scripting-bridge --package=objc2-security --package=objc2-security-foundation --package=objc2-sensitive-content-analysis --package=objc2-service-management --package=objc2-shared-with-you --package=objc2-shared-with-you-core --package=objc2-shazam-kit --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-configuration --package=objc2-thread-network --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-user-notifications-ui --package=objc2-video-toolbox --package=objc2-vision --package=objc2-watch-connectivity --package=objc2-web-kit + FRAMEWORKS_VISIONOS_1: --package=objc2-accessibility --package=objc2-ad-services --package=objc2-app-tracking-transparency --package=objc2-ar-kit --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-av-routing --package=objc2-avf-audio --package=objc2-background-assets --package=objc2-background-tasks --package=objc2-call-kit --package=objc2-cf-network --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-color-sync --package=objc2-compositor-services --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-kit --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-haptics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-services --package=objc2-core-spotlight --package=objc2-core-text --package=objc2-core-video --package=objc2-crypto-token-kit --package=objc2-data-detection --package=objc2-device-check --package=objc2-device-discovery-extension --package=objc2-event-kit --package=objc2-event-kit-ui --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-gameplay-kit --package=objc2-health-kit --package=objc2-health-kit-ui --package=objc2-home-kit --package=objc2-identity-lookup --package=objc2-identity-lookup-ui --package=objc2-image-capture-core --package=objc2-image-io --package=objc2-intents --package=objc2-intents-ui --package=objc2-io-kit --package=objc2-io-surface --package=objc2-javascript-core --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-map-kit --package=objc2-media-accessibility --package=objc2-media-player --package=objc2-media-setup --package=objc2-media-toolbox --package=objc2-message-ui --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-metric-kit --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-network --package=objc2-network-extension --package=objc2-open-gl-es --package=objc2-os-log --package=objc2-pass-kit --package=objc2-pdf-kit --package=objc2-pencil-kit --package=objc2-phase --package=objc2-photos --package=objc2-photos-ui --package=objc2-push-kit --package=objc2-quartz-core --package=objc2-quick-look --package=objc2-quick-look-thumbnailing --package=objc2-replay-kit --package=objc2-safari-services --package=objc2-scene-kit --package=objc2-security --package=objc2-shared-with-you --package=objc2-shared-with-you-core --package=objc2-shazam-kit --package=objc2-sound-analysis --package=objc2-speech --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-configuration --package=objc2-thread-network --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-user-notifications-ui --package=objc2-video-subscriber-account --package=objc2-video-toolbox --package=objc2-vision --package=objc2-watch-connectivity --package=objc2-web-kit + FRAMEWORKS_WATCHOS_10: --package=objc2-accessibility --package=objc2-authentication-services --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-avf-audio --package=objc2-call-kit --package=objc2-clock-kit --package=objc2-cloud-kit --package=objc2-color-sync --package=objc2-contacts --package=objc2-core-audio --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-location --package=objc2-core-location-ui --package=objc2-core-media --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-services --package=objc2-core-text --package=objc2-core-video --package=objc2-crypto-token-kit --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-health-kit-ui --package=objc2-home-kit --package=objc2-image-io --package=objc2-intents --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-player --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network --package=objc2-network-extension --package=objc2-os-log --package=objc2-pass-kit --package=objc2-photos-ui --package=objc2-push-kit --package=objc2-scene-kit --package=objc2-security --package=objc2-shazam-kit --package=objc2-sound-analysis --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-symbols --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-watch-connectivity --package=objc2-watch-kit FRAMEWORKS_GNUSTEP: --package=objc2-app-kit --package=objc2-foundation # END AUTOMATICALLY GENERATED diff --git a/Cargo.lock b/Cargo.lock index 5f98a977d..61cfde34a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2306,6 +2306,18 @@ dependencies = [ "objc2-foundation", ] +[[package]] +name = "objc2-network" +version = "0.3.1" +dependencies = [ + "block2", + "dispatch2", + "libc", + "objc2", + "objc2-core-foundation", + "objc2-foundation", +] + [[package]] name = "objc2-network-extension" version = "0.3.1" @@ -3532,6 +3544,7 @@ dependencies = [ "objc2-multipeer-connectivity", "objc2-natural-language", "objc2-nearby-interaction", + "objc2-network", "objc2-network-extension", "objc2-notification-center", "objc2-open-directory", diff --git a/Cargo.toml b/Cargo.toml index 467dba282..75e85120f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -220,6 +220,7 @@ objc2-model-io = { path = "framework-crates/objc2-model-io", version = "0.3.1", objc2-multipeer-connectivity = { path = "framework-crates/objc2-multipeer-connectivity", version = "0.3.1", default-features = false } objc2-natural-language = { path = "framework-crates/objc2-natural-language", version = "0.3.1", default-features = false } objc2-nearby-interaction = { path = "framework-crates/objc2-nearby-interaction", version = "0.3.1", default-features = false } +objc2-network = { path = "framework-crates/objc2-network", version = "0.3.1", default-features = false } objc2-network-extension = { path = "framework-crates/objc2-network-extension", version = "0.3.1", default-features = false } objc2-notification-center = { path = "framework-crates/objc2-notification-center", version = "0.3.1", default-features = false } objc2-osa-kit = { path = "framework-crates/objc2-osa-kit", version = "0.3.1", default-features = false } @@ -415,6 +416,7 @@ objc2-model-io = { path = "framework-crates/objc2-model-io" } objc2-multipeer-connectivity = { path = "framework-crates/objc2-multipeer-connectivity" } objc2-natural-language = { path = "framework-crates/objc2-natural-language" } objc2-nearby-interaction = { path = "framework-crates/objc2-nearby-interaction" } +objc2-network = { path = "framework-crates/objc2-network" } objc2-network-extension = { path = "framework-crates/objc2-network-extension" } objc2-notification-center = { path = "framework-crates/objc2-notification-center" } objc2-osa-kit = { path = "framework-crates/objc2-osa-kit" } diff --git a/crates/header-translator/configs/skipped.toml b/crates/header-translator/configs/skipped.toml index d6830575c..ad4a3053b 100644 --- a/crates/header-translator/configs/skipped.toml +++ b/crates/header-translator/configs/skipped.toml @@ -138,7 +138,6 @@ InterfaceBuilderKit = "TODO. Developer-only" XcodeKit = "TODO. Developer-only" StoreKitTest = "TODO. Developer-only" -Network = "TODO, see [#646](https://github.com/madsmtm/objc2/issues/646)" DeviceDiscoveryUI = "Needs Network first" BrowserKit = "TODO" diff --git a/crates/header-translator/src/config.rs b/crates/header-translator/src/config.rs index fcd4a5191..7b8c8fe8c 100644 --- a/crates/header-translator/src/config.rs +++ b/crates/header-translator/src/config.rs @@ -7,11 +7,11 @@ use std::sync::OnceLock; use std::{fmt, ptr}; use clang::{Entity, EntityKind}; -use heck::ToTrainCase; +use heck::{ToKebabCase, ToTrainCase, ToUpperCamelCase}; use semver::Version; use serde::{de, Deserialize, Deserializer}; -use crate::name_translation::cf_no_ref; +use crate::name_translation::strip_needless_suffix; use crate::stmt::{Counterpart, Derives}; use crate::{ItemIdentifier, Location}; @@ -130,7 +130,12 @@ impl Config { self.libraries.values().find(|lib| lib.krate == krate) } - pub fn replace_typedef_name(&self, id: ItemIdentifier, is_cf: bool) -> ItemIdentifier { + pub fn replace_typedef_name( + &self, + id: ItemIdentifier, + is_cf: bool, + is_nw: bool, + ) -> ItemIdentifier { let library_config = self.library(&id); id.map_name(|name| { library_config @@ -152,7 +157,12 @@ impl Config { // We'll have to manually keep the name of those in // translation-config.toml. if is_cf { - cf_no_ref(&name).to_string() + strip_needless_suffix(&name).to_string() + } else if is_nw { + // Rename network types to match Swift's naming scheme. + strip_needless_suffix(&name) + .to_upper_camel_case() + .replace("Nw", "NW") } else { name } diff --git a/crates/header-translator/src/global_analysis.rs b/crates/header-translator/src/global_analysis.rs index 32ff4e80a..c9c90c9f9 100644 --- a/crates/header-translator/src/global_analysis.rs +++ b/crates/header-translator/src/global_analysis.rs @@ -139,9 +139,29 @@ fn update_module( ) }; + // Replace the first argument with self when translating standalone functions into instance methods + // + // nw_txt_record_t nw_txt_record_copy(nw_txt_record_t txt_record); + // + // To: + // + // impl NWTxtRecord { + // fn copy(&self) -> NWRetained; + // } + // + if id.library_name() == "Network" + && arguments + .first() + .and_then(|(_, first_arg_ty)| first_arg_ty.implementable()) + .is_some_and(|v| v == cf_item) + { + *first_arg_is_self = true; + } + // TODO(breaking): Remove in next version if body.is_none() && id.library_name() != "Dispatch" + && id.library_name() != "Network" && !link_name.contains("GetTypeID") { deprecated_fns.push(Stmt::FnDecl { diff --git a/crates/header-translator/src/id.rs b/crates/header-translator/src/id.rs index 7e007536c..f305f5bb0 100644 --- a/crates/header-translator/src/id.rs +++ b/crates/header-translator/src/id.rs @@ -867,6 +867,13 @@ impl ItemTree { }) } + pub fn network(name: impl Into) -> Self { + Self::from_id(ItemIdentifier { + name: name.into(), + location: Location::new("Network"), + }) + } + pub fn cf_string_macro() -> Self { Self::from_id(ItemIdentifier { name: "cf_string".into(), diff --git a/crates/header-translator/src/name_translation.rs b/crates/header-translator/src/name_translation.rs index 2536b032a..fe35f2380 100644 --- a/crates/header-translator/src/name_translation.rs +++ b/crates/header-translator/src/name_translation.rs @@ -239,8 +239,9 @@ pub(crate) fn enum_prefix<'a>( ep } -pub(crate) fn cf_no_ref(type_name: &str) -> &str { - type_name.strip_suffix("Ref").unwrap_or(type_name) +pub(crate) fn strip_needless_suffix(type_name: &str) -> &str { + let type_name = type_name.strip_suffix("Ref").unwrap_or(type_name); + type_name.strip_suffix("_t").unwrap_or(type_name) } /// Find the type onto whom a function should be inserted. @@ -266,8 +267,71 @@ pub(crate) fn find_fn_implementor( } } + // Certain functions are mistakenly identified as constructors. + // + // For example: + // + // nw_txt_record_find_key_t nw_txt_record_find_key(nw_txt_record_t) + // + // This should be treated as an instance method of NWTxtRecord instead + // + // todo: needs some system + const nw_instance_methods: [&str; 46] = [ + "nw_protocol_copy_ws_definition", + "nw_quic_get_application_error", + "nw_quic_get_application_error_reason", + "nw_quic_get_keepalive_interval", + "nw_quic_get_local_max_streams_bidirectional", + "nw_quic_get_local_max_streams_unidirectional", + "nw_quic_get_remote_idle_timeout", + "nw_quic_get_remote_max_streams_bidirectional", + "nw_quic_get_remote_max_streams_unidirectional", + "nw_quic_get_stream_application_error", + "nw_quic_get_stream_id", + "nw_quic_get_stream_type", + "nw_quic_get_stream_usable_datagram_frame_size", + "nw_quic_set_application_error", + "nw_quic_set_keepalive_interval", + "nw_quic_set_local_max_streams_bidirectional", + "nw_quic_set_local_max_streams_unidirectional", + "nw_quic_set_stream_application_error", + "nw_tcp_options_set_enable_keepalive", + "nw_tcp_options_set_keepalive_count", + "nw_tcp_options_set_keepalive_idle_time", + "nw_tcp_options_set_keepalive_interval", + "nw_tcp_options_set_no_delay", + "nw_tcp_options_set_no_options", + "nw_tcp_options_set_no_push", + "nw_txt_record_access_bytes", + "nw_txt_record_access_key", + "nw_txt_record_find_key", + "nw_udp_options_set_prefer_no_checksum", + "nw_ws_metadata_copy_server_response", + "nw_ws_metadata_get_close_code", + "nw_ws_metadata_get_opcode", + "nw_ws_metadata_set_close_code", + "nw_ws_metadata_set_pong_handler", + "nw_ws_options_add_additional_header", + "nw_ws_options_add_subprotocol", + "nw_ws_options_set_auto_reply_ping", + "nw_ws_options_set_client_request_handler", + "nw_ws_options_set_maximum_message_size", + "nw_ws_options_set_skip_handshake", + "nw_ws_request_enumerate_additional_headers", + "nw_ws_request_enumerate_subprotocols", + "nw_ws_response_add_additional_header", + "nw_ws_response_enumerate_additional_headers", + "nw_ws_response_get_selected_subprotocol", + "nw_ws_response_get_status", + ]; + if fn_location.library_name() == "Network" && nw_instance_methods.contains(&fn_name) { + if let Some(item) = first_arg_ty.implementable() { + return Some(item); + } + } + if let Some(item) = first_arg_ty.implementable() { - let type_name = cf_no_ref(&item.id().name).replace("Mutable", ""); + let type_name = strip_needless_suffix(&item.id().name).replace("Mutable", ""); if is_method_candidate(fn_name, &type_name) { // Only emit if in same crate (otherwise it requires a helper trait). if fn_location.library_name() == item.id().library_name() { @@ -281,7 +345,7 @@ pub(crate) fn find_fn_implementor( if let Some(item) = result_type.implementable() { // Allowing this means that things like `CGPathCreateMutableCopy` // are considered part of `CFMutablePath`. - let type_name = cf_no_ref(&item.id().name).replace("Mutable", ""); + let type_name = strip_needless_suffix(&item.id().name).replace("Mutable", ""); if is_method_candidate(fn_name, &type_name) { // Only emit if in same crate (otherwise it requires a helper trait). @@ -321,7 +385,7 @@ pub(crate) fn find_fn_implementor( if fn_name.contains("CTFontManager") { continue; } - if is_method_candidate(fn_name, cf_no_ref(&item.id().name)) { + if is_method_candidate(fn_name, strip_needless_suffix(&item.id().name)) { candidates.push(item.clone()); } } @@ -357,28 +421,40 @@ pub(crate) fn cf_fn_name( omit_memory_management_words: bool, ) -> String { let is_mutable = type_name.contains("Mutable"); - let type_name = cf_no_ref(type_name).replace("Mutable", ""); + let type_name = strip_needless_suffix(type_name).replace("Mutable", ""); debug_assert!(is_method_candidate(fn_name, &type_name)); - let mut type_words = lowercase_words(&type_name); + // Hack: NWWS in network framework is not properly parsed into two words + let temp_type_name = if type_name.starts_with("NWWs") { + type_name.replace("NWWs", "NwWs") + } else { + type_name + }; + + let mut type_words = lowercase_words(&temp_type_name); let mut words = lowercase_words(fn_name) .skip_while(|fn_word| { if let Some(type_word) = type_words.next() { - assert_eq!(*fn_word, type_word); - true + // This can fail for various types: + // + // type_name: nw_protocol_metadata + // fn_name: nw_quic_get_stream_id + // + //assert_eq!(*fn_word, type_word); + *fn_word == type_word } else { false } }) .collect::>(); - if type_words.count() != 0 { - panic!("function name must prefix type: {fn_name:?}, {type_name:?}"); - } + // if type_words.count() != 0 { + // panic!("function name must prefix type: {fn_name:?}, {type_name:?}"); + // } if words.is_empty() { - return "".to_string(); + return "new".to_owned(); } // Keep "create" and "copy" if needed for the user to be able to determine @@ -667,6 +743,23 @@ mod tests { check("FooBar", "FooRef", "bar"); check("FooBar", "MutableFooRef", "bar"); + check("sec_trust_create", "SecTrust", "new"); + check("sec_trust_create", "SecTrustRef", "new"); + assert_eq!( + cf_fn_name("sec_trust_create", "SecTrustRef", true, true), + "new" + ); + + assert_eq!( + cf_fn_name( + "nw_txt_record_find_key", + "nw_txt_record_find_key_t", + true, + true + ), + "new" + ); + // check("AbcDef", "AbcDef", ""); // check("Ac", "Bc", None); } diff --git a/crates/header-translator/src/rust_type.rs b/crates/header-translator/src/rust_type.rs index f6d34b681..b77234043 100644 --- a/crates/header-translator/src/rust_type.rs +++ b/crates/header-translator/src/rust_type.rs @@ -1,20 +1,21 @@ -use std::fmt::Display; -use std::str::FromStr; -use std::sync::LazyLock; -use std::{fmt, iter, mem}; +use std::{fmt, fmt::Display, iter, mem, str::FromStr, sync::LazyLock}; use clang::{CallingConvention, Entity, EntityKind, Nullability, Type, TypeKind}; use proc_macro2::{TokenStream, TokenTree}; -use crate::context::Context; -use crate::display_helper::FormatterFn; -use crate::id::{ItemIdentifier, ItemTree}; -use crate::name_translation::cf_no_ref; -use crate::protocol::ProtocolRef; -use crate::stmt::{anonymous_record_name, bridged_to, parse_class_generics, GenericWithBound}; -use crate::stmt::{parse_superclasses, superclasses_required_items}; -use crate::thread_safety::ThreadSafety; -use crate::unexposed_attr::UnexposedAttr; +use crate::{ + context::Context, + display_helper::FormatterFn, + id::{ItemIdentifier, ItemTree}, + name_translation::strip_needless_suffix, + protocol::ProtocolRef, + stmt::{ + anonymous_record_name, bridged_to, parse_class_generics, parse_superclasses, + superclasses_required_items, GenericWithBound, + }, + thread_safety::ThreadSafety, + unexposed_attr::UnexposedAttr, +}; #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] enum ParsePosition { @@ -621,16 +622,21 @@ fn get_class_data( } fn parse_protocol(entity: Entity<'_>, context: &Context<'_>) -> (ProtocolRef, ThreadSafety) { - let entity = entity.get_definition().unwrap_or(entity); + let mut entity = entity.get_definition().unwrap_or(entity); // @protocol produces a ObjCProtocolDecl if we didn't // load the actual declaration, but we don't actually // want that, since it'll point to the wrong place. - let entity = entity + let source_entity = entity .get_location() .expect("itemref location") .get_entity() .expect("itemref entity"); + // Workaround for OS_OBJECT_DECL. + if source_entity.get_kind() != EntityKind::MacroExpansion { + entity = source_entity; + } + let id = ItemIdentifier::new(&entity, context); match entity.get_kind() { @@ -696,6 +702,9 @@ pub enum PointeeTy { DispatchTypeDef { id: ItemIdentifier, }, + NetworkTypeDef { + id: ItemIdentifier, + }, TypeDef { id: ItemIdentifier, to: Box, @@ -808,7 +817,9 @@ impl PointeeTy { .chain(result_type.required_items()) .chain(arguments.iter().flat_map(|arg| arg.required_items())) .collect(), - Self::CFTypeDef { id, .. } | Self::DispatchTypeDef { id } => { + Self::CFTypeDef { id, .. } + | Self::DispatchTypeDef { id } + | Self::NetworkTypeDef { id } => { vec![ItemTree::from_id(id.clone())] } Self::TypeDef { id, to } => { @@ -865,7 +876,9 @@ impl PointeeTy { .any(|arg| arg.requires_mainthreadmarker(self_requires)) || result_type.requires_mainthreadmarker(self_requires) } - Self::CFTypeDef { .. } | Self::DispatchTypeDef { .. } => false, + Self::CFTypeDef { .. } | Self::DispatchTypeDef { .. } | Self::NetworkTypeDef { .. } => { + false + } Self::TypeDef { to, .. } => to.requires_mainthreadmarker(self_requires), Self::CStr => false, } @@ -959,6 +972,7 @@ impl PointeeTy { } Self::CFTypeDef { id, .. } => write!(f, "{}", id.path()), Self::DispatchTypeDef { id } => write!(f, "{}", id.path()), + Self::NetworkTypeDef { id } => write!(f, "{}", id.path()), Self::TypeDef { id, .. } => write!(f, "{}", id.path()), Self::CStr => write!(f, "CStr"), }) @@ -1137,6 +1151,8 @@ impl PointeeTy { // Dispatch objects have strong type-safety, and are thus // safe in both positions. Self::DispatchTypeDef { .. } => TypeSafety::SAFE, + // Same for Network types. + Self::NetworkTypeDef { .. } => TypeSafety::SAFE, // &CStr is safe as a parameter, though probably not when // returning (since we wouldn't know the lifetime). Self::CStr => TypeSafety::unsafe_in_return("must bound the lifetime"), @@ -1219,9 +1235,10 @@ impl PointeeTy { pub(crate) fn implementable(&self) -> Option { match self { - Self::CFTypeDef { id, .. } | Self::Class { id, .. } | Self::DispatchTypeDef { id } => { - Some(ItemTree::from_id(id.clone())) - } + Self::CFTypeDef { id, .. } + | Self::Class { id, .. } + | Self::DispatchTypeDef { id } + | Self::NetworkTypeDef { id } => Some(ItemTree::from_id(id.clone())), // We shouldn't encounter this here, since `Self` is only on // Objective-C methods, but if we do, it's very unclear how we // should translate it. @@ -1266,6 +1283,15 @@ impl PointeeTy { _ => false, } } + + fn is_network_type(&self) -> bool { + match self { + // Recurse into typedefs + Self::TypeDef { to, .. } => to.is_network_type(), + Self::NetworkTypeDef { .. } => true, + _ => false, + } + } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -2029,7 +2055,7 @@ impl Ty { && inner.get_kind() == TypeKind::ObjCObjectPointer => { let id = ItemIdentifier::new(&declaration, context); - let id = context.replace_typedef_name(id, false); + let id = context.replace_typedef_name(id, false, false); let pointee = Box::new(Self::Pointee(PointeeTy::DispatchTypeDef { id })); return Self::Pointer { nullability, @@ -2039,6 +2065,21 @@ impl Ty { }; } + // Handle other Network Objective-C objects. + name if name.starts_with("nw_") + && inner.get_kind() == TypeKind::ObjCObjectPointer => + { + let id = ItemIdentifier::new(&declaration, context); + let id = context.replace_typedef_name(id, false, true); + let pointee = Box::new(Self::Pointee(PointeeTy::NetworkTypeDef { id })); + return Self::Pointer { + nullability, + is_const, + lifetime, + pointee, + }; + } + _ => {} } @@ -2117,7 +2158,7 @@ impl Ty { // here, as that's also what determines whether the // type is a CF type or not... But that's how it is // currently. - let id = context.replace_typedef_name(id, true); + let id = context.replace_typedef_name(id, true, false); *pointee = Box::new(Self::Pointee(PointeeTy::CFTypeDef { id, declaration_generics, @@ -2125,7 +2166,11 @@ impl Ty { return inner; } else if pointee.is_object_like() { if let Self::Pointee(pointee_ty) = &mut **pointee { - let id = context.replace_typedef_name(id, pointee_ty.is_cf_type()); + let id = context.replace_typedef_name( + id, + pointee_ty.is_cf_type(), + pointee_ty.is_network_type(), + ); // Replace with a dummy type (will be re-replaced // on the line below). let to = Box::new(mem::replace(pointee_ty, PointeeTy::Self_)); @@ -2535,7 +2580,10 @@ impl Ty { } fn is_object_like(&self) -> bool { - self.is_objc_type() || self.is_cf_type() || self.is_dispatch_type() + self.is_objc_type() + || self.is_cf_type() + || self.is_dispatch_type() + || self.is_network_type() } /// Determine whether the inner type of a `Pointer` is object-like. @@ -2565,6 +2613,15 @@ impl Ty { } } + /// Determine whether the pointee inside a `Pointer` is a Network-like type. + fn is_network_type(&self) -> bool { + if let Self::Pointee(pointee_ty) = self.through_typedef() { + pointee_ty.is_network_type() + } else { + false + } + } + /// Determine whether the pointee inside a `Pointer` is the inner /// struct/void type required for a type to be considered a CF type. /// @@ -2608,6 +2665,13 @@ impl Ty { } } + pub(crate) fn is_nw_type_ptr(&self) -> bool { + match self { + Self::Pointer { pointee, .. } => pointee.is_network_type(), + _ => false, + } + } + #[allow(dead_code)] pub(crate) fn is_cf_allocator(&self) -> bool { if let Self::Pointer { pointee, .. } = self { @@ -2920,6 +2984,9 @@ impl Ty { Self::Pointer { pointee, .. } if pointee.is_dispatch_type() => { items.push(ItemTree::dispatch("DispatchRetained")); } + Self::Pointer { pointee, .. } if pointee.is_network_type() => { + items.push(ItemTree::network("NWRetained")); + } _ => {} } items.into_iter() @@ -2960,6 +3027,14 @@ impl Ty { (_, false) => ";\nret.map(|ret| unsafe { DispatchRetained::retain(ret) })", } }; + let end_network = |nullability| { + match (nullability, returns_retained) { + (Nullability::NonNull, true) => ";\nlet ret = ret.expect(\"function was marked as returning non-null, but actually returned NULL\");\nunsafe { NWRetained::from_raw(ret) }", + (Nullability::NonNull, false) => ";\nlet ret = ret.expect(\"function was marked as returning non-null, but actually returned NULL\");\nunsafe { NWRetained::retain(ret) }", + (_, true) => ";\nret.map(|ret| unsafe { NWRetained::from_raw(ret) })", + (_, false) => ";\nret.map(|ret| unsafe { NWRetained::retain(ret) })", + } + }; let end_objc = |nullability| { match (nullability, returns_retained) { (Nullability::NonNull, true) => { @@ -2989,7 +3064,10 @@ impl Ty { // are a hint, and not an ABI stable promise. if pointee.is_static_object() { write!(f, "-> Option<&'static {}>", pointee.behind_pointer()) - } else if pointee.is_cf_type() || pointee.is_dispatch_type() { + } else if pointee.is_cf_type() + || pointee.is_dispatch_type() + || pointee.is_network_type() + { write!(f, "-> Option>", pointee.behind_pointer()) } else if pointee.is_objc_type() { write!(f, "-> *mut {}", pointee.behind_pointer()) @@ -3045,6 +3123,13 @@ impl Ty { format!(" -> Option>", pointee.behind_pointer()) }; Some((res, start, end_dispatch(*nullability))) + } else if pointee.is_network_type() { + let res = if *nullability == Nullability::NonNull { + format!(" -> NWRetained<{}>", pointee.behind_pointer()) + } else { + format!(" -> Option>", pointee.behind_pointer()) + }; + Some((res, start, end_network(*nullability))) } else if pointee.is_objc_type() && !pointee.is_static_object() { let res = if *nullability == Nullability::NonNull { format!(" -> Retained<{}>", pointee.behind_pointer()) @@ -3406,6 +3491,28 @@ impl Ty { Self::parse(ty, Lifetime::Unspecified, context) } + pub(crate) fn is_pointer_to_nw_object(&self, typedef_name: &str) -> bool { + if !typedef_name.starts_with("nw_") { + return false; + } + + if let Self::Pointer { + pointee, + is_const: _, // const-ness doesn't matter when defining the type + .. + } = self + { + // Self::Pointee should point at NSObject + if let Self::Pointee(pty) = &**pointee { + println!("Pointee: {pty:?}"); + if let PointeeTy::Class { id, .. } = pty { + return id.name == "NSObject"; + } + } + } + false + } + pub(crate) fn pointer_to_opaque_struct_or_void( &self, typedef_name: &str, @@ -3669,7 +3776,7 @@ impl Ty { PointeeTy::CFTypeDef { id, .. } => id, _ => return, }; - let type_name = cf_no_ref(&id.name); + let type_name = strip_needless_suffix(&id.name); // We don't ever want to mark these as non-NULL, as they have NULL // statics (`kCFAllocatorDefault` and `kODSessionDefault`). if fn_name.contains(type_name) && !matches!(type_name, "ODSession" | "CFAllocator") diff --git a/crates/header-translator/src/stmt.rs b/crates/header-translator/src/stmt.rs index 1d5af9dab..5442ffb7d 100644 --- a/crates/header-translator/src/stmt.rs +++ b/crates/header-translator/src/stmt.rs @@ -685,6 +685,7 @@ pub enum Stmt { documentation: Documentation, }, /// typedef struct CF_BRIDGED_TYPE(id) CGColorSpace *CGColorSpaceRef; + /// NW_OBJECT_DECL, NW_SENDABLE_OBJECT_DECL OpaqueDecl { id: ItemIdentifier, generics: Vec, @@ -692,10 +693,22 @@ pub enum Stmt { availability: Availability, documentation: Documentation, is_cf: bool, + is_nw: bool, sendable: Option, bridged: Option, superclass: Option, }, + /// NW_OBJECT_DECL, NW_SENDABLE_OBJECT_DECL + // NetworkDecl { + // id: ItemIdentifier, + // generics: Vec, + // encoding_name: String, + // availability: Availability, + // documentation: Documentation, + // sendable: Option, + // bridged: Option, + // superclass: Option, + // }, GeneralImpl { location: Location, item: ItemTree, // TODO: Make this a Ty? @@ -1271,7 +1284,7 @@ impl Stmt { ); if is_cf { - let id = context.replace_typedef_name(id, is_cf); + let id = context.replace_typedef_name(id, is_cf, false); if id.name != c_name { documentation.set_alias(c_name); @@ -1327,6 +1340,7 @@ impl Stmt { availability, documentation, is_cf, + is_nw: false, sendable, bridged: bridged.flatten(), superclass, @@ -1344,6 +1358,7 @@ impl Stmt { availability: Availability::parse(&entity, context), documentation: Documentation::from_entity(&entity, context), is_cf, + is_nw: false, sendable, bridged: bridged.flatten(), superclass: None, @@ -1359,11 +1374,37 @@ impl Stmt { } } + if ty.is_pointer_to_nw_object(&c_name) { + let id = context.replace_typedef_name(id, false, true); + if id.name != c_name { + documentation.set_alias(c_name); + } + + let encoding_name = id.name.to_owned(); + // todo: define with nw_object!(pub struct XXX) + return vec![Self::OpaqueDecl { + id, + generics: data + .generics + .iter() + .map(|generic| (generic.clone(), None)) + .collect(), + encoding_name, + availability: Availability::parse(&entity, context), + documentation: Documentation::from_entity(&entity, context), + is_cf: false, + is_nw: true, + sendable, + bridged: bridged.flatten(), + superclass: None, + }]; + } + if sendable.is_some() { warn!(name = ?id.name, ?sendable, "unhandled sendability attribute on typedef"); } - let id = context.replace_typedef_name(id, ty.is_cf_type_ptr()); + let id = context.replace_typedef_name(id, ty.is_cf_type_ptr(), ty.is_nw_type_ptr()); if id.name != c_name { documentation.set_alias(c_name); @@ -3308,10 +3349,21 @@ impl Stmt { availability, documentation, is_cf, + is_nw, sendable, bridged: _, superclass, } => { + if *is_nw { + writeln!(f, "nw_object!(")?; + write!(f, "{}", documentation.fmt(Some(id)))?; + write!(f, "{}", self.cfg_gate_ln(config))?; + write!(f, "{availability}")?; + writeln!(f, "pub struct {};", id.name)?; + writeln!(f, ");")?; + return Ok(()); + } + write!(f, "{}", documentation.fmt(Some(id)))?; write!(f, "{}", self.cfg_gate_ln(config))?; write!(f, "{availability}")?; diff --git a/crates/header-translator/src/unexposed_attr.rs b/crates/header-translator/src/unexposed_attr.rs index 33a921325..c51b4fce6 100644 --- a/crates/header-translator/src/unexposed_attr.rs +++ b/crates/header-translator/src/unexposed_attr.rs @@ -1,6 +1,8 @@ -use clang::source::{SourceLocation, SourceRange}; -use clang::token::{Token, TokenKind}; -use clang::{Entity, EntityKind}; +use clang::{ + source::{SourceLocation, SourceRange}, + token::{Token, TokenKind}, + Entity, EntityKind, +}; use proc_macro2::TokenStream; use crate::context::{Context, MacroLocation}; @@ -41,7 +43,7 @@ impl UnexposedAttr { get_arguments: impl FnOnce() -> TokenStream, ) -> Result, ()> { Ok(match s { - "CF_ENUM" | "JSC_CF_ENUM" | "DISPATCH_ENUM" | "NS_ENUM" => { + "CF_ENUM" | "JSC_CF_ENUM" | "DISPATCH_ENUM" | "NS_ENUM" | "NW_ENUM" => { let _ = get_arguments(); Some(Self::Enum) } @@ -96,7 +98,8 @@ impl UnexposedAttr { | "CM_RETURNS_RETAINED_BLOCK" | "CM_RETURNS_RETAINED_PARAMETER" | "CV_RETURNS_RETAINED" - | "CV_RETURNS_RETAINED_PARAMETER" => Some(Self::ReturnsRetained), + | "CV_RETURNS_RETAINED_PARAMETER" + | "NW_RETURNS_RETAINED" => Some(Self::ReturnsRetained), "NS_RETURNS_NOT_RETAINED" | "CF_RETURNS_NOT_RETAINED" | "CM_RETURNS_NOT_RETAINED_PARAMETER" => Some(Self::ReturnsNotRetained), @@ -139,8 +142,8 @@ impl UnexposedAttr { let _ = get_arguments(); None } - "CF_NOESCAPE" | "DISPATCH_NOESCAPE" | "NS_NOESCAPE" | "XCT_NOESCAPE" - | "XCUI_NOESCAPE" => Some(Self::NoEscape), + "CF_NOESCAPE" | "DISPATCH_NOESCAPE" | "NW_NOESCAPE" | "NS_NOESCAPE" + | "XCT_NOESCAPE" | "XCUI_NOESCAPE" => Some(Self::NoEscape), "DISPATCH_NOTHROW" | "NS_SWIFT_NOTHROW" => Some(Self::NoThrow), // TODO: We could potentially automatically elide this argument // from the method call, though it's rare enough that it's @@ -422,6 +425,7 @@ impl UnexposedAttr { | "NS_REFINED_FOR_SWIFT" | "AR_REFINED_FOR_SWIFT" | "NS_SWIFT_DISABLE_ASYNC" + | "NW_SWIFT_DISABLE_ASYNC" | "CP_STRUCT_REF" => None, // Possibly interesting? "DISPATCH_COLD" => None, diff --git a/crates/objc2/src/topics/frameworks_list_data.md b/crates/objc2/src/topics/frameworks_list_data.md index 75ec38ba1..57dffb065 100644 --- a/crates/objc2/src/topics/frameworks_list_data.md +++ b/crates/objc2/src/topics/frameworks_list_data.md @@ -120,6 +120,7 @@ | `MultipeerConnectivity` | [`objc2-multipeer-connectivity`](https://crates.io/crates/objc2-multipeer-connectivity) | [![docs.rs](https://docs.rs/objc2-multipeer-connectivity/badge.svg)](https://docs.rs/objc2-multipeer-connectivity/) | | `NaturalLanguage` | [`objc2-natural-language`](https://crates.io/crates/objc2-natural-language) | [![docs.rs](https://docs.rs/objc2-natural-language/badge.svg)](https://docs.rs/objc2-natural-language/) | | `NearbyInteraction` | [`objc2-nearby-interaction`](https://crates.io/crates/objc2-nearby-interaction) | [![docs.rs](https://docs.rs/objc2-nearby-interaction/badge.svg)](https://docs.rs/objc2-nearby-interaction/) | +| `Network` | [`objc2-network`](https://crates.io/crates/objc2-network) | [![docs.rs](https://docs.rs/objc2-network/badge.svg)](https://docs.rs/objc2-network/) | | `NetworkExtension` | [`objc2-network-extension`](https://crates.io/crates/objc2-network-extension) | [![docs.rs](https://docs.rs/objc2-network-extension/badge.svg)](https://docs.rs/objc2-network-extension/) | | `NotificationCenter` | [`objc2-notification-center`](https://crates.io/crates/objc2-notification-center) | [![docs.rs](https://docs.rs/objc2-notification-center/badge.svg)](https://docs.rs/objc2-notification-center/) | | `OSAKit` | [`objc2-osa-kit`](https://crates.io/crates/objc2-osa-kit) | [![docs.rs](https://docs.rs/objc2-osa-kit/badge.svg)](https://docs.rs/objc2-osa-kit/) | diff --git a/crates/objc2/src/topics/frameworks_list_unsupported.md b/crates/objc2/src/topics/frameworks_list_unsupported.md index 222ed820f..c5ceb0d0c 100644 --- a/crates/objc2/src/topics/frameworks_list_unsupported.md +++ b/crates/objc2/src/topics/frameworks_list_unsupported.md @@ -82,7 +82,6 @@ | `MobileCoreServices` | Deprecated, use CoreServices + UniformTypeIdentifiers instead. | | `MusicKit` | Swift-only. | | `NetFS` | Deprecated, use macFUSE or FSKit instead (probably). | -| `Network` | TODO, see [#646](https://github.com/madsmtm/objc2/issues/646). | | `OpenAL` | Very C-centric, use newer Audio frameworks instead. | | `OpenCL` | Very C-centric and old. | | `PCSC` | Too low-level, consider crates like `pcsc` instead. | diff --git a/crates/test-frameworks/Cargo.toml b/crates/test-frameworks/Cargo.toml index 51f5c077b..f9926b952 100644 --- a/crates/test-frameworks/Cargo.toml +++ b/crates/test-frameworks/Cargo.toml @@ -133,6 +133,7 @@ test-frameworks = [ "objc2-multipeer-connectivity", "objc2-natural-language", "objc2-nearby-interaction", + "objc2-network", "objc2-network-extension", "objc2-notification-center", "objc2-osa-kit", @@ -381,6 +382,7 @@ objc2-fs-kit = ["dep:objc2-fs-kit"] objc2-gl-kit = ["dep:objc2-gl-kit"] objc2-open-gl = ["dep:objc2-open-gl"] objc2-open-gl-es = ["dep:objc2-open-gl-es", "objc2-open-gl-es?/objc2-io-surface"] +objc2-network = ["dep:objc2-network"] [dependencies] block2 = { workspace = true, default-features = true } @@ -418,6 +420,7 @@ objc2-intents = { workspace = true, optional = true, default-features = true } objc2-map-kit = { workspace = true, optional = true, default-features = true } objc2-media-player = { workspace = true, optional = true, default-features = true } objc2-natural-language = { workspace = true, optional = true, default-features = true } +objc2-network = { workspace = true, optional = true, default-features = true } objc2-network-extension = { workspace = true, optional = true, default-features = true } objc2-os-log = { workspace = true, optional = true, default-features = true } objc2-photos-ui = { workspace = true, optional = true, default-features = true } diff --git a/framework-crates/objc2-network/Cargo.toml b/framework-crates/objc2-network/Cargo.toml new file mode 100644 index 000000000..5404da76a --- /dev/null +++ b/framework-crates/objc2-network/Cargo.toml @@ -0,0 +1,66 @@ +# This file has been automatically generated by `objc2`'s `header-translator`. +# DO NOT EDIT + +[package] +name = "objc2-network" +version.workspace = true +description = "Bindings to the Network framework" +edition.workspace = true +rust-version.workspace = true +keywords = ["cocoa", "apple", "framework", "macos", "ios"] +categories.workspace = true +repository.workspace = true +license.workspace = true + +[lints] +workspace = true + +[dependencies] +block2 = { workspace = true, features = ["alloc"] } +dispatch2 = { workspace = true, features = [ + "alloc", + "block2", +] } +libc = { workspace = true, optional = true } +objc2 = { workspace = true, optional = true, features = ["std"] } +objc2-core-foundation = { workspace = true, optional = true, features = ["CFError"] } +objc2-foundation = { workspace = true, optional = true, features = [ + "NSArray", + "NSURLSession", + "alloc", +] } + +[package.metadata.docs.rs] +default-target = "aarch64-apple-darwin" +rustc-args = ["--cfg", "docsrs"] # Fix cross-crate link to objc2::topics +targets = [ + "aarch64-apple-darwin", + "x86_64-apple-darwin", + "aarch64-apple-ios", + "aarch64-apple-tvos", + "aarch64-apple-watchos", + "aarch64-apple-ios-macabi", + "aarch64-apple-visionos", +] + +[features] +default = [ + "std", + "FoundationExtension", + "libc", + "objc2", + "objc2-core-foundation", + "objc2-foundation", +] +std = ["alloc"] +alloc = [] +libc = ["dep:libc"] +objc2 = [ + "dep:objc2", + "dispatch2/objc2", + "objc2-core-foundation?/objc2", +] +objc2-core-foundation = ["dep:objc2-core-foundation"] +objc2-foundation = ["dep:objc2-foundation"] + +FoundationExtension = [] diff --git a/framework-crates/objc2-network/README.md b/framework-crates/objc2-network/README.md new file mode 100644 index 000000000..61fb706e7 --- /dev/null +++ b/framework-crates/objc2-network/README.md @@ -0,0 +1,14 @@ +# `objc2-network` + +[![Latest version](https://badgen.net/crates/v/objc2-network)](https://crates.io/crates/objc2-network) +[![License](https://badgen.net/badge/license/Zlib%20OR%20Apache-2.0%20OR%20MIT/blue)](../../LICENSE.md) +[![Documentation](https://docs.rs/objc2-network/badge.svg)](https://docs.rs/objc2-network/) +[![CI](https://github.com/madsmtm/objc2/actions/workflows/ci.yml/badge.svg)](https://github.com/madsmtm/objc2/actions/workflows/ci.yml) + +Rust bindings to Apple's framework Network. + +This README is kept intentionally small to consolidate the documentation, see +[the Rust docs](https://docs.rs/objc2-network/) for more details on this crate. + +This crate is part of the [`objc2` project](https://github.com/madsmtm/objc2), +see that for related crates. diff --git a/framework-crates/objc2-network/src/generated b/framework-crates/objc2-network/src/generated new file mode 120000 index 000000000..1264332d5 --- /dev/null +++ b/framework-crates/objc2-network/src/generated @@ -0,0 +1 @@ +../../../generated/Network \ No newline at end of file diff --git a/framework-crates/objc2-network/src/lib.rs b/framework-crates/objc2-network/src/lib.rs new file mode 100644 index 000000000..46f41a0cb --- /dev/null +++ b/framework-crates/objc2-network/src/lib.rs @@ -0,0 +1,38 @@ +//! # Bindings to the `Network` framework +//! +//! See [Apple's docs][apple-doc] and [the general docs on framework crates][framework-crates] for more information. +//! +//! [apple-doc]: https://developer.apple.com/documentation/network/ +//! [framework-crates]: https://docs.rs/objc2/latest/objc2/topics/about_generated/index.html +#![no_std] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +// Update in Cargo.toml as well. +#![doc(html_root_url = "https://docs.rs/objc2-network/0.3.1")] + +#[cfg(feature = "alloc")] +extern crate alloc; + +#[cfg(feature = "std")] +extern crate std; +mod generated; +#[macro_use] +pub(crate) mod macros; +mod object; +mod retained; + +use core::{ + cell::UnsafeCell, + marker::{PhantomData, PhantomPinned}, +}; + +#[allow(unused_imports, unreachable_pub)] +pub use self::generated::*; +pub use self::object::NWObject; +pub use self::retained::NWRetained; + +// Helper type +type OpaqueData = UnsafeCell, PhantomPinned)>>; + +// fixme: Generated as ArrayUnknownABI +#[allow(non_camel_case_types)] +pub type nw_ethernet_address_t = [core::ffi::c_uchar; 6]; diff --git a/framework-crates/objc2-network/src/macros.rs b/framework-crates/objc2-network/src/macros.rs new file mode 100644 index 000000000..b6a2dbe99 --- /dev/null +++ b/framework-crates/objc2-network/src/macros.rs @@ -0,0 +1,79 @@ +#[macro_export] +macro_rules! nw_object { + ( + $(#[$m:meta])* + pub struct $type:ident; + ) => { + $(#[$m])* + #[repr(C)] + pub struct $type { + inner: [u8; 0], + _p: $crate::OpaqueData, + } + + // SAFETY: The object is a network object. + unsafe impl $crate::NWObject for $type {} + + // Reflexive impl + impl core::convert::AsRef for $type { + #[inline] + fn as_ref(&self) -> &Self { + self + } + } + + impl PartialEq for $type { + #[doc = concat!("Compare this [`", stringify!($type), "`] with another using pointer equality.")] + #[inline] + fn eq(&self, other: &Self) -> bool { + // Network objects use pointer equality. + // Some objects like Path provide individual method for equality check. + core::ptr::eq(self, other) + } + } + + // Pointer equality is reflexive. + impl Eq for $type {} + + // Hash based on pointer. + impl core::hash::Hash for $type { + #[inline] + fn hash(&self, state: &mut H) { + let ptr: *const Self = self; + ptr.hash(state); + } + } + + impl core::fmt::Debug for $type { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + let ptr: *const Self = self; + f.debug_struct(core::stringify!($type)) + .field("ptr", &ptr) + .finish_non_exhaustive() + } + } + + #[cfg(feature = "objc2")] + // SAFETY: Network objects are internally objects. + unsafe impl objc2::encode::RefEncode for $type { + const ENCODING_REF: objc2::encode::Encoding + = objc2::encode::Encoding::Object; + } + + #[cfg(feature = "objc2")] + // SAFETY: Network objects can act as Objective-C objects + // (and respond to e.g. retain/release messages). + unsafe impl objc2::Message for $type {} + + #[cfg(feature = "objc2")] + impl core::convert::AsRef for $type { + #[inline] + fn as_ref(&self) -> &objc2::runtime::AnyObject { + let ptr: *const Self = self; + let ptr: *const objc2::runtime::AnyObject = ptr.cast(); + // SAFETY: Network objects can act as Objective-C objects. + unsafe { &*ptr } + } + } + }; +} diff --git a/framework-crates/objc2-network/src/object.rs b/framework-crates/objc2-network/src/object.rs new file mode 100644 index 000000000..d52419d4b --- /dev/null +++ b/framework-crates/objc2-network/src/object.rs @@ -0,0 +1,20 @@ +use core::ptr::NonNull; + +use super::NWRetained; + +#[doc(alias = "nw_object_t")] +pub unsafe trait NWObject { + /// Increment the reference count of the object. + /// + /// This extends the duration in which the object is alive by detaching it + /// from the lifetime information carried by the reference. + #[doc(alias = "nw_retain")] + fn retain(&self) -> NWRetained { + let ptr: NonNull = NonNull::from(self); + // SAFETY: + // - The pointer is valid since it came from `&self`. + // - The lifetime of the pointer itself is extended, but any lifetime + // that the object may carry is still kept within the type itself. + unsafe { NWRetained::retain(ptr) } + } +} diff --git a/framework-crates/objc2-network/src/retained.rs b/framework-crates/objc2-network/src/retained.rs new file mode 100644 index 000000000..947021f95 --- /dev/null +++ b/framework-crates/objc2-network/src/retained.rs @@ -0,0 +1,313 @@ +use core::{ + fmt, + marker::PhantomData, + mem::ManuallyDrop, + ops::Deref, + panic::{RefUnwindSafe, UnwindSafe}, + ptr::NonNull, +}; + +use crate::{ + generated::{nw_release, nw_retain}, + NWObject, +}; + +/// A reference counted pointer type for Network objects. +/// +/// [`NWRetained`] strongly references or "retains" the given object +/// `T`, and decrements the retain count or "releases" it again when dropped, +/// thereby ensuring it will be deallocated at the right time. +/// +/// The type `T` inside `NWRetained` can be anything that implements +/// [`NWObject`], i.e. any Dispatch object. +/// +/// +/// # Comparison to other types +/// +/// `NWRetained` is equivalent to [`objc2::rc::Retained`], and can be +/// converted to/from that when the `"objc2"` feature is enabled. Note though +/// that this type uses the underlying Dispatch primitives `nw_retain` / +/// `nw_release` instead of `objc_retain` / `objc_release` for +/// performance, and to avoid depending on the Objective-C runtime if not +/// needed. +/// +/// You can also view `NWRetained` as the Dispatch equivalent of +/// [`std::sync::Arc`], that is, it is a thread-safe reference-counting smart +/// pointer that allows cloning by bumping the reference count. +/// +/// Unlike `Arc`, objects can be retained directly from a `&T` using +/// [`NWObject::retain`] (for `Arc` you need `&Arc`). +/// +/// Weak references are not supported, for that you need to convert to +/// `objc2::rc::Retained`. +/// +#[cfg_attr( + not(feature = "objc2"), + doc = "[`objc2::rc::Retained`]: #objc2-not-available" +)] +#[cfg_attr(not(feature = "std"), doc = "[`std::sync::Arc`]: #std-not-enabled")] +/// +/// +/// # Forwarding implementations +/// +/// Since `NWRetained` is a smart pointer, it [`Deref`]s to `T`. +/// +/// It also forwards the implementation of a bunch of standard library traits +/// such as [`PartialEq`], [`AsRef`], and so on, so that it becomes possible +/// to use e.g. `NWRetained` as-if it you had a +/// `&DispatchQueue`. Note that having a `DispatchQueue` directly is not +/// possible since Network objects cannot live on the stack, but instead must +/// reside on the heap, and as such must be accessed behind a pointer or a +/// reference. +/// +/// +/// # Memory layout +/// +/// This is guaranteed to have the same size and alignment as a pointer to the +/// object, i.e. same as `*const T` or `nw_object_t`. +/// +/// Additionally, it participates in the null-pointer optimization, that is, +/// `Option>` is guaranteed to have the same size as +/// `NWRetained`. +#[repr(transparent)] +#[doc(alias = "Retained")] +#[doc(alias = "objc2::rc::Retained")] +// TODO: Add `ptr::Thin` bound on `T` to allow for only extern types +pub struct NWRetained { + /// A pointer to the contained object. The pointer is always retained. + /// + /// It is important that this is `NonNull`, since we want to dereference + /// it later, and be able to use the null-pointer optimization. + ptr: NonNull, + /// Necessary for dropck even though we never actually run T's destructor, + /// because it might have a `dealloc` that assumes that contained + /// references outlive the type. + /// + /// See + item: PhantomData, + /// Marks the type as !UnwindSafe. Later on we'll re-enable this. + /// + /// See for why this is + /// required. + notunwindsafe: PhantomData<&'static mut ()>, +} + +// Same as `objc::rc::Retained`, `#[may_dangle]` does not apply here. +impl Drop for NWRetained { + /// Releases the contained object. + #[doc(alias = "nw_release")] + #[doc(alias = "release")] + #[inline] + fn drop(&mut self) { + // SAFETY: The `ptr` is guaranteed to be valid and have at least one + // retain count. + unsafe { nw_release(self.ptr.as_ptr().cast()) }; + } +} + +impl NWRetained { + /// Construct a `NWRetained` from a pointer that already has +1 + /// retain count. + /// + /// This is useful when you have been given a pointer to an object from + /// some API that returns a retained pointer, and expects you to release + /// it. That is, an API that follows [the create rule]. + /// + /// [the create rule]: https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html#//apple_ref/doc/uid/20001148-103029 + /// + /// + /// # Safety + /// + /// The pointer must be a valid and live object according to Dispatch, and + /// it must be of type `T`. + /// + /// Additionally, you must ensure the given object pointer has +1 retain + /// count. + #[inline] + pub unsafe fn from_raw(ptr: NonNull) -> Self { + Self { + ptr, + item: PhantomData, + notunwindsafe: PhantomData, + } + } + + /// Retain the pointer and construct a [`NWRetained`] from it. + /// + /// This is useful when you have been given a pointer to an object from + /// some API that follows [the get rule], and you would like to keep it + /// around for longer than the current memory context. + /// + /// [the get rule]: https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html#//apple_ref/doc/uid/20001148-SW1 + /// + /// + /// # Safety + /// + /// The pointer must be a valid and live object according to Dispatch, and + /// it must be of type `T`. + #[doc(alias = "nw_retain")] + #[inline] + pub unsafe fn retain(ptr: NonNull) -> Self { + // SAFETY: The caller upholds that the pointer is valid. + unsafe { nw_retain(ptr.as_ptr().cast()) }; + + // SAFETY: We just retained the object, so it has +1 retain count. + // Validity of the pointer is upheld by the caller. + unsafe { Self::from_raw(ptr) } + } + + /// Consumes the `NWRetained`, returning a raw pointer with +1 + /// retain count. + /// + /// After calling this function, the caller is responsible for the memory + /// previously managed by the `NWRetained`. + /// + /// This is effectively the opposite of [`NWRetained::from_raw`]. + /// + /// This is an associated method, and must be called as + /// `NWRetained::into_raw(obj)`. + #[inline] + pub fn into_raw(this: Self) -> NonNull { + ManuallyDrop::new(this).ptr + } + + /// Returns a raw pointer to the object. + /// + /// The pointer is valid for at least as long as the `NWRetained` is + /// held. + /// + /// This is an associated method, and must be called as + /// `NWRetained::as_ptr(&obj)`. + #[inline] + pub fn as_ptr(this: &Self) -> NonNull { + this.ptr + } + + /// Unchecked conversion to another Dispatch object. + /// + /// This is equivalent to a `cast` between two pointers. + /// + /// This is an associated method, and must be called as + /// `NWRetained::cast_unchecked(obj)`. + /// + /// + /// # Safety + /// + /// You must ensure that the object can be reinterpreted as the given + /// type. + /// + /// If `T` is not `'static`, you must ensure that `U` ensures that the + /// data contained by `T` is kept alive for as long as `U` lives. + /// + /// Additionally, you must ensure that any safety invariants that the new + /// type has are upheld. + #[inline] + // TODO: Add ?Sized bound + pub unsafe fn cast_unchecked(this: Self) -> NWRetained { + // SAFETY: The object is forgotten, so we have +1 retain count. + // + // Caller verifies that the object is of the correct type. + unsafe { NWRetained::from_raw(Self::into_raw(this).cast()) } + } +} + +impl Clone for NWRetained { + /// Retain the object, increasing its reference count. + /// + /// This calls [`NWObject::retain`] internally. + #[doc(alias = "nw_retain")] + #[doc(alias = "retain")] + #[inline] + fn clone(&self) -> Self { + self.retain() + } +} + +impl Deref for NWRetained { + type Target = T; + + /// Obtain a reference to the object. + #[inline] + fn deref(&self) -> &T { + // SAFETY: The pointer's validity is verified when the type is + // created. + unsafe { self.ptr.as_ref() } + } +} + +impl fmt::Pointer for NWRetained { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt::Pointer::fmt(&self.ptr.as_ptr(), f) + } +} + +// Same as what's implemented for `objc2::rc::Retained`. +impl, U: NWObject> From<&T> for NWRetained { + /// Cast the object to a superclass, and retain it. + #[inline] + fn from(obj: &T) -> Self { + obj.as_ref().retain() + } +} + +#[cfg(feature = "objc2")] +impl From> for NWRetained { + /// Convert a [`objc2::rc::Retained`] into a [`NWRetained`]. + /// + /// This only works if the type is a Dispatch object (implements the + /// [`NWObject`] trait). + /// + /// This conversion is cost-free. + #[inline] + fn from(obj: objc2::rc::Retained) -> Self { + let ptr = objc2::rc::Retained::into_raw(obj); + let ptr = NonNull::new(ptr).unwrap(); + // SAFETY: `T` is bound by `NWObject`, so we know that the type + // is a Dispatch object, and hence we know that it will respond to + // `nw_retain`/`nw_release`. + // + // Additionally, the pointer is valid and has +1 retain count, since + // we're passing it from `Retained::into_raw`. + unsafe { Self::from_raw(ptr) } + } +} + +#[cfg(feature = "objc2")] +impl From> for objc2::rc::Retained { + /// Convert a [`NWRetained`] into a [`objc2::rc::Retained`]. + /// + /// This conversion is cost-free, since Network objects are fully + /// interoperable with Objective-C retain/release message sending. + #[inline] + fn from(obj: NWRetained) -> Self { + let ptr = NWRetained::into_raw(obj); + // SAFETY: `T` is bound by `Message`, so we know that the type is an + // Objective-C object, and hence we know that it will respond to + // `objc_retain`, `objc_release` etc. + // + // Additionally, the pointer is valid and has +1 retain count, since + // we're passing it from `NWRetained::into_raw`. + unsafe { Self::from_raw(ptr.as_ptr()) }.unwrap() + } +} + +/// `NWRetained` is `Send` if `T` is `Send + Sync`. +// +// SAFETY: nw_retain/nw_release is thread safe, rest is the same +// as `std::sync::Arc` and `objc2::rc::Retained`. +unsafe impl Send for NWRetained {} + +/// `NWRetained` is `Sync` if `T` is `Send + Sync`. +// +// SAFETY: nw_retain/nw_release is thread safe, rest is the same +// as `std::sync::Arc` and `objc2::rc::Retained`. +unsafe impl Sync for NWRetained {} + +// Same as `std::sync::Arc` and `objc2::rc::Retained`. +impl Unpin for NWRetained {} + +// Same as `std::sync::Arc` and `objc2::rc::Retained`. +impl RefUnwindSafe for NWRetained {} + +// Same as `std::sync::Arc` and `objc2::rc::Retained`. +impl UnwindSafe for NWRetained {} diff --git a/framework-crates/objc2-network/translation-config.toml b/framework-crates/objc2-network/translation-config.toml new file mode 100644 index 000000000..748c045bd --- /dev/null +++ b/framework-crates/objc2-network/translation-config.toml @@ -0,0 +1,49 @@ +framework = "Network" +crate = "objc2-network" +required-crates = ["block2", "dispatch2"] +custom-lib-rs = true +flags = [ + # Generate nw_release/nw_retain + "-DOS_OBJECT_USE_OBJC_RETAIN_RELEASE=0", +] + +macos = "10.14" +maccatalyst = "13.0" +ios = "12.0" +tvos = "12.0" +watchos = "6.0" +visionos = "1.0" + +unsafe-default-safety.functions = true + +# Enum generated with integer identifiers +const.nw_ip_version_any.renamed = "any" +const.nw_ip_version_4.renamed = "v4" +const.nw_ip_version_6.renamed = "v6" + +# Enum generated with integer identifiers +const.nw_multipath_version_unspecified.renamed = "unspecified" +const.nw_multipath_version_0.renamed = "v0" +const.nw_multipath_version_1.renamed = "v1" + +# Enum generated with integer identifiers +const.nw_ws_version_invalid.renamed = "invalid" +const.nw_ws_version_13.renamed = "v13" + +# We custom-define these instead. +typedef.nw_object_t.skipped = true +protocol.OS_nw_object.skipped = true + +# ethernet_channel.h +# typedef.nw_ethernet_channel_t.skipped = true +# protocol.OS_nw_ethernet_channel.skipped = true + +# ethernet_channel.h +# fixme: Generated as ArrayUnknownABI +typedef.nw_ethernet_address_t.skipped = true + +# fixme: Return pointer to pointer which does not work with Retained::from_raw() +fn.nw_quic_copy_sec_protocol_options.skipped = true +fn.nw_tls_copy_sec_protocol_metadata.skipped = true +fn.nw_quic_copy_sec_protocol_metadata.skipped = true +fn.nw_tls_copy_sec_protocol_options.skipped = true diff --git a/generated b/generated index 362013ea1..c1184ca22 160000 --- a/generated +++ b/generated @@ -1 +1 @@ -Subproject commit 362013ea1f773a1e41d038e617c547fb8231a7a1 +Subproject commit c1184ca22953a4e6c058e1b8373f27fef7e58f85