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

throwAssertion not working with Rosetta #961

Closed
1 task done
Veeit opened this issue Jan 27, 2022 · 15 comments
Closed
1 task done

throwAssertion not working with Rosetta #961

Veeit opened this issue Jan 27, 2022 · 15 comments
Labels
Milestone

Comments

@Veeit
Copy link

Veeit commented Jan 27, 2022

  • I have read CONTRIBUTING and have done my best to follow them.

What did you do?

I upgraded my system to M1 Pro hardware, installed the project with Pod Install. Changed Xcode to Rosetta Mode (I need this because we have not updated xcframeworks inside the project). And run the tests, I now get a fatalError as soon as a test wants to test it. The tests are working fine inside the pipeline and on Intel. I updated Nimble to use the current main Branch because I saw there is a commit for it. But that didn't help.

I would love to see a update for this, and that the throwAssertion is working again.

Environment

List the software versions you're using:

  • Quick: 4.0.0
  • Nimble: 9.2.1 (and tested main Branch from 27.01.2021)
  • Xcode Version: 13.2.1 (13C100)
  • Swift Version: Xcode Defaul

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

  • Cocoapods: 1.11.2
@pixelier
Copy link

Same here. It seems that this has been fixed. We're waiting for the next release.

@Veeit
Copy link
Author

Veeit commented Jan 31, 2022

I have already checked if the current state of the project fixes the problem, unfortunately it does not.

@mycoolcorp
Copy link

I also still see the issue when using main branch. I'm not using Xcode Rosetta, but I have excluded arm64 architecture so simulator/tests are still running against x86.

@NateFuller
Copy link

Bumping this, running to this issue as well. Created a test project demonstrating the issue here

@NateFuller
Copy link

@Veeit - since you've been dealing with this for almost a month now, wondering if you've found any useful workarounds. Are you just commenting out tests? Or perhaps only conditionally running the tests based on current architecture?

@Veeit
Copy link
Author

Veeit commented Feb 25, 2022

I removed the throwAssertion from nimble, that will not runt the tests but it will allow you to run everything else.
If you have a pipeline or something like this just keep my fix local, that way the pipeline can still run the broken tests and give you some feedback if something is broken.
https://github.com/Veeit/Nimble

@byohay
Copy link

byohay commented Apr 5, 2022

It works perfectly fine when the debugger is not attached (Edit scheme -> Test -> Uncheck "Debug Executable"). I suspect that the debugger handles the exception before the exception handler (The one that throwException registers) can do anything with it.
But I'm not sure why it would happen only when running with Rosetta.

@younata younata added this to the v10 milestone Apr 15, 2022
@younata
Copy link
Member

younata commented Apr 15, 2022

This is definitely something we should fix as soon as we can. Ultimately, my investigation was able to trace it down to an issue with CwlPreconditionTesting, and they already have an open issue for that. Unfortunately, I have no idea how to investigate why this is happening, let alone what I could do to fix it. I'll monitor that issue and update the version Nimble ships with once it's fixed.

I'm so sorry about this!

@NateFuller
Copy link

Thanks for the update @younata - really excited to have you helping us out 🙏 🙏

@younata
Copy link
Member

younata commented Apr 23, 2022

I'm going to bump this to the v11 milestone. If there's a fix released for this upstream, we'll issue a bugfix release of Nimble including that fix.

@younata younata modified the milestones: v10.0.0, v11.0.0 Apr 23, 2022
@NateFuller
Copy link

NateFuller commented Apr 25, 2022

Just an update - may be obvious, but I don't think this is only due to enabling Rosetta. It may just be whenever running on an iOS Simulator using an Intel-based architecture on an M1 mac.

I unticked "Open with Rosetta" for both Xcode and Simulator on my machine, but added arm64 as an excluded architecture for my Cocoapods "Pods" target as well as my project target, and the same issue happens when running my Nimble unit test suites.

@NateFuller
Copy link

For anyone still following this, we implemented a temporary solution to essentially wrap actual exception handling within our test executions.

Here's a gist that roughly outlines how we're circumventing this issue.

@asiliuk
Copy link

asiliuk commented Jun 7, 2022

Just an update - may be obvious, but I don't think this is only due to enabling Rosetta. It may just be whenever running on an iOS Simulator using an Intel-based architecture on an M1 mac.

I unticked "Open with Rosetta" for both Xcode and Simulator on my machine, but added arm64 as an excluded architecture for my Cocoapods "Pods" target as well as my project target, and the same issue happens when running my Nimble unit test suites.

This is the same problem actually, just from a different angle. Looks like it fails to capture assertion when it is thrown on arm64 device in x86_64 mode. By adding arm64 as excluded architecture it falls back to building app for x86_64 that results in a same thing as if Xcode was run with Rosetta

@younata younata modified the milestones: v11.0.0, v12.0.0 Oct 31, 2022
@younata
Copy link
Member

younata commented Oct 31, 2022

Bumping this to the next (major?) release in favor of getting async/await support out the door sooner.

@younata
Copy link
Member

younata commented Apr 4, 2023

Per Matt Gallagher, this is apparently ultimately a bug with lldb on rosetta? His suggestion is to disable "Debug executable" for the test target when you're running under rosetta.

mattgallagher/CwlPreconditionTesting#26 (comment)

I'm going to close this, even though it's not a satisfying ending. My apologies for the inconvenience.

@younata younata closed this as completed Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants