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
F2905355: D5360.id18130.diff
Sun, Oct 6, 4:50 AM
F2905337: D5360.id17542.diff
Sun, Oct 6, 4:42 AM
F2905223: D5360.id17876.diff
Sun, Oct 6, 4:01 AM
F2905204: D5360.id17617.diff
Sun, Oct 6, 3:56 AM
F2905194: D5360.id18129.diff
Sun, Oct 6, 3:52 AM
F2905189: D5360.id17873.diff
Sun, Oct 6, 3:51 AM
Unknown Object (File)
Fri, Sep 27, 7:42 AM
Unknown Object (File)
Thu, Sep 26, 9:38 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.