diff --git a/lazer/publisher_sdk/rust/Cargo.toml b/lazer/publisher_sdk/rust/Cargo.toml index 010d1aea23..8b149278aa 100644 --- a/lazer/publisher_sdk/rust/Cargo.toml +++ b/lazer/publisher_sdk/rust/Cargo.toml @@ -12,3 +12,4 @@ protobuf = "3.7.2" [build-dependencies] protobuf-codegen = "3.7.2" + diff --git a/lazer/publisher_sdk/rust/build.rs b/lazer/publisher_sdk/rust/build.rs index b8d1c542d5..effbd94bd8 100644 --- a/lazer/publisher_sdk/rust/build.rs +++ b/lazer/publisher_sdk/rust/build.rs @@ -2,16 +2,17 @@ use std::io::Result; /// Automatically runs during cargo build. /// Proto files for Lazer are defined in the lazer sdk folder in the proto/ subdirectory. -/// Both JS and Rust SDKs read the proto files for generating types. +/// They are symlinked as proto/ in this rust/ folder with this command: ln -s ../proto proto +/// symlinking is necessary as cargo publish only includes files in the root for packaging fn main() -> Result<()> { // Tell cargo to recompile if any .proto files change - println!("cargo:rerun-if-changed=../proto/"); + println!("cargo:rerun-if-changed=proto/"); protobuf_codegen::Codegen::new() .pure() - .include("../proto") - .input("../proto/publisher_update.proto") - .input("../proto/pyth_lazer_transaction.proto") + .include("proto") // symlinked proto folder. Actual fiels are in ../proto + .input("proto/publisher_update.proto") + .input("proto/pyth_lazer_transaction.proto") .cargo_out_dir("protobuf") .run_from_script(); diff --git a/lazer/publisher_sdk/rust/proto b/lazer/publisher_sdk/rust/proto new file mode 120000 index 0000000000..5c8d352537 --- /dev/null +++ b/lazer/publisher_sdk/rust/proto @@ -0,0 +1 @@ +../proto \ No newline at end of file