Quick / Nimble

A Matcher Framework for Swift and Objective-C
https://quick.github.io/Nimble/documentation/nimble/
Apache License 2.0
4.81k stars 601 forks source link

build failure on using Nimble on visionOS Apps #1147

Open desusai7 opened 5 months ago

desusai7 commented 5 months ago

What did you do?

I am using Nimble for a Unit Testing Bundle on a visionOS app, and tried building the unit tests target in order to run the tests

What did you expect to happen?

Expected the unit tests target to be built successfully and the tests to be run succesfully.

What actually happened instead?

The build got failed with an error saying:

While building for visionOS Simulator, no library for this platform was found in '/Users/user_name/sample-apps/visionOS/visionOSCarthage/Carthage/Build/Nimble.xcframework'.

image

Environment

List the software versions you're using:

Please also mention which package manager you used and its version. Delete the other package managers in this list:

younata commented 5 months ago

This is known. Though it was reported to Quick, making it a bit harder to find.

As this comment notes, a workaround is to manually add CwlPreconditionTesting as a swift package dependency to your unit test's library.

Fixing this is on my roadmap, and I'm still figuring out what a fix would look like.

desusai7 commented 5 months ago

@younata, I've tried adding the package you've mentioned, but I am still seeing the same error.

Moreover, I couldn't find folders for xros within the .xcframework files from your latest release. Attaching a screenshot of the same below:

image

desusai7 commented 5 months ago

Moreover, I believe the issue you are referring to is a bit different from the visionOS issue I've described here

desusai7 commented 5 months ago

I had tried generating .xcframework file locally using the task defined in your rakefile and was able to see the folders for xros too.

Can you please fix the .xcframework.zip included in the latest releases of both Quick and Nimble to include the folders for xros ?

image

younata commented 5 months ago

Oh. Yes. That's also an issue for visionOS specifically.

This is an interesting challenge. Currently we build the Carthage artifacts on a version of Xcode that doesn't support visionOS. One possible solution is to build the visionOS slice on a different machine and then merge the slices together, but... that's a lot of effort compared to the other solution: bump the minimum Xcode/swift version.

Especially since Nimble 14 (the next version) will include an Xcode version bump anyway (right now, it's looking like we'll be going directly to Xcode 16).

For the time being, don't use the pre-built artifacts with Carthage. Sorry.