Page MenuHomePhabricator

[services] Tunnelbroker - Creating Cargo config file for Tunnelbroker as a Rust app
ClosedPublic

Authored by max on Oct 20 2022, 7:42 AM.
Tags
None
Referenced Files
F2191179: D5436.id.diff
Thu, Jul 4, 2:17 PM
Unknown Object (File)
Sun, Jun 30, 1:44 PM
Unknown Object (File)
Sun, Jun 30, 4:32 AM
Unknown Object (File)
Fri, Jun 28, 4:22 AM
Unknown Object (File)
Wed, Jun 26, 8:57 PM
Unknown Object (File)
Wed, Jun 26, 7:58 AM
Unknown Object (File)
Wed, Jun 26, 5:15 AM
Unknown Object (File)
Wed, Jun 26, 4:39 AM

Details

Summary

This diff is a part of the flat diffs stack to transform the current Tunnelbroker project into a Rust app by calling the current C++ codebase from Rust. The related transition task is ENG-1072.

This diff creates the Cargo project file for the Tunnelbroker application and its dependencies.

Related Linear task: ENG-2061

Dependencies description:
cxx - Needed for the C++ and Rust interop.
cxx-build - Building C++ codebase.
glob - Used in the helper function to traverse the directory for .cpp files (used in D5434).
tracing - We will use it for logging in threads.
log - Logging.
env_logger - Getting log level from env variable.
tokio - Asynchronous runtime needed for Tokio and our threads.
lazy_static - Lazy static initialization.
a2 - Notification library dependency.
fcm - Notification library dependency.
anyhow - Trait object-based error type for easy idiomatic error handling, that is used in the Notification library.
openssl - Notification library dependency.
tonic - gRPC server dependency (used in D5477).
tonic-build - Compiling the proto file (used in D5360).
prost - Tonic dependency (used in D5477).
prost-types - gRPC well-known types dependency (used in D5477).
futures - Used for handling stream in Tonic (used in D5477).

CI Notice:
The CI will fail on these diffs until the D5461 with the changes to CI build commands.
This stack will be landed all in one to prevent CI from failing on diffs out of this stack.

Test Plan

Run nix develop from the root of the repo.
Go to tunnelbroker service directory services/tunnelbroker and run the Cargo building process cargo build or cargo run.
The Rust application will be successfully built.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

max held this revision as a draft.
max edited the test plan for this revision. (Show Details)
max added reviewers: varun, marcin. max added 1 blocking reviewer(s): jon.
max published this revision for review.Oct 20 2022, 8:27 AM

Adding of prost and futures.

Updating on a stack reordering.

max edited the test plan for this revision. (Show Details)
max edited the summary of this revision. (Show Details)
max edited the test plan for this revision. (Show Details)

Update on a stack changes.

accepting since the builds are corrected later on.

This revision is now accepted and ready to land.Oct 26 2022, 2:01 PM
This revision now requires review to proceed.Oct 27 2022, 2:31 AM
tomek added a reviewer: ashoat.
tomek added inline comments.
services/tunnelbroker/Cargo.toml
13 ↗(On Diff #17868)

Versions of this lib seem to be inconsistent through the codebase. Also, the most recent version is 1.21 - is there a reason for adding a dependency to older version?

Updating Tokio to 1.21 version.

max added inline comments.
services/tunnelbroker/Cargo.toml
13 ↗(On Diff #17868)

Versions of this lib seem to be inconsistent through the codebase. Also, the most recent version is 1.21 - is there a reason for adding a dependency to older version?

No reason to use the old version, it just came from the current version in the Tunnelbroker.
I've updated it to the recent 1.21. Also, I've checked all the dependencies to make sure they are on the latest versions.
Thanks for the catch @tomek !

This revision is now accepted and ready to land.Oct 27 2022, 9:20 AM
max marked an inline comment as done.

Rebasing on master changes.

This revision was landed with ongoing or failed builds.Nov 7 2022, 6:11 AM
This revision was automatically updated to reflect the committed changes.