@@ -41,7 +41,7 @@ func Generate(ctx context.Context, library *config.Library, sources *config.Sour
4141 return err
4242 }
4343 if library .Veneer {
44- return generateVeneer (library , googleapisDir )
44+ return generateVeneer (ctx , library , googleapisDir )
4545 }
4646
4747 if len (library .Channels ) != 1 {
@@ -57,7 +57,7 @@ func Generate(ctx context.Context, library *config.Library, sources *config.Sour
5757 if err != nil {
5858 return err
5959 }
60- if err := sidekickrust .Generate (model , library .Output , sidekickConfig ); err != nil {
60+ if err := sidekickrust .Generate (ctx , model , library .Output , sidekickConfig ); err != nil {
6161 return err
6262 }
6363 return nil
@@ -66,17 +66,17 @@ func Generate(ctx context.Context, library *config.Library, sources *config.Sour
6666// Format formats a generated Rust library. Must be called sequentially;
6767// parallel calls cause race conditions as cargo fmt runs cargo metadata,
6868// which competes for locks on the workspace Cargo.toml and Cargo.lock.
69- func Format (library * config.Library ) error {
70- if err := command .Run ("taplo" , "fmt" , filepath .Join (library .Output , "Cargo.toml" )); err != nil {
69+ func Format (ctx context. Context , library * config.Library ) error {
70+ if err := command .Run (ctx , "taplo" , "fmt" , filepath .Join (library .Output , "Cargo.toml" )); err != nil {
7171 return err
7272 }
73- if err := command .Run ("cargo" , "fmt" , "-p" , library .Name ); err != nil {
73+ if err := command .Run (ctx , "cargo" , "fmt" , "-p" , library .Name ); err != nil {
7474 return err
7575 }
7676 return nil
7777}
7878
79- func generateVeneer (library * config.Library , googleapisDir string ) error {
79+ func generateVeneer (ctx context. Context , library * config.Library , googleapisDir string ) error {
8080 if library .Rust == nil || len (library .Rust .Modules ) == 0 {
8181 return fmt .Errorf ("veneer %q has no modules defined" , library .Name )
8282 }
@@ -88,9 +88,9 @@ func generateVeneer(library *config.Library, googleapisDir string) error {
8888 }
8989 switch sidekickConfig .General .Language {
9090 case "rust" :
91- err = sidekickrust .Generate (model , module .Output , sidekickConfig )
91+ err = sidekickrust .Generate (ctx , model , module .Output , sidekickConfig )
9292 case "rust+prost" :
93- err = rust_prost .Generate (model , module .Output , sidekickConfig )
93+ err = rust_prost .Generate (ctx , model , module .Output , sidekickConfig )
9494 default :
9595 err = fmt .Errorf ("unknown language: %s" , sidekickConfig .General .Language )
9696 }
0 commit comments