Coder Social home page Coder Social logo

Comments (9)

finestructure avatar finestructure commented on August 31, 2024 1

Raised as FB8882995. From what I gather this might be a problem with playgrounds.

from arena.

finestructure avatar finestructure commented on August 31, 2024 1

This might require defining all the other XCTest symbols though - the library only declares XCTFail.

from arena.

vzsg avatar vzsg commented on August 31, 2024

I did some tests, it seems the RxTest product is the one that kills the mood.
The other four, in any combination, work fine.

I wonder what's so special about it... The only thing I see is this symlink.

That symlink is a red herring, Xcode could clone it just fine and it appeared as a regular file at the proper place. In fact, the complete Sources folder in RxSwift is just a bunch of symlinks.

There was another red herring in the build logs:

image

Changing the deployment target in Dependencies/Package.swift to macOS 10.15 made the warning go away, but did not change the original error.


My next suspicion is the fact that RxTest is pulling in XCTest, and that might somehow be illegal for a playground.

from arena.

vzsg avatar vzsg commented on August 31, 2024

It's definitely the XCTest import! There is a single file inside RxTest that imports it.
After removing this file from the project, the playground started working.


On a whim, I tried to make a playground for Nimble, and that resulted in the same kind of errors.

from arena.

finestructure avatar finestructure commented on August 31, 2024

Thanks a lot for raising this and finding out about XCTest!

I know XCTest didn't work in playgrounds in the past but I thought that wasn't a problem anymore. I'll see what I can do.

from arena.

Peter-Schorn avatar Peter-Schorn commented on August 31, 2024

A similar issue occurs when you try to add a SPM package product that imports XCTest to a command line project. In order for the project to build you must make certain changes to the build settings:

For the project build settings, search for "Runpath Search Paths" and add the following paths:

  • /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/
  • /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/

For the project build settings, set "Enable Testing Search Paths" to "Yes"

You don't have access to these settings in a playground, so there's probably nothing you can do.

from arena.

finestructure avatar finestructure commented on August 31, 2024

@pointfreeco have come up with a workaround to ship XCTFail in library code and I wonder if this would work in a playground as well.

It's using their new package XCTest Dynamic Overlay. I'll need to try this but perhaps adding this package and import XCTestDynamicOverlay at the top might work?

from arena.

finestructure avatar finestructure commented on August 31, 2024

I wonder if conditional linking of XCTest would be a workable solution (upstream): https://github.com/apple/swift-collections/blob/main/Package.swift#L72-L81

from arena.

finestructure avatar finestructure commented on August 31, 2024

I've just tried this with RxSwift 6.5.0 and Xcode 14.1 and this seems to be fixed now:

CleanShot 2022-11-30 at 08 44 35@2x

from arena.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.