Page MenuHomePhabricator

[native] Remove gRPC related C++ code and packages from iOS and Android
ClosedPublic

Authored by max on Nov 23 2022, 2:33 AM.
Tags
None
Referenced Files
F2155557: D5706.id18928.diff
Sun, Jun 30, 9:50 PM
F2154133: D5706.id18929.diff
Sun, Jun 30, 6:44 PM
F2151929: D5706.id18749.diff
Sun, Jun 30, 1:47 PM
F2151754: D5706.id18781.diff
Sun, Jun 30, 1:26 PM
Unknown Object (File)
Fri, Jun 28, 8:21 AM
Unknown Object (File)
Thu, Jun 27, 12:50 AM
Unknown Object (File)
Tue, Jun 25, 3:57 AM
Unknown Object (File)
Tue, Jun 25, 3:17 AM
Subscribers

Details

Summary

This diff introduces removing the C++ gRPC-related code and packages due to the switching to use Rust gRPC client in a native.
The following files, includes and links were removed as deprecated or to not leave the empty files as the implementation would be completely changed:

  • GlobalNetworkSingleton.cpp - The file will be completely changed, we don't want to store an empty file;
  • NetworkModule.cpp - The file will be completely changed, we don't want to store an empty file;
  • SocketStatus.h - Deprecated as a part of the C++ gRPC;
  • Client.cpp - Deprecated as a part of the C++ gRPC;

The followings packages were removed:

  • gRPC-C++;
  • Pod-patch - We used it to patch the gRPC-C++ package, we don't use C++ gRPC anymore;

Linear task: ENG-2276

Test Plan

Native iOS and Android apps are successfully built.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

max held this revision as a draft.

Removing pod-patch from the keyserver.

Removing gRPC and OpenSSL from the Android build.gradle.

Putting back the fetchContent.

Putting back openSSL for Android to solve the sqlcipher build error.

Fixing import paths for Android.

max edited the test plan for this revision. (Show Details)
max edited reviewers, added: atul, tomek; removed: jon.

Looks good to me! Still would like the other reviewers to take a look

keyserver/Dockerfile
104 ↗(On Diff #18783)

Is this line still necessary? If you remove it and CI passes then it's okay to remove

Removing Podfile from the keyserver's Docker file.

max added inline comments.
keyserver/Dockerfile
104 ↗(On Diff #18783)

Is this line still necessary? If you remove it and CI passes then it's okay to remove

I don't think it's necessary for the keyserver. I've removed it and the CI passed.

max marked an inline comment as done.

Removing linter spaces from CMake files.

tomek requested changes to this revision.Nov 24 2022, 1:32 AM

GlobalNetworkSingleton shouldn't be deleted https://linear.app/comm/issue/ENG-1334#comment-673e1516.

GlobalNetworkSingleton.cpp - The file will be completely changed, we don't want to store an empty file;

Why is that? Both scheduleOrRun and enableMultithreading methods are still relevant.

This revision now requires changes to proceed.Nov 24 2022, 1:32 AM

Not clear if that stuff will be handled in Rust or C++ in the future... but at the same time don't want to block this diff on figuring that out. I think it's fine either way – if we leave it in now, we just have to remember to remove it later when we introduce a hypothetical Rust replacement for that code. On the other hand, if we remove it now we'll have to remember that we wrote this already and don't need to write it again

In D5706#170355, @tomek wrote:

GlobalNetworkSingleton shouldn't be deleted https://linear.app/comm/issue/ENG-1334#comment-673e1516.

GlobalNetworkSingleton.cpp - The file will be completely changed, we don't want to store an empty file;

Why is that? Both scheduleOrRun and enableMultithreading methods are still relevant.

The network initialization method and its structure is completely changed due to changes to Rust. It can take a while when the new module will be introduced and we are changing this instead of just introducing a new one. Also, it's blocking for a while @ashoat's ENG-614 for a while. The good solution is to unblock it now. I'll remember how the GlobalNetworkSingleton works as you and I think Atul and other reviews, so it's not a problem.
I've picked out ENG-1333 to make a further discussion about native network C++ and Rust communication there.

Not clear if that stuff will be handled in Rust or C++ in the future... but at the same time don't want to block this diff on figuring that out. I think it's fine either way – if we leave it in now, we just have to remember to remove it later when we introduce a hypothetical Rust replacement for that code. On the other hand, if we remove it now we'll have to remember that we wrote this already and don't need to write it again

I think the good way is to remove it because of the global changes due to using Rust for the network communication and unblock ENG-614. Also, I've picked out ENG-1333 for further discussion. There is no additional pressure on the reviewer if it will be re-introduced instead of blocking now (I'll point to this diff in a description of these changes to make it faster).

I'm still not sure that this is a good approach, but won't block the diff on it.

Very exciting to cut all of this!

This revision is now accepted and ready to land.Nov 28 2022, 4:15 PM

Rebasing on master and merging.