alexsorokoletov / objc-automatic

[Not supported anymore] Automation tool to bind CocoaPods to NuGet packages for Xamarin.iOS
45 stars 15 forks source link

Binding Braintree CocoaPods always fails on sharpie bind #11

Open danstraughn opened 6 years ago

danstraughn commented 6 years ago

The build process and dependencies graph all seems to be correct but it's pointing to an incorrect directory looking for *.h files to use with the sharpie bind -scope.

System.Exception: Error during sharpie bind -output /Users//Projects/auto/auto/bindings/Braintree.PayPalUtils -sdk "iphoneos11.2" -scope /Users//Projects/auto/auto/pods/Braintree.PayPalUtils/XCode/build-out/Debug-iphoneos/Braintree -n DreamTeam.Xamarin.Braintree.PayPalUtils -c -I/Users/*/Projects/auto/auto/pods/Braintree.PayPalUtils/XCode/Pods/Headers/Private -I/Users/****/Projects/auto/auto/pods/Braintree.PayPalUtils/XCode/Pods/Headers/Public -v at Microsoft.FSharp.Core.PrintfModule+PrintFormatToStringThenFail@1379[TResult].Invoke (System.String message) [0x00001] in <59f0bcfedff9fae1a7450383febcf059>:0 at Microsoft.FSharp.Core.PrintfImpl+StringPrintfEnv1[TResult].Finalize () [0x00012] in <59f0bcfedff9fae1a7450383febcf059>:0 at Microsoft.FSharp.Core.PrintfImpl+Final1@224[TState,TResidue,TResult,A].Invoke (Microsoft.FSharp.Core.FSharpFunc2[T,TResult] env, A a) [0x00038] in <59f0bcfedff9fae1a7450383febcf059>:0 at Microsoft.FSharp.Core.OptimizedClosures+Invoke@3253[T2,TResult,T1].Invoke (T2 u) [0x00001] in <59f0bcfedff9fae1a7450383febcf059>:0 at Build2.generateCSharpBindingsForCustom (Build2+Pod pod) [0x001dd] in /Users/*/Projects/auto/auto/build2.fsx:383 at Build2.generateBindingForPod (Build2+Pod pod) [0x000f7] in /Users//Projects/auto/auto/build2.fsx:656 at Build2+clo@782-3.Invoke (Build2+Pod pod) [0x00000] in /Users//Projects/auto/auto/build2.fsx:782 at Microsoft.FSharp.Primitives.Basics.List.iter[T] (Microsoft.FSharp.Core.FSharpFunc2[T,TResult] f, Microsoft.FSharp.Collections.FSharpList1[T] x) [0x00019] in <59f0bcfedff9fae1a7450383febcf059>:0 at Microsoft.FSharp.Collections.ListModule.Iterate[T] (Microsoft.FSharp.Core.FSharpFunc2[T,TResult] action, Microsoft.FSharp.Collections.FSharpList1[T] list) [0x00001] in <59f0bcfedff9fae1a7450383febcf059>:0 at Build2+clo@767-2.Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x000c4] in /Users/*****/Projects/auto/auto/build2.fsx:782 at Fake.TargetHelper+targetFromTemplate@209-1[a].Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x00000] in <5a8d2d45ccf1c534a7450383452d8d5a>:0 at Fake.TargetHelper.runSingleTarget (Fake.TargetHelper+TargetTemplate`1[a] target) [0x00049] in <5a8d2d45ccf1c534a7450383452d8d5a>:0


Build Time Report

Target Duration


Bind Failure

Status: Failure

Any ideas or help would be greatly appreciated!

alexsorokoletov commented 6 years ago

@danstraughn Thank you for the error report! Would you be kind as to show which command you ran and also run same command with an additional param VERBOSE=true and attach complete log (or link to a gist with the log)

danstraughn commented 6 years ago

@alexsorokoletov Of course sir, here is the full log in VERBOSE.

https://gist.github.com/danstraughn/81ba78f1db0749c94282a8952b63fc2e

---EDIT - This also happen with both of the examples that you have provided videos of. There is not one single POD I can find that will succeed, famework or anything. I'm wondering if you get the same results on your local dev box. I'm running latest Xamarin, sharpie and Xcode 9.2.

alexsorokoletov commented 6 years ago

Let me see, will send you an update tomorrow

danstraughn commented 6 years ago

@alexsorokoletov thank you sir!

alexsorokoletov commented 6 years ago

@danstraughn Looking at your log and comparing with the same log I got by running sh bind.sh POD=Braintree/PayPalUtils VERBOSE. Wondering about few things:

  1. In my case BrainTree/PayPalUtils is 4.9.6, in your log it is 4.11.0
  2. Last line that failed in your case is command lipo and it runs with argument -sdk iphoneos12 while in my case it runs with -sdk iphoneos (which is generic way to say same).
  3. With latest master of objc-sharpie and braintree 4.9.6 (not sure why it picked up this version - maybe my cocoapods are out of date - checking that) it successfully generated binding though I believe not all classes were mapped by sharpie.
alexsorokoletov commented 6 years ago

Also tried: sh bind.sh POD=Braintree/PayPalUtils VERBOSE POD_VERSION=4.11.0 and sh bind.sh POD=Braintree/PayPalUtils VERBOSE POD_VERSION=4.11.0 ROOT_HEADER_FILE=PayPalUtils.h

Any of these options generated bindings project (see attached zip) Braintree.PayPalUtils.zip

Here is the log https://gist.github.com/alexsorokoletov/99e34e6a2a901095275cddcf4661d541

@danstraughn can you please make sure you have latest objc-automatic and then run the command: sh bind.sh POD=Braintree/PayPalUtils VERBOSE POD_VERSION=4.11.0 ROOT_HEADER_FILE=PayPalUtils.h

danstraughn commented 6 years ago

@alexsorokoletov

Maybe there's a configuration i'm not seeing that you have enabled that i do not. I'm using the latest git clone from objc-automatic, but it fails just the exact same

https://gist.github.com/danstraughn/d4bcb4e9a0945e60dae4ab984716f31e

It doesn't ever generate any of the things that you reported in those zips posted. I'm not sure but these Braintree Pods are giving me the worst time.

--Edit my log doesn't list the dependecy graph like yours does as well, i'm wondering if something is different between our scripts that are being run.

Same version of -sdk iphoneos i'm not entirely sure what to do about it.

Appreciate you looking at this though!

Thanks

alexsorokoletov commented 6 years ago

@danstraughn I guess I need to add some diagnostics in the tool to check XCode version, sharpie version and cocoapods version. Let's do diagnostics manually then for now and if it helps I will automate it.

  1. Can you run these 3 commands and print output?
xcodebuild -version
Xcode 9.2
Build version 9C40b

sharpie --version  
3.4.0-c0f0e73

pod --version    
1.3.1
  1. Can you repeat last command from your most recent log with some additional args? I've added -v -v to enable max diagnostics mode.
lipo -create -output pods/Braintree.PayPalUtils/XCode/build-out/libBraintree.a /Users/daniel.straughn/Downloads/objc2/pods/Braintree.PayPalUtils/XCode/build-out/libBraintree.device.a /Users/daniel.straughn/Downloads/objc2/pods/Braintree.PayPalUtils/XCode/build-out/libBraintree.sim.a
sharpie bind -output bindings/Braintree.PayPalUtils -sdk "iphoneos" -scope pods/Braintree.PayPalUtils/XCode/build-out/Debug-iphoneos/Braintree  -n DreamTeam.Xamarin.Braintree.PayPalUtils -c  -I pods/Braintree.PayPalUtils/XCode/Pods/Headers/Private -Ipods/Braintree.PayPalUtils/XCode/Pods/Headers/Public -v -v -v

Also difference in logs might be how me/you get the log. I basically copy it from console. I know if you redirect output of objc-automatic to file then it might loose some of the outputs.

danstraughn commented 6 years ago

@alexsorokoletov

OK here are the tool verisions:

----OutPuts Requested ----- xcodebuild -version Xcode 9.2 Build version 9C40b sharpie --version 3.4.0-c0f0e73 pod --version 1.4.0

---New Log https://gist.github.com/danstraughn/9bcd820840958a4faef6fc9611cc6388

Still same failure as before not sure if there's any extra logging that came through.

I just copy and paste straight from Terminal as well. Not pushing it out to a file.

I've tried downgrading the version of Ruby that came across in your log, still didn't change anything. I've tried also to install a specific version of the pod by clearing pod cache but it always forces to the latest for some reason.

Thanks again hope this helps some.

------EDIT------- Downgrading gem cocoapods to your version 1.3.1 fixed the issue entirely. I cannot use the latest version of cocoapods along with this script. What a crazy thing!

alexsorokoletov commented 6 years ago

@danstraughn Now I see where the issue is. Let me check how do we make it work with latest cocoapod and go from there.

I would be happy not to have these issues but in order to make it work we need to bridge several different tools and they all have changes and some evolution.

Wondering, though, why do you need to use latest version of cocoapods to make a binding for Xamarin? As far as I see this will not change anything in the final output.

danstraughn commented 6 years ago

@alexsorokoletov thanks for getting me this far! This script could save tons of time for me in making packages consumable by our teams.