Page MenuHomePhabricator

[services] Tunnelbroker - Add protobuf file compilation to Cargo `build.rs`
ClosedPublic

Authored by max on Oct 13 2022, 7:22 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jul 2, 9:56 PM
Unknown Object (File)
Sun, Jun 30, 5:05 PM
Unknown Object (File)
Sat, Jun 29, 12:36 PM
Unknown Object (File)
Fri, Jun 28, 4:55 PM
Unknown Object (File)
Thu, Jun 27, 12:14 PM
Unknown Object (File)
Thu, Jun 27, 3:11 AM
Unknown Object (File)
Wed, Jun 26, 4:09 PM
Unknown Object (File)
Wed, Jun 26, 12:17 PM

Details

Summary

This diff introduces adding the protobuf file compilation to Cargo's build system.
This is an intentional requirement to use Tonic.

Related Linear task: ENG-2094

CI Notes:
CI will fail until the D5461 will be landed.
This diff will re-request CI building before landing it.

Test Plan

Service and Rust-part of the codebase successfully built by running of cargo build command in the services/tunnelbroker directory.

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: marcin, michal.

Rebased on the parent changes.

max published this revision for review.Oct 17 2022, 8:24 AM
varun added inline comments.
services/tunnelbroker/rust-lib/build.rs
6 ↗(On Diff #17617)

why not just make the const on line 1 the path to the file instead of the directory?

This revision is now accepted and ready to land.Oct 17 2022, 10:18 AM
max added inline comments.
services/tunnelbroker/rust-lib/build.rs
6 ↗(On Diff #17617)

why not just make the const on line 1 the path to the file instead of the directory?

Yes, we can do this. The current approach comes from the other services (backup, blob), but it makes sense to use a file as we are using a single protobuf.

This revision now requires review to proceed.Oct 20 2022, 1:48 AM

Adding @tomek as a final reviewer.

This revision is now accepted and ready to land.Oct 20 2022, 7:00 AM

Adding to the Tunnelbroker to Rust transition stack.
Rebased on the Cargo stack changes.

max edited the test plan for this revision. (Show Details)
jon added inline comments.
services/tunnelbroker/build.rs
54–55 ↗(On Diff #17873)

should also ask cargo to rebuild if changed

This revision now requires changes to proceed.Oct 24 2022, 10:20 AM

Cargo re-run if proto file was changed is added.

max added inline comments.
services/tunnelbroker/build.rs
54–55 ↗(On Diff #17873)

should also ask cargo to rebuild if changed

Good catch! Thanks, @jon. I've added it.

This revision is now accepted and ready to land.Oct 26 2022, 1:50 PM
max marked an inline comment as done.

Rebasing on master changes.

Android CI build error is unrelated to these changes, and I will land this diff.

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