diff --git a/rust/protobuf_codegen/src/lib.rs b/rust/protobuf_codegen/src/lib.rs index 534e039011..1c64efd82d 100644 --- a/rust/protobuf_codegen/src/lib.rs +++ b/rust/protobuf_codegen/src/lib.rs @@ -125,7 +125,7 @@ impl CodeGen { } } } - cc_build.compile(&format!("{}_upb_gen_code", env!("CARGO_CRATE_NAME"))); + cc_build.compile(&format!("{}_upb_gen_code", std::env::var("CARGO_PKG_NAME").unwrap())); Ok(()) }