mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-22 05:35:42 +00:00
Make wasm-builder work with cargo install (#3043)
* Make `wasm-builder` work with `cargo install` * Update `Cargo.lock`
This commit is contained in:
Generated
+1
-1
@@ -4832,7 +4832,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "substrate-wasm-builder"
|
name = "substrate-wasm-builder"
|
||||||
version = "1.0.3"
|
version = "1.0.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"build-helper 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"build-helper 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"cargo_metadata 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"cargo_metadata 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "substrate-wasm-builder"
|
name = "substrate-wasm-builder"
|
||||||
version = "1.0.3"
|
version = "1.0.4"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
description = "Utility for building WASM binaries"
|
description = "Utility for building WASM binaries"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|||||||
@@ -97,14 +97,26 @@ pub fn create_and_compile(cargo_manifest: &Path) -> (WasmBinary, WasmBinaryBloat
|
|||||||
///
|
///
|
||||||
/// If the `Cargo.lock` cannot be found, we emit a warning and return `None`.
|
/// If the `Cargo.lock` cannot be found, we emit a warning and return `None`.
|
||||||
fn find_cargo_lock(cargo_manifest: &Path) -> Option<PathBuf> {
|
fn find_cargo_lock(cargo_manifest: &Path) -> Option<PathBuf> {
|
||||||
let mut path = build_helper::out_dir();
|
fn find_impl(mut path: PathBuf) -> Option<PathBuf> {
|
||||||
|
loop {
|
||||||
|
if path.join("Cargo.lock").exists() {
|
||||||
|
return Some(path.join("Cargo.lock"))
|
||||||
|
}
|
||||||
|
|
||||||
while path.pop() {
|
if !path.pop() {
|
||||||
if path.join("Cargo.lock").exists() {
|
return None;
|
||||||
return Some(path.join("Cargo.lock"))
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(path) = find_impl(build_helper::out_dir()) {
|
||||||
|
return Some(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
if let Some(path) = find_impl(cargo_manifest.to_path_buf()) {
|
||||||
|
return Some(path);
|
||||||
|
}
|
||||||
|
|
||||||
build_helper::warning!(
|
build_helper::warning!(
|
||||||
"Could not find `Cargo.lock` for `{}`, while searching from `{}`.",
|
"Could not find `Cargo.lock` for `{}`, while searching from `{}`.",
|
||||||
cargo_manifest.display(),
|
cargo_manifest.display(),
|
||||||
@@ -136,12 +148,13 @@ fn get_wasm_binary_name(cargo_manifest: &Path) -> String {
|
|||||||
fn get_wasm_workspace_root() -> PathBuf {
|
fn get_wasm_workspace_root() -> PathBuf {
|
||||||
let mut out_dir = build_helper::out_dir();
|
let mut out_dir = build_helper::out_dir();
|
||||||
|
|
||||||
while out_dir.parent().is_some() {
|
loop {
|
||||||
if out_dir.parent().map(|p| p.ends_with("target")).unwrap_or(false) {
|
match out_dir.parent() {
|
||||||
return out_dir;
|
Some(parent) if out_dir.ends_with("build") => return parent.to_path_buf(),
|
||||||
|
_ => if !out_dir.pop() {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
out_dir.pop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
panic!("Could not find target dir in: {}", build_helper::out_dir().display())
|
panic!("Could not find target dir in: {}", build_helper::out_dir().display())
|
||||||
|
|||||||
Reference in New Issue
Block a user