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

Using 3drobotics branch of grpc-swift #105

Merged
merged 1 commit into from
Jan 17, 2019
Merged

Conversation

byuarus
Copy link
Collaborator

@byuarus byuarus commented Jan 9, 2019

Fix for #104

Tested with:

  • XCode 10.1
  • Carthage 0.31.2
  • ruby 2.5.3p105 (Xcode will run ruby scripts before build phase)

Resolves #104

Copy link
Collaborator

@JonasVautherin JonasVautherin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't seem to build for me :/

@sbporter
Copy link

sbporter commented Jan 11, 2019

It doesn't build for me either. Same build failed error from Carthage as before.

Please update to the latest Carthage version: 0.31.2. You currently are on 0.31.1
*** Checking out DronecodeSDK-Swift at "0.1.6"
*** Checking out grpc-swift at "23a0ebdee9613f615f2f2469ed3e700df5856417"
*** Checking out RxSwift at "4.4.0"
*** xcodebuild output can be found in /var/folders/h2/l2vxsyq53m15kb23cg_hn4hm0000gn/T/carthage-xcodebuild.KO5pQr.log
*** Downloading binary-only framework backend at "https://s3.eu-central-1.amazonaws.com/dronecode-sdk/backend.json"
*** Downloading binary-only framework MobileVLCKit at "https://code.videolan.org/videolan/VLCKit/raw/master/Packaging/MobileVLCKit.json"
*** Downloading RxSwift.framework binary at "Atomic"
*** Building scheme "SwiftGRPC-Carthage-Package" in SwiftGRPC-Carthage.xcodeproj
Build Failed
	Task failed with exit code 65:
	/usr/bin/xcrun xcodebuild -project /Users/Seth/Downloads/DronecodeSDK-Swift-Example-JMachuca/Carthage/Checkouts/grpc-swift/SwiftGRPC-Carthage.xcodeproj -scheme SwiftGRPC-Carthage-Package -configuration Release -derivedDataPath /Users/Seth/Library/Caches/org.carthage.CarthageKit/DerivedData/10.1_10B61/grpc-swift/23a0ebdee9613f615f2f2469ed3e700df5856417 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/h2/l2vxsyq53m15kb23cg_hn4hm0000gn/T/grpc-swift SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/Seth/Downloads/DronecodeSDK-Swift-Example-JMachuca/Carthage/Checkouts/grpc-swift)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/h2/l2vxsyq53m15kb23cg_hn4hm0000gn/T/carthage-xcodebuild.KO5pQr.log```

@JonasVautherin
Copy link
Collaborator

Even with Swift 4.2.1 (installed by Xcode 10.1), I need to go inside Carthage/Checkouts/grpc-swift and run swift package resolve manually in order for the build to succeed.

Somehow the Run script phase does not appear when I open SwiftGRPC-Carthage.xcodeproj from your branch with Xcode 10. And I don't get where patch-carthage-project.rb is called. It is supposed to be called at some point when I run make project-carthage, isn't it?

@byuarus
Copy link
Collaborator Author

byuarus commented Jan 15, 2019

Hi @JonasVautheri I will try to explain how it should work in theory.

  • The maintainers of the swift-grpc repo should run make project-carthage (I already did it in my branch). It will generate a SwiftGRPC-Carthage.xcodeproj from a template and two scripts will be called to modify the file (fix-project-settings.rb and patch-carthage-project.rb).
  • I've changed the logic of patch-carthage-project.rb. It will add "SwiftProtobuf" target to "SwiftGRPC-Package.xcscheme" and pre-actions before every build:
cd ${PROJECT_DIR}
swift package resolve // Will create a .build/ folder when you build it for the first time
ruby fix-carthage-paths.rb SwiftGRPC-Carthage.xcodeproj // Will fix paths to dependecies from the previous step to match the paths in the SwiftGRPC-Carthage.xcodeproj file

@byuarus
Copy link
Collaborator Author

byuarus commented Jan 15, 2019

  • swift package resolve should be called every time you try to build a project.
  • patch-carthage-project.rb is called only by repo maintainers when run make project-carthage

@JonasVautherin
Copy link
Collaborator

It's actually working! My issue was with swiftenv: something (Xcode?) apparently sets SWIFT_VERSION to "4.2", and swiftenv is not happy with that because my system has "4.2.1" installed. Apparently, building directly from Xcode works.

I uninstalled swiftenv, and it now builds!

@sbporter: do you have swiftenv installed, too? Can you have a detailed look at the output log and see what the error is?

@JonasVautherin
Copy link
Collaborator

@byuarus: Would you mind opening a PR to grpc-swift (it would solve grpc/grpc-swift#329)? It would be nice to have that merged upstream instead of maintaining your fork.

I will wait a bit (a day or so) before merging, so that @sbporter has a chance to give us more information from his side.

@sbporter
Copy link

@JonasVautherin Yes I do have swiftenv installed. I just uninstalled it, cleared my carthage cache and checkouts folder and tried building again, but it failed with the same error. I've got to run to work now, but I can look at it more when I get home.

@JonasVautherin
Copy link
Collaborator

@sbporter: Thanks for checking that. Make sure you uninstall swiftenv completely (e.g. I had aliases in ~/.bash_profile) and start a new terminal after it is done.

@sbporter
Copy link

@JonasVautherin Restarting my terminal fixed the issue. Feel free to merge! Thanks.

@JonasVautherin JonasVautherin merged commit 97da1e6 into master Jan 17, 2019
@JonasVautherin JonasVautherin deleted the dmitry/XCode10Support branch January 17, 2019 08:53
@byuarus
Copy link
Collaborator Author

byuarus commented Jan 17, 2019

@JonasVautherin PR to the upstream: grpc/grpc-swift#360

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

Successfully merging this pull request may close these issues.

3 participants