[Buildroot] [PATCH 5/7] support/download/cargo-post-process: make manifest path configurable

Thomas Petazzoni thomas.petazzoni at bootlin.com
Fri Jan 7 17:13:15 UTC 2022


In most pure Rust packages, the Cargo.toml manifest is at the root
directory, which is why we could call "cargo vendor" without
specifying the path of the manifest.

However, other packages, such as python-cryptography, which have parts
implemented in Rust, have their Cargo.toml located in a specific
subdirectory.

This commit extends the cargo-post-process download script to
understand a BR_CARGO_MANIFEST_PATH environment variable, which allows
a package to pass the location of the Cargo.toml file. If not passed,
"Cargo.toml" is used, preserving the existing behavior for other
packages.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
---
 support/download/cargo-post-process | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/support/download/cargo-post-process b/support/download/cargo-post-process
index 25dbbedbfa..51d9dd24c1 100755
--- a/support/download/cargo-post-process
+++ b/support/download/cargo-post-process
@@ -22,7 +22,7 @@ post_process_unpack ${base_name} ${output}
 
 # Do the Cargo vendoring
 pushd ${base_name} > /dev/null
-cargo vendor --locked VENDOR
+cargo vendor --manifest-path ${BR_CARGO_MANIFEST_PATH-Cargo.toml} --locked VENDOR
 
 # Create the local .cargo/config with vendor info
 mkdir -p .cargo/
-- 
2.33.1




More information about the buildroot mailing list