pointfreeco / swift-issue-reporting

Report issues in your application and library code as Xcode runtime warnings, breakpoints, assertions, and do so in a testable manner.
https://www.pointfree.co
MIT License
391 stars 64 forks source link

fix issue with linux build failing due to missing testing #126

Closed doozMen closed 2 months ago

doozMen commented 2 months ago

Here's a more polished and professional version of your description that would be suitable for a pull request:


Description of the Issue

On a Linux build where I use case-paths, I encountered an issue that required me to add the swift-testing dependency explicitly. While testing on macOS, I found that this did not conflict with the existing Xcode setup, but to ensure compatibility across both platforms, it seems safest to add the dependency explicitly.

This issue arose because I use swift-testing in the project, and while it enabled me to run tests on Linux, it caused the build to fail when testing code that uses case-paths. The failure occurred because case-paths could not import Testing. I had been using Testing for running tests but had not listed it as a dependency in the target that uses it.

Solution

To resolve this, I have added swift-testing as an explicit dependency for the target using case-paths. This approach ensures the tests run correctly on Linux while maintaining compatibility with macOS. Since the dependency can only be added if it’s listed in the package, I opted to remove the #if condition to avoid build failures on macOS.


By explicitly including the swift-testing dependency, this change ensures a smoother experience for both Linux and macOS builds, eliminating issues related to missing dependencies during testing.


This more polished version will help present your change more clearly when submitting a pull request. Let me know if you need any adjustments!

The build fail on linux

Screenshot 2024-09-06 at 12 51 33
mbrandonw commented 2 months ago

Hi @doozMen, I don't think we can accept this PR as-is because people using this library for Apple platforms will suddenly incur the cost of compiling macros when it's not actually needed. Also, according to this thread, Swift Testing is coming to the various Swift toolchains very soon, and so this shouldn't be necessary. In fact, it seems that the swift:nightly snapshot already has it. Can you try using that snapshot?

mbrandonw commented 2 months ago

I'm going to close this for now, but we are happy to reconsider if there is reason to believe this is the correct way to move forward.

doozMen commented 2 months ago

Ok will have to see then how to solve it. I'm using the nightly but I was using nightly-6.0. This seams to suggest I should use the swift:nightly. Will try that then. Thanks for the quick response.