MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / verify_and_vendor

Function verify_and_vendor

scripts/publish.rs:519–548  ·  view source on GitHub ↗
(krate: &Crate)

Source from the content-addressed store, hash-verified

517 }
518
519 fn verify_and_vendor(krate: &Crate) {
520 verify_crates_io(krate);
521
522 let mut cmd = Command::new("cargo");
523 cmd.arg("package")
524 .arg("--manifest-path")
525 .arg(&krate.manifest)
526 .env("CARGO_TARGET_DIR", "./target");
527 if krate.name.contains("wasi-nn") {
528 cmd.arg("--no-verify");
529 }
530 run_cmd(&mut cmd);
531 run_cmd(
532 Command::new("tar")
533 .arg("xf")
534 .arg(format!(
535 "../target/package/{}-{}.crate",
536 krate.name, krate.version
537 ))
538 .current_dir("./vendor"),
539 );
540 fs::write(
541 format!(
542 "./vendor/{}-{}/.cargo-checksum.json",
543 krate.name, krate.version
544 ),
545 "{\"files\":{}}",
546 )
547 .unwrap();
548 }
549
550 fn verify_capi() {
551 let version = read_crate(None, "./Cargo.toml".as_ref()).version;

Callers 1

verifyFunction · 0.85

Calls 8

verify_crates_ioFunction · 0.85
run_cmdFunction · 0.85
newFunction · 0.50
writeFunction · 0.50
envMethod · 0.45
argMethod · 0.45
containsMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected