Page MenuHomePhabricator

[services] Export comm's grpc generated files as cmake project
ClosedPublic

Authored by jon on Apr 27 2022, 5:00 PM.
Tags
None
Referenced Files
F2082473: D3867.id14668.diff
Sun, Jun 23, 2:10 AM
Unknown Object (File)
Fri, Jun 21, 7:19 AM
Unknown Object (File)
Sun, Jun 16, 6:31 PM
Unknown Object (File)
Fri, Jun 14, 12:19 PM
Unknown Object (File)
Fri, Jun 14, 3:10 AM
Unknown Object (File)
Thu, Jun 13, 6:55 AM
Unknown Object (File)
Wed, Jun 12, 11:25 PM
Unknown Object (File)
Wed, Jun 12, 5:45 PM

Details

Summary

Allows for packaging of the grpc generated files, this allows for
downstream packages such as tunnelbroker to then find_package(comm-grpc)
and use the related targets and avoids needing to interact with
code generation logic.

Depends on D4294

Test Plan

nix build .#comm-grpc

Then inspect ./result

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Restore NativeModules.{h,cpp}

Their generation is a bit more involved with react-native

This revision is now accepted and ready to land.Jun 21 2022, 8:18 PM
This revision now requires review to proceed.Jun 21 2022, 8:18 PM
ashoat added inline comments.
native/cpp/CommonCpp/grpc/CMakeLists.txt
54 ↗(On Diff #13584)

Weird indentation here – can this close paren be unindented?

59 ↗(On Diff #13584)

Weird indentation here – can this close paren be unindented?

native/cpp/CommonCpp/grpc/cmake/FindGRPCComm.cmake
37 ↗(On Diff #13584)

Can this close paren get a newline?

nix/comm-grpc.nix
28 ↗(On Diff #13584)

Can we get rid of this extraneous newline?

This revision is now accepted and ready to land.Jun 22 2022, 10:48 AM

comments addressed

native/cpp/CommonCpp/grpc/CMakeLists.txt
54 ↗(On Diff #13584)

not sure why, but this is the default for vim settings, but it's probably just inheriting it from the line above

jon marked an inline comment as done.

Apply new header scheme

This revision now requires review to proceed.Jun 27 2022, 9:20 AM
native/cpp/CommonCpp/grpc/cmake/FindGRPCComm.cmake
34 ↗(On Diff #13698)

Would be great if we could keep lines to 80 chars. Not sure how hard that is to do in this context, though. Some languages have weird quirks and so we generally don't worry about the 80 chars rule (Objective-C, bash)... should we consider CMake to be one of these languages?

max added inline comments.
native/cpp/CommonCpp/grpc/CMakeLists.txt
16 ↗(On Diff #13698)

Not sure we need to iterate all of this in such a long comment. But I do not insist on it.

native/cpp/CommonCpp/grpc/cmake/FindGRPCComm.cmake
34 ↗(On Diff #13698)
 ARGS 
--grpc_out=${CMAKE_CURRENT_BINARY_DIR} -I${FIL_DIR} 
--plugin=protoc-gen-grpc=${GRPC_CPP_PLUGIN} ${ABS_FIL}
This revision is now accepted and ready to land.Jun 30 2022, 8:24 AM

Don't attempt to generate the files with CMake, only export

Since I "backported" some of the header changes, these changes will no longer work in isolation

jon added inline comments.
native/cpp/CommonCpp/grpc/CMakeLists.txt
16 ↗(On Diff #13698)

I'm not sure what the original line was sorry.

jon marked an inline comment as done.

Since I did a pretty fundamental change, please re-review

ashoat requested changes to this revision.Jul 3 2022, 11:53 AM

Repeating feedback I have left before. Please consider the meta-feedback I left in D4297... if you integrate feedback after the first time it's given to you, we can significantly reduce the number of cycles of review your diffs have to go through, and save both you and your reviewers some time

native/cpp/CommonCpp/grpc/CMakeLists.txt
9 ↗(On Diff #14106)

80 lines

16–41 ↗(On Diff #14106)

Weird indentation

This revision now requires changes to proceed.Jul 3 2022, 11:53 AM
jon marked an inline comment as done.

Address comments, lint

jon added inline comments.
native/cpp/CommonCpp/grpc/CMakeLists.txt
16–41 ↗(On Diff #14106)

This one looks right, it's in a loop, so the beginning of the statement is also indented

This revision is now accepted and ready to land.Jul 6 2022, 12:49 PM

Rename grpc projects to be unique from services

Update header references, as they refer to old paths

Avoid packaging grpc build with nix right now