grpc / grpc-swift

The Swift language implementation of gRPC.
Apache License 2.0
2.04k stars 420 forks source link

Release 0.7.0 Make Error #385

Closed a75c6 closed 5 years ago

a75c6 commented 5 years ago

New Issue Checklist

Issue Description

Running make leads to the following error:

In file included from /grpc-swift-0.7.0/.build/checkouts/swift-nio-http2.git--3952576656188131713/Sources/CNIONghttp2/shims.c:14:
/grpc-swift-0.7.0/.build/checkouts/swift-nio-http2.git--3952576656188131713/Sources/CNIONghttp2/include/c_nio_nghttp2.h:17:10: fatal error: 'nghttp2/nghttp2.h' file not found
#include <nghttp2/nghttp2.h>
         ^~~~~~~~~~~~~~~~~~~
1 error generated.
error: terminated(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /grpc-swift-0.7.0/.build/debug.yaml main output:

make: *** [all] Error 1

This seems to be coming from a reference in the Package.swift file to a specific commit:

.package(url: "https://github.com/apple/swift-nio-http2.git", .revision("dd9339e6310ad8537a271f3ff60a4f3976ca8e4d"))

Here is the commit being referenced: https://github.com/apple/swift-nio-http2/commit/dd9339e6310ad8537a271f3ff60a4f3976ca8e4d

I noticed that in the https://github.com/apple/swift-nio-http2.git instructions it requires nghttp2 to be installed: https://github.com/apple/swift-nio-http2#building

I installed from source on OSX and this resolved the error.

It is also possible to update the Package.swift as follows to use the latest version of the library:

.package(url: "https://github.com/apple/swift-nio-http2.git", .upToNextMinor(from: "0.2.1"))

Should there be an indication that the installing of nghttp2 is required and should the library used be updated to the latest version?

Complete output when running grpc-swift, including the stack trace and command used
[INSERT OUTPUT HERE]

Environment


| Key                           | Value                                                         |
| ----------------------------- | --------------------------------------------------------------|
| OS Version                    |  10.14.3                                                       |
| Swift Version                 |   4.2                                                       |
| Xcode Version                 |   10.1                                                       |
| gRPC-Swift Version            |   0.7.0                                                       |
| gRPC-Swift Version            |   0.7.0                                                       |
| protoc Version                |   3.6.1                                                       |
| protoc-gen-swift Version      |   0.7.0                                                       |
| protoc-gen-swiftgrpc Version  |   0.7.0                                                       |
  
MrMage commented 5 years ago

I think this will go away once we can use the version of NIOHTTP2 that does not require libnghttp2. But it looks like that version requires the Swift 5 compiler. @lukasa, is there a no-libnghttp2 that does not require Swift 5?

Until then, we could instruct users to only build the product they need (make currently builds all targets, I think; we could change that to only build the non-NIO version), or update the instructions to tell users to install libnghttp2 with brew. I could do either change; @rebello95, what do you think?

Lukasa commented 5 years ago

I think this will go away once we can use the version of NIOHTTP2 that does not require libnghttp2. But it looks like that version requires the Swift 5 compiler. @Lukasa, is there a no-libnghttp2 that does not require Swift 5?

There is not, and there is no plan to make one available at this time.

MrMage commented 5 years ago

There is not, and there is no plan to make one available at this time.

That's understandable. I guess we'll need to use one of the other workarounds then, or move the NIO version to a separate repo or branch. I think @glbrntt had suggested something like that offline.