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

Skip targets with unsupported platforms instead of throwing an error #6047

Merged
merged 1 commit into from Mar 8, 2024

Conversation

fortmarek
Copy link
Member

Resolves #6030

Short description πŸ“

We should only skip targets in the PackageInfoMapper that have only unsupported platforms as a condition, such as linux.

How to test the changes locally 🧐

  • You should be able to generate and build the app_with_spm_dependencies fixture. The error was caused by this SwiftLint target that has a condition with linux only

Contributor checklist βœ…

  • The code has been linted using run mise run lint:fix
  • The change is tested via unit testing or acceptance testing, or both
  • The title of the PR is formulated in a way that is usable as a changelog entry
  • In case the PR introduces changes that affect users, the documentation has been updated

Reviewer checklist βœ…

  • The code architecture and patterns are consistent with the rest of the codebase
  • Reviewer has checked that, if needed, the PR includes the label changelog:added, changelog:fixed, or changelog:changed, and the title is usable as a changelog entry

@fortmarek fortmarek added the changelog:fixed PR will be listed in the Fixed section of CHANGELOG label Mar 7, 2024
@fortmarek fortmarek force-pushed the fix/error-unsupported-platform branch from 1624bc1 to b82feda Compare March 7, 2024 19:51
@@ -486,6 +486,11 @@ public final class PackageInfoMapper: PackageInfoMapping {
do {
let condition = try ProjectDescription.PlatformCondition.from(setting.condition)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesnt throw anymore, so we should be able to update this callsite and remove the do {} catch {} also

Copy link
Member Author

Choose a reason for hiding this comment

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

oh yeah, good point

@waltflanagan
Copy link
Collaborator

I'm not able to find where this ended up being able to throw out in a way that would end up failing things. Is the code that doesnt handle the throw in tuist cloud?

@fortmarek
Copy link
Member Author

fortmarek commented Mar 8, 2024

I'm not able to find where this ended up being able to throw out in a way that would end up failing things. Is the code that doesnt handle the throw in tuist cloud?

No, tuist generate would throw when mapping the PackageInfo from https://github.com/realm/SwiftLint. I'm actually now also not sure why the error was not caught but I feel like this refactor is fine.

@fortmarek fortmarek force-pushed the fix/error-unsupported-platform branch from b82feda to 0290b7a Compare March 8, 2024 08:18
@fortmarek fortmarek merged commit cf4063f into main Mar 8, 2024
8 checks passed
@fortmarek fortmarek deleted the fix/error-unsupported-platform branch March 8, 2024 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:fixed PR will be listed in the Fixed section of CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tuist cache fails
3 participants