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

When using Starscream via Carthage, projects must also include zlib folder #445

Closed
iOSGeekster opened this issue Dec 19, 2017 · 9 comments
Closed

Comments

@iOSGeekster
Copy link

When including Starscream with Carthage, project can compile properly, as long as Starscream/zlib resides in Carthage/Checkouts. This should not be the case. So projects that includes Starscream should copy the zlib folder to the project dir, and add it to "Swift compiler - Search Path" in Build Settings.
I think the readme should reflect that?

@daltoniam
Copy link
Owner

I don't think you should have to do that if I understand how Carthage works properly. I'll admit my knowledge of Carthage is limited, but I thought the Cartfile and such would handle the dependencies?

@rastersize
Copy link
Contributor

@daltoniam Carthage will “only” resolve and download (and build if there’s a framework target) dependencies. Carthage won’t link the dependencies or add them to any Xcode project automatically.

So the modules downloaded by Carthage are actually redundant. Since Starscream isn’t using them for its framework target from what I can tell. I’d recommend removing the Cartfile all-together to be honest. Unless you intend to use it as the tool to pull in those dependencies for Starscream itself?

The same seems to apply to the SPM setup. Since Starscream is using the modulemap in the bundled zlib/ directory. This is configured via SWIFT_INCLUDE_PATHS = $SRCROOT/zlib.

As it is right now the Cartfile results in a perpetually dirty repository for Carthage users. As Carthage creates Carthage/{Checkouts,Build}/ directories that aren’t in your .gitignore. For now the way I’m handling that is after Carthage is done I run a cleanup job which basically executes rm -r Carthage/Checkouts/Starscream/Carthage.

To be honest I think bundling the module map as a single file is the best course of action. Even though it sometimes messes up LLDB (¯\_(ツ)_/¯).

@rastersize
Copy link
Contributor

rastersize commented Jan 30, 2018

I made a small example repo showcasing that the Carthage dependencies aren’t needed. As well as how Carthage works and how to integrate Starscream via Carthage.

The master branch contains a bare-bone project, Starscream pulled in via Carthage. The dependencies pulled in by Starscream via Carthage have been removed.

The no-carthage-deps-fork branch is the same as master except it uses a branch on my fork where the Cartfile and Cartfile.resolved files have been removed. This is the same branch for PR #461.

The with-zlib-cc-spm branch contains the same code except the Carthage/Checkouts directory in Carthage/Checkouts/Starscream/ has not been removed. This is mostly just as a reference.

I hope that helps clarifying the situation 🙂

@acmacalister
Copy link
Collaborator

I think #461 should address this issue. If you could try it out of master and see if works, that would great!

@codeOfRobin
Copy link

@acmacalister Doesn't look like it worked for me 😕

@optikfluffel
Copy link

@acmacalister @codeOfRobin I just deleted the Carthage/Checkouts/Starscream/zlib folder and I'm not sure it's all working yet (sorry, new to Swift and Xcode xD) but at least it builds.

@Bersaelor
Copy link

Bersaelor commented Apr 3, 2018

I detailed what worked for my project here :

After every carthage update we delete the SSCZLib and SSCommonCrypto modulemap entries in
./Carthage/Checkouts/SwiftPhoenixClient/Example/Pods/Starscream/zlib.

Also we added $(SRCROOT)/Carthage/Checkouts/Starscream/zlib/ under Swift Compiler - Search Paths -> Import Paths in the Project Build Settings.

@bayareahank
Copy link

@Bersaelor Thanks, the hack made my code run again, after blocked by this bug for several months.

One question though, what purpose does the last step serve, can it be skipped? I run the code under Xcode 9.3 without the last step, it seems to be fine so far.

Thanks again.

@fassko
Copy link
Collaborator

fassko commented Oct 10, 2018

Please check with 3.0.6 version.

@fassko fassko closed this as completed Oct 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants