From f87523dd41f6f0e64dbc55b64cac2c304afcf619 Mon Sep 17 00:00:00 2001 From: Derek Benson Date: Thu, 1 Aug 2024 08:43:21 -0700 Subject: [PATCH] fix the crate name being used by the gencode library. Before all invocations would try to create a library called protobuf_codegen_upb_gen_code. Now it should properly use the name of the crate currently being built. PiperOrigin-RevId: 658414835 --- rust/protobuf_codegen/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(()) }