Generator: rpc.rs use super::*; does not propagate OTime / OCur / OLocation / OAddress imports from rpc_generated.rs #120
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_blueprint#120
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The generated
rpc.rsfile's*ServiceTraitimpl blocks referenceOTime(and the otherotoml::*types) in their method signatures, butrpc.rsitself has nouse hero_rpc_osis::otoml::*;import. The only access path is throughuse super::*;(orpub use super::rpc_generated::*;), which re-exports items DECLARED inrpc_generated.rsbut NOT items merely imported into it.In
crates/generator/src/rust/rust_rpc.rs:65the OTime import is emitted into one file:The corresponding emitter for
rpc.rs(line ~734) emitsuse super::*;which doesn't pick up the import becauserpc_generated.rsuses a non-pubusestatement.Symptom
When a consumer writes
impl PersonServiceTrait for PersonServiceHandler { fn register(..., kyc_verified_at: OTime) ... }inrpc.rs, rustc emits:Workarounds
use hero_rpc_osis::otoml::OTime;manually torpc.rs(lost on regen — butrpc.rsis preserved so the patch stays once applied).OTimemention ashero_rpc_osis::otoml::OTimein the trait body.The
partners_gatewayconsumer atforge.ourworld.tf/znzfreezone_code/znzfreezone_partners_gatewayuses option 2 in its s157 wire-up (crates/partners_gateway_oschema/src/external_api/rpc.rs).Suggested fix
Either:
rpc_generated.rsemitter so theotomlimports becomepub use, souse super::*;inrpc.rspropagates them; ORrpc.rsemitter (rust_rpc.rs:734-738) also emituse hero_rpc_osis::otoml::{OTime, OCur, OLocation, OAddress};directly when any service-method signature references an otoml type.The first option is smaller and works regardless of which methods reference otoml types.
Repro
Any OSchema with a service method that takes or returns a non-primitive otoml type (
otime,ocur, etc.) and a generator pin at5408d78(current HEAD).Found by
znzfreezone_partners_gateways157 (2026-05-21) while wiringB-1bskinny-trait dispatch through generator-emitted*ServiceTraitimpls.