finestructure / Arena

A command line tool to create Swift Playground projects with SPM package dependencies
MIT License
685 stars 16 forks source link

Arena fails when package platforms contain `.macCatalyst(_:)` #90

Closed moyerr closed 1 year ago

moyerr commented 1 year ago

When running arena on a package that contains explicit support for macCatalyst(_:), the script fails with the following error:

Error: dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "platforms", intValue: nil), _JSONKey(stringValue: "Index 1", intValue: 1), CodingKeys(stringValue: "platformName", intValue: nil)], debugDescription: "Cannot initialize Name from invalid String value maccatalyst", underlyingError: nil))
finestructure commented 1 year ago

Thanks for reporting this, I think I know where this goes wrong :)

Is the package available somewhere so I can test a fix?

moyerr commented 1 year ago

@finestructure It was happening for me with a local package, but it was a local copy of my own package found here. It has no releases yet, so if you want to try to reproduce with this one, you may have to target the main branch.

finestructure commented 1 year ago

Sorry for the long delay in getting to this issue, @moyerr .

I've fixed the parsing error and the playground now generates correctly. However, the package doesn't seem to build in the generated playground and I'm afraid I don't think this is something that is Arena-specific or something I can fix :(

yo1995 commented 1 year ago

However, the package doesn't seem to build in the generated playground

For future readers' reference: might not apply to the package mentioned above, but for our case (arcgis-maps-sdk-swift) since the package only targets iOS/Mac Catalyst, I got the build errors when the playground "Platform" was set to "macOS". Changing it to "iOS" makes the playground execute correctly to access ArcGIS types.

image

finestructure commented 1 year ago

Ah of course, that's a great point!