diff --git a/Cargo.dev.toml b/Cargo.dev.toml index 58d697850..b7b6f1430 100644 --- a/Cargo.dev.toml +++ b/Cargo.dev.toml @@ -4,7 +4,6 @@ members = [ "auction", "authority", "benchmarking", - "build-script-utils", "currencies", "gradually-update", "nft", @@ -68,4 +67,4 @@ xcm = { version = "16.1.0", package = "staging-xcm", default-features = false } xcm-builder = { version = "20.0.0", package = "staging-xcm-builder", default-features = false } xcm-executor = { version = "19.1.0", package = "staging-xcm-executor", default-features = false } -xcm-simulator = { version = "20.0.0" } \ No newline at end of file +xcm-simulator = { version = "20.0.0" } diff --git a/Makefile b/Makefile index 25e463821..e9613911c 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ check: githooks - ./scripts/run.sh check --no-default-features --target=wasm32-unknown-unknown + ./scripts/run.sh check --no-default-features --target=wasm32v1-none check-tests: githooks ./scripts/run.sh check --tests diff --git a/build-script-utils/Cargo.toml b/build-script-utils/Cargo.toml deleted file mode 100644 index 53cdffc98..000000000 --- a/build-script-utils/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "orml-build-script-utils" -description = "Crate with utility functions for `build.rs` scripts." -repository = "https://github.com/open-web3-stack/open-runtime-module-library/tree/master/build-script-utils" -license = "Apache-2.0" -version = "1.4.0" -authors = ["Parity Technologies ", "Laminar Developers "] -edition = "2021" - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -walkdir = "2" diff --git a/build-script-utils/README.md b/build-script-utils/README.md deleted file mode 100644 index 1c184f673..000000000 --- a/build-script-utils/README.md +++ /dev/null @@ -1,3 +0,0 @@ -Crate with utility functions for `build.rs` scripts. - -License: Apache-2.0 \ No newline at end of file diff --git a/build-script-utils/src/lib.rs b/build-script-utils/src/lib.rs deleted file mode 100644 index 1183ee805..000000000 --- a/build-script-utils/src/lib.rs +++ /dev/null @@ -1,5 +0,0 @@ -//! Crate with utility functions for `build.rs` scripts. - -mod license; - -pub use license::*; diff --git a/build-script-utils/src/license.rs b/build-script-utils/src/license.rs deleted file mode 100644 index 122a32ce2..000000000 --- a/build-script-utils/src/license.rs +++ /dev/null @@ -1,62 +0,0 @@ -use std::{fs::File, io::Read, path::Path}; -use walkdir::{DirEntry, WalkDir}; - -// Check the license text that should be present at the beginning of every -// source file. -pub fn check_file_licenses>(path: P, expected_license_text: &[u8], exclude_paths: &[&str]) { - // The following directories will be excluded from the license scan. - let skips = ["artifacts", "corpus", "target", "fuzz_targets"]; - - let path = path.as_ref(); - - let mut iter = WalkDir::new(path).into_iter(); - while let Some(entry) = iter.next() { - let entry = entry.unwrap(); - let entry_type = entry.file_type(); - - // Skip the hidden entries efficiently. - if is_hidden(&entry) { - if entry.file_type().is_dir() { - iter.skip_current_dir(); - } - continue; - } - - // Skip the specified directories and paths. - if entry_type.is_dir() - && (skips.contains(&entry.file_name().to_str().unwrap_or("")) - || exclude_paths.contains(&entry.path().to_str().unwrap_or(""))) - { - iter.skip_current_dir(); - - continue; - } - - // Check all files with the ".rs" extension. - if entry_type.is_file() && entry.file_name().to_str().unwrap_or("").ends_with(".rs") { - let file = File::open(entry.path()).unwrap(); - let mut contents = Vec::with_capacity(expected_license_text.len()); - file.take(expected_license_text.len() as u64) - .read_to_end(&mut contents) - .unwrap(); - - assert!( - contents == expected_license_text, - "The license in \"{}\" is either missing or it doesn't match the expected string!", - entry.path().display() - ); - } - } - - // Re-run upon any changes to the workspace. - println!("cargo:rerun-if-changed=."); -} - -// hidden files and directories efficiently. -fn is_hidden(entry: &DirEntry) -> bool { - entry - .file_name() - .to_str() - .map(|s| s.starts_with('.') && !s.starts_with("..")) - .unwrap_or(false) -} diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 57faae7a7..4dd964b2f 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] channel = "1.88.0" components = ["rust-src", "rustfmt", "clippy"] -targets = ["wasm32-unknown-unknown"] +targets = ["wasm32v1-none"]