Skip to content

Commit c0a8616

Browse files
committed
Fix arroyo-types dependency for UDFs
1 parent 1b9cdbf commit c0a8616

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

arroyo-compiler-service/src/main.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,13 @@ impl CompilerGrpc for CompileService {
355355
.await
356356
.map_err(|e| Status::internal(format!("Writing UDFs failed: {}", e)))?;
357357

358+
// udfs depend on arroyo-types::UdfContext, so the types crate needs to export it
359+
tokio::fs::write(
360+
self.build_dir.join("types/src/lib.rs"),
361+
"pub use arroyo_types::UdfContext;",
362+
)
363+
.await?;
364+
358365
let output = Command::new("cargo")
359366
.current_dir(&udf_build_dir)
360367
.arg("check")

arroyo-controller/src/compiler.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ impl ProgramCompiler {
9191

9292
quote! {
9393
use std::time::SystemTime;
94+
pub use arroyo_types::UdfContext;
9495

9596
#(#structs )*
9697
}

arroyo-controller/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ impl ControllerServer {
686686
}
687687

688688
fn cargo_toml(name: &str, dependencies: &str) -> String {
689-
let arroyo_types = "arroyo-types = { path = \"../../../arroyo-types\" }";
689+
let types_dep = "types = { path = \"../../types\" }";
690690

691691
format!(
692692
r#"
@@ -698,7 +698,7 @@ edition = "2021"
698698
{}
699699
{}
700700
"#,
701-
name, dependencies, arroyo_types
701+
name, dependencies, types_dep
702702
)
703703
}
704704

0 commit comments

Comments
 (0)