buildasaurs / XcodeServerSDK

Access Xcode Server API with native Swift objects.
MIT License
398 stars 30 forks source link

BuildaUtils for iOS target #89

Closed cojoj closed 9 years ago

cojoj commented 9 years ago

I've tried to run today XcodeServerSDK's iOS target I get this rather strange error:

screen shot 2015-07-29 at 10 43 52

It looks like our Podfile is linking wrong BuildaUtils target. Any idea what's wrong?

czechboy0 commented 9 years ago

Weird: https://github.com/CocoaPods/Specs/blob/master/Specs/BuildaUtils/0.0.8/BuildaUtils.podspec.json#L15

cojoj commented 9 years ago

I know, I know... I'm reinstalling Xcode (this crazy lil bastard) and I'll check on this one more time!

cojoj commented 9 years ago

Nope, nothing... Still getting this error.

Take a look at this: https://github.com/Alamofire/Alamofire/issues/106

czechboy0 commented 9 years ago

Delete derived data?

czechboy0 commented 9 years ago

Hmm I'm still confused. How can we change the podspec to work for iOS as well? I thought that would already be working now.

cojoj commented 9 years ago

Derieved data deleted, Xcode reinstalled... Nothing seems to help!

cojoj commented 9 years ago

When I did modify Podfile iOS targets to look like:

target 'XcodeServerSDK - iOS' do
    platform :ios, '9.0'
    pod utils_name, utils_version
end

target 'XcodeServerSDK - iOS Tests' do
    platform :ios, '9.0'
    pod utils_name, utils_version
    pod 'DVR', :git => "https://github.com/czechboy0/DVR.git", :tag => "v0.0.3-czechboy0"
end

everyting started working for iOS but unexpectedly OS X target fails with:

zrzut ekranu 2015-07-29 o 21 33 15

czechboy0 commented 9 years ago

Damn, this is annoying! Maybe something to file with CocoaPods?

cojoj commented 9 years ago

¯(ツ)

There are many possible scenarios... I think I'd be great if some Cocoapods guru can take a glipse at the project itself and at Podfile. Maybe @neonichu 😜

neonichu commented 9 years ago

probably deintegration woes, try out https://github.com/kylef/cocoapods-deintegrate and then pod install again (see also CocoaPods/CocoaPods#2471)

cojoj commented 9 years ago

I did deintegration... I did add platform to each target...

😭

neonichu commented 9 years ago

How can I repro this?

cojoj commented 9 years ago

Just git clone this repo and try building it for different targets (OS X, iOS and watchOS) but from swift-2 branch 😉

Current Podfile should fail for iOS and when you specify platform it'll fail for OS X.

neonichu commented 9 years ago

In this case, you should rather explicitly define the platform for each target, like this:

diff --git a/Podfile b/Podfile
index eef1f20..19c7bd6 100644
--- a/Podfile
+++ b/Podfile
@@ -5,24 +5,29 @@ utils_name = 'BuildaUtils'
 utils_version = '0.0.8'

 target 'XcodeServerSDK - OS X' do
+platform :osx, '10.10'
 pod utils_name, utils_version
 end

 target 'XcodeServerSDK - OS X Tests' do
+platform :osx, '10.10'
 pod utils_name, utils_version
 pod 'DVR', :git => "https://github.com/czechboy0/DVR.git", :tag => "v0.0.3-czechboy0"
 end

 target 'XcodeServerSDK - iOS' do
+platform :ios, '8.0'
 pod utils_name, utils_version
 end

 target 'XcodeServerSDK - iOS Tests' do
+platform :ios, '8.0'
 pod utils_name, utils_version
 pod 'DVR', :git => "https://github.com/czechboy0/DVR.git", :tag => "v0.0.3-czechboy0"
 end

 target 'XcodeServerSDK - watchOS' do
+platform :watchos, '2.0'
 pod utils_name, utils_version
 end

However, this still doesn't seem to work, because the target dependencies aren't being set up correctly.

cojoj commented 9 years ago

And in that case I get linker command failed... for OS X while other platforms work as supposed.

czechboy0 commented 9 years ago

What's the status of this, @cojoj?

cojoj commented 9 years ago

Looks like we're stuck... No matter what we put where one platform won't work. I really have no idea what else we can do.

I've tried extracting

pod utils_name, utils_version

outside any target but no luck here... 😓


I think that right now we're trying to fix issue related to BuildaUtils... Maybe fact that we have two targets there or some missing things in project.pbxproj.

czechboy0 commented 9 years ago

BuildaUtils shouldn't affect this, it just provides a bunch of .swift files, the project file isn't used by CocoaPods AFAIK.

czechboy0 commented 9 years ago

@neonichu Does this have anything to do with the recent change in CocoaPods in an attempt to reduce duplicate targets? We basically have the same code just compiled for different targets here.

neonichu commented 9 years ago

@czechboy0 possibly, I am honestly not sure why exactly it is failing

czechboy0 commented 9 years ago

:cry: Thanks anyway.

czechboy0 commented 9 years ago

Closing this due to #110 being merged (so this isn't an issue any more).