try to get identity service config from json file if it exists, otherwise just use default config
Depends on D10187
Paths
| Differential D10201 Authored by varun on Dec 5 2023, 8:39 PM.
Details
Diff Detail
Event TimelineHerald added subscribers: tomek, ashoat. · View Herald TranscriptDec 5 2023, 8:39 PM2023-12-05 20:39:13 (UTC-8) Comment Actions i meant to make this a draft diff.. i guess i can't undo that now. @bartek i'm having trouble reading from my native/facts/identity_service_config.json file because we build the native rust library and then Xcode links it in some sort of sandbox where the file isn't present. any thoughts on how to proceed here? i can just set the SOCKET_ADDR const in build.rs similar to how we set CODE_VERSION but wondering if there's a cleaner way... varun planned changes to this revision. Comment Actions
actually i think build.rs is the best solution Harbormaster completed remote builds in B24817: Diff 34324.Dec 5 2023, 9:11 PM2023-12-05 21:11:30 (UTC-8) Comment Actions
I'm confused – what is actually being configured in build.rs here? Shouldn't this diff be using get_config introduced in D10148? Is there something "broken" with D10148? Comment Actions
That diff is for keyserver only. Native apps don't support reading env vars in runtime - their runtime is smartphone or simulator, they should be separated from host machine. Also reading file at runtime on mobile app means searching for it on the device's disk (or emulator-specific directories). build.rs will work but it's cumbersome to rebuild native app just to change identity endpoint. On the other hand, passing values JS -> Rust sounds like lots of additional work (or am I wrong?). Wondering if there's a better solution. Comment Actions Thanks for clarifying, @bartek! I definitely got myself confused there. We don't use getCommConfig in JS on native currently either, so I don't think there's any expectation to use get_config in Rust on native. I share your concerns that build.rs is an unideal place to put this config, but I'm not sure of any alternatives. Don't want to block this diff if there are no obvious alternatives. Comment Actions thanks for explaining, @bartek :)
yeah it feels like a lot of unnecessary work... i'm think this task would make it easier though: https://linear.app/comm/issue/ENG-6026/avoid-creating-new-clients-each-time-we-call-grpc-client-methods I'm going to abandon this diff and just update the previous one because i had to completely change my approach
Revision Contents
Diff 34324 native/native_rust_library/Cargo.lock
native/native_rust_library/Cargo.toml
native/native_rust_library/src/config.rs
native/native_rust_library/src/lib.rs
|