Skip to content

Commit 715c235

Browse files
committed
cbindgen: Fix rare issue with cbindgen failing to find cargo
PATH may be different at build time, so cargo might not be in PATH, which would cause cbindgen to fail. We point cbindgen to the correct CARGO executable explicitly instead.
1 parent bf065b8 commit 715c235

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cmake/Corrosion.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2137,6 +2137,8 @@ function(corrosion_experimental_cbindgen)
21372137
COMMAND
21382138
"${CMAKE_COMMAND}" -E env
21392139
TARGET="${cbindgen_target_triple}"
2140+
# cbindgen invokes cargo-metadata and checks the CARGO environment variable
2141+
CARGO="${_CORROSION_CARGO}"
21402142
"${cbindgen}"
21412143
--output "${generated_header}"
21422144
--crate "${rust_cargo_package}"

0 commit comments

Comments
 (0)