Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix supported platforms #3990

Merged
merged 6 commits into from
Jan 15, 2022
Merged

Conversation

orbitekk
Copy link
Contributor

Resolves #3989
Request for comments document (if applies):

Short description 📝

It is not possible to archive iOS project for Mac Catalyst. Any Mac (Mac Catalyst) destination is missing because SUPPORTED_PLATFORMS is set to iOS.

I have removed the SUPPORTED_PLATFORM setting.

How to test the changes locally 🧐

To test this feature you need to create a project for iOS like below:

import ProjectDescription

let project = Project(
    name: "Search",
    targets: [
        Target(
            name: "Search-ios",
            platform: .iOS,
            product: .framework,
            bundleId: "my.bundle.Search",
            deploymentTarget: .iOS(
                targetVersion: "13.0",
                devices: [
                    .iphone,
                    .ipad,
                    .mac
                ]
            ),
            infoPlist: "Info.plist",
            sources: ["Sources/**"]
        )
    ]
)

Checklist ✅

  • The code architecture and patterns are consistent with the rest of the codebase.
  • The changes have been tested following the documented guidelines.
  • The CHANGELOG.md has been updated to reflect the changes. In case of a breaking change, it's been flagged as such.
  • In case the PR introduces changes that affect users, the documentation has been updated.
  • In case the PR introduces changes that affect how the cache artifact is generated starting from the TuistGraph.Target, the Constants.cacheVersion has been updated.

Copy link
Collaborator

@kwridan kwridan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting this @orbitekk 🎉

You are right it seems Xcode by default omits this specific build setting and infers by the current SDK so there could be some merit to removing it.

It would be helpful to add a sample fixture in projects/tuist/fixtures that contains a simple catalyst app to help show case the issue you ran into - looking there I see we don't have any already 😅

I had a quick check locally and seems even when the supported platform is set to iOS we're still able to build, run and archive for Mac destination (provided Mac catalyst option is checked).

supported platform omitted supported platform iOS supported platform iOS + macOS
framework-omitted framework-ios framework-ios-macos

The catalyst destination doesn't appear unless macOS is explicitly added to the list of supported platforms. My understanding of those destinations used to be

  • Mac: macOS application
  • Mac (Catalyst): iPad app with catalyst enabled

Though now I'm not so sure, as I'm able to run a catalyst app using the Mac destination 🤔 - do you have any further insights on this?

Lastly, it seems some of the acceptance tests are failing which may indicate this causes a regression to some of the use cases 😞 - haven't had a chance to dig further into those yet but will post back if I uncover anything.

thanks again!

@orbitekk
Copy link
Contributor Author

Thank you for your reply. As far as I know Apple recommends archiving projects using "generic" destinations (in this case generic/platform=macOS,variant=Mac Catalyst).

I have prepared sample project that shows you my problem (macos platform has beed added to SUPPORTED_PLATFORMS for iOS target). Please run tuist generate && pod install and then try to archive Framework-macOS.
SampleProject.zip

Acceptance tests are failing - that's true. I don't know why and it is still under investigation. I think I need help with that. It's not that easy because I don't know Ruby very well.

@ezraberch
Copy link
Contributor

Acceptance tests are failing - that's true. I don't know why and it is still under investigation. I think I need help with that. It's not that easy because I don't know Ruby very well.

You don't need to know Ruby to investigate this. Just look at the test output, either on CI here or run locally.

There's one failing test, the second one. It's using the ios_app_with_transitive_project fixture and the failing step is warming the cache.

So you can go to that fixture and run tuist cache warm with the version built with your changes and you'll see the specific error you're getting.

@orbitekk
Copy link
Contributor Author

You don't need to know Ruby to investigate this. Just look at the test output, either on CI here or run locally.

When I run the tests using ./fourier test tuist acceptance projects/tuist/features/cache-frameworks.feature:14 locally it doesn't work. I got this:

Then tuist warms the cache                                                                                                               # projects/tuist/features/step_definitions/cache.rb:5
      /Users/<username>/Developer/tuist/.build/release/tuist cache warm --path /var/folders/sb/l7bhksjs0nj67l9mt898ftnh0000gp/T/d20220112-58116-mmlubo
      ** BUILD FAILED **
      
      The 'xcodebuild' command exited with error code 65
      Consider creating an issue using the following link: https://github.com/tuist/tuist/issues/new/choose
       (Minitest::Assertion)
      ./projects/tuist/features/support/system.rb:19:in `system'
      ./projects/tuist/features/step_definitions/cache.rb:9:in `/^tuist warms the cache$/'
      projects/tuist/features/cache-frameworks.feature:18:in `tuist warms the cache'

When I try to run /Users/<username>/Developer/tuist/.build/release/tuist cache warm --path <path to ios_app_with_transitive_project> - it works.

@ezraberch
Copy link
Contributor

When I try to run /Users/<username>/Developer/tuist/.build/release/tuist cache warm --path <path to ios_app_with_transitive_project> - it works.

That's strange. Since the acceptance test is failing, I'm guessing there's some issue with your environment. Are you sure the tuist cache is clean and the binary you're using was compiled using the current branch?

(For the latter, I recommend using ./fourier tuist cache warm --path projects/tuist/fixtures/ios_app_with_transitive_project/ rather than calling the binary directly.)

Copy link
Collaborator

@kwridan kwridan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for investigating and resolving the issues @orbitekk

@danieleformichelli danieleformichelli merged commit f98b442 into tuist:main Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't build target for Mac Catalyst
4 participants