Page MenuHomePhabricator

[native] use build configuration to set socket addr
ClosedPublic

Authored by varun on Dec 4 2023, 10:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 7, 1:43 PM
Unknown Object (File)
Oct 28 2024, 10:09 AM
Unknown Object (File)
Oct 27 2024, 8:20 AM
Unknown Object (File)
Sep 29 2024, 4:47 AM
Unknown Object (File)
Sep 29 2024, 4:46 AM
Unknown Object (File)
Sep 29 2024, 4:46 AM
Unknown Object (File)
Sep 29 2024, 4:45 AM
Unknown Object (File)
Sep 27 2024, 6:17 AM
Subscribers

Details

Summary

Depends on D10186

Set the default socket address depending on the build configuration. We use staging for debug builds and prod for release builds. This mirrors the defaults on keyserver.

Test Plan

the newly added unit test passed

after building with and without a JSON file present, and with/without --release, i made sure the correct IDENTITY_SOCKET_ADDR value was present

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

the next diff will let users override the default socket addr with config from a json file. will test those changes on both android and iOS

varun requested review of this revision.Dec 4 2023, 10:33 PM
bartek added a reviewer: michal.
bartek added inline comments.
native/native_rust_library/src/constants.rs
9 ↗(On Diff #34245)

I assume we're going to have more services here in the future

This revision is now accepted and ready to land.Dec 6 2023, 2:34 AM
native/native_rust_library/src/constants.rs
9 ↗(On Diff #34245)

good point

make socket address configurable with json file

native/native_rust_library/build.rs
20 ↗(On Diff #34361)

we probably shouldn't have println statements in build.rs since they're passed to cargo as instructions...

varun requested review of this revision.Dec 6 2023, 8:26 PM
varun edited the test plan for this revision. (Show Details)

re-requesting review since this has changed so much

michal added 1 blocking reviewer(s): bartek.

I will be extending this to handle backup service in the near future, do you think we should have a separate configuration json file per service?

native/native_rust_library/build.rs
20 ↗(On Diff #34361)

(if it's not starting with cargo: then that should be fine link)

This revision is now accepted and ready to land.Dec 7 2023, 4:01 AM

I will be extending this to handle backup service in the near future, do you think we should have a separate configuration json file per service?

yeah i think we should have separate config files for each service. we can write all the consts to the same rust file using the pattern in build.rs, though

native/native_rust_library/build.rs
20 ↗(On Diff #34361)

true. but it's not really useful anyway