Skip to content

Adopt Xcode simulator runtime cipd packages, separate from Xcode app packages #91689

Closed

Description

@jmagman

Currently, the Xcode app cipd package needs to have older runtimes manually copied into the app bundle to support watchOS and older iOS simulators. This makes crafting and testing new Xcode app bundles very painful, error-prone, and take forever to upload. We also have a custom flutter_mac_toolchain forked binary to prevent the watchOS runtime from being filtered out. I think we only have that binary and don't even have the changes that we made tracked in any repo?

The default depot_tools mac_toolchain now supports separate Xcode and runtime cipd packages.
See docs at https://g3doc.corp.google.com/company/teams/chrome/ios/docs/infra/xcode_upload.md#upload-ios-runtimes. See also discussion in https://bugs.chromium.org/p/chromium/issues/detail?id=1225115#c4

Adopt these new runtime cipd packages to make adding new simulators and new Xcode versions easier. It also means (for iOS, not watchOS) we can use https://chrome-infra-packages.appspot.com/p/infra_internal/ios/xcode/ios_runtime/+/ instead of maintaining our own. AND it means different builders can request different runtimes (web engine builder needs different simulator versions than the iOS engine builder, for example)

Activity

  1. added
    c: contributor-productivityTeam-specific productivity, code health, technical debt.
    platform-iosiOS applications specifically
    platform-macosBuilding on or for macOS specifically
    team-infraOwned by Infrastructure team
    on Oct 12, 2021
  2. jmagman commented on Oct 18, 2021

    @jmagman
    MemberAuthor

    It also means (for iOS, not watchOS) we can use https://chrome-infra-packages.appspot.com/p/infra_internal/ios/xcode/ios_runtime/+/ instead of maintaining our own.

    @godofredoc pointed out those packages are also missing Swift. So we can't use those, but we could use vanilla Xcode app bundles from go/xcode.

  3. jmagman commented on Nov 5, 2021

    @jmagman
    MemberAuthor

    I'm working on getting Xcode 13 working on the engine tests and devicelab, and it's really painful getting all the necessary simulator runtimes bundled in (see my current list of issues at #85555 (comment)).

    I took a detour to get Xcode 12.3 working in the engine #84453 (comment). Any chance this can get done before I need to re-tackle Xcode 13?

  4. jmagman commented on Dec 15, 2021

    @jmagman
    MemberAuthor

    I don't think I can get the Mac Web Engine felt ios-safari test tests working for #85555 without the ability to adding non-default simulator runtimes (unless we totally rewrote how those tests worked to pass on multiple simulator runtimes). The Xcode 13 package only contains the default runtime (iOS 15), but the tests need to run on iOS 13.0. The tests don't pass on both. I can't upgrade them to iOS 15 since the old version of Xcode doesn't have that runtime available.

    Mac Web Engine should install (will download this package):

    mac_toolchain install-runtime -cipd-package-prefix flutter_internal/ios/xcode -runtime-version ios-13-0 -output-dir path/to/somewhere
    

    I'm not clear on where that -output-dir should be to allow Xcode to find it (or maybe that script handles it?). Ideally that runtime-version would be configurable from the .ci.yaml.

  5. jmagman commented on Dec 15, 2021

    @jmagman
    MemberAuthor

    I see, after it's downloaded/validated in the cache, the runtime needs to be moved inside the Xcode bundle at Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes.
    https://source.chromium.org/chromium/chromium/src/+/main:ios/build/bots/scripts/xcode_util.py;l=16?q=move_runtime

    Not sure how that will mess up the Xcode bundle cache.

  6. jmagman commented on Dec 15, 2021

    @jmagman
    MemberAuthor

    As a POC I tried installing the iOS 13 runtime with Xcode 13 and it passed, though I'm sure what I did isn't cache friendly:
    Check out install simulator, list simulators, and felt ios-safari test:
    https://ci.chromium.org/raw/build/logs.chromium.org/flutter/led/magder_google.com/97350d7d090ab065118cd161dc08a93622dc7051ed306bb010917afcb7b073c3/+/build.proto?server=chromium-swarm.appspot.com

    Only iOS 13 is available, it clobbered the default iOS 15:

    == Runtimes ==
    iOS 13.0 (13.0 - 17A577) - com.apple.CoreSimulator.SimRuntime.iOS-13-0
    == Devices ==
    

    recipes/recipe_modules/osx_sdk/api.py:

            self.m.step('list simulators', ['xcrun', 'simctl', 'list'])
        runtime_dir = sdk_app.join('Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes')
        self.m.step(
            'install simulator',
            [
                cache_dir.join('mac_toolchain'),
                'install-runtime',
                '-runtime-version',
                'ios-13-0',
                '-output-dir',
                runtime_dir,
                '-cipd-package-prefix',
                'flutter_internal/ios/xcode',
            ],
        )
  7. CaseyHillers commented on Dec 15, 2021

    @CaseyHillers
    Contributor

    Is this related to #86515? Should the recipe module instead do something like cache_dir.join('mac_toolchain_' + version)

    If mac_toolchain existed, and it was ios13 already, it won't install ios15.

  8. godofredoc commented on Jan 11, 2022

    @godofredoc
    Contributor

    CL to implement the runtime functionality is here: https://flutter-review.googlesource.com/c/recipes/+/24944

  9. godofredoc commented on Jan 22, 2022

    @godofredoc
    Contributor

    We'll need to start upgrading the mac machines to mac os 12, maybe in two parts.

  10. godofredoc commented on Jan 22, 2022

    @godofredoc
    Contributor

    We'll also need to update the documentation to generate new bundles, runtimes and how to use them from the recipe's configurations.

  11. jmagman commented on Mar 7, 2022

    @jmagman
    MemberAuthor

    This is working from led but I don't think there's any way to set them per test? Filed #99698 to expose this as a property in .ci.yaml.

  12. godofredoc commented on Jun 13, 2023

    @godofredoc
    Contributor

    Closing because the bug has not been updated for more than one year.

    Feel free to reopen any bugs that you believe are important but please provide updates on how to resource the fix of the bug and what can be done to prevent the issue from not getting updates for another year.

  13. github-actions commented on Jun 27, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  14. locked as resolved and limited conversation to collaborators on Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: contributor-productivityTeam-specific productivity, code health, technical debt.platform-iosiOS applications specificallyplatform-macosBuilding on or for macOS specificallyteam-infraOwned by Infrastructure team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions