Skip to content

Commit

Permalink
Fix arroyo-types dependency for UDFs
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeisen committed Jan 16, 2024
1 parent 1b9cdbf commit c0a8616
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions arroyo-compiler-service/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,13 @@ impl CompilerGrpc for CompileService {
.await
.map_err(|e| Status::internal(format!("Writing UDFs failed: {}", e)))?;

// udfs depend on arroyo-types::UdfContext, so the types crate needs to export it
tokio::fs::write(
self.build_dir.join("types/src/lib.rs"),
"pub use arroyo_types::UdfContext;",
)
.await?;

let output = Command::new("cargo")
.current_dir(&udf_build_dir)
.arg("check")
Expand Down
1 change: 1 addition & 0 deletions arroyo-controller/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ impl ProgramCompiler {

quote! {
use std::time::SystemTime;
pub use arroyo_types::UdfContext;

#(#structs )*
}
Expand Down
4 changes: 2 additions & 2 deletions arroyo-controller/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ impl ControllerServer {
}

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

format!(
r#"
Expand All @@ -698,7 +698,7 @@ edition = "2021"
{}
{}
"#,
name, dependencies, arroyo_types
name, dependencies, types_dep
)
}

Expand Down

0 comments on commit c0a8616

Please sign in to comment.