From 176eb5f5ca313fa7aeb7f5c8a2bc69b2ecec14c3 Mon Sep 17 00:00:00 2001 From: Niko PLP Date: Thu, 23 May 2024 19:42:29 +0300 Subject: [PATCH] preview.3 trying to fix the docsrs issue --- Cargo.lock | 4 +- nextgraph/Cargo.toml | 15 ++-- nextgraph/README.md | 2 +- nextgraph/src/local_broker.rs | 6 +- ng-broker/Cargo.toml | 6 +- ng-oxigraph/Cargo.toml | 8 +- .../src/oxigraph/storage/backend/mod.rs | 8 +- .../src/oxigraph/storage/binary_encoder.rs | 2 +- ng-oxigraph/src/oxigraph/storage/mod.rs | 74 +++++++++---------- ng-oxigraph/src/oxigraph/store.rs | 28 +++---- ng-repo/Cargo.toml | 2 +- ng-storage-rocksdb/Cargo.toml | 4 +- ng-verifier/Cargo.toml | 15 ++-- ng-verifier/src/lib.rs | 2 +- ng-verifier/src/verifier.rs | 16 ++-- ng-wallet/Cargo.toml | 8 +- ngcli/Cargo.toml | 2 +- ngd/Cargo.toml | 4 +- 18 files changed, 99 insertions(+), 107 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e03a198..321bafa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7080,9 +7080,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] diff --git a/nextgraph/Cargo.toml b/nextgraph/Cargo.toml index 8c4c6fb..a21f733 100644 --- a/nextgraph/Cargo.toml +++ b/nextgraph/Cargo.toml @@ -2,7 +2,7 @@ name = "nextgraph" description = "NextGraph client library. Nextgraph is a decentralized, secure and local-first web 3.0 ecosystem based on Semantic Web and CRDTs" categories = ["asynchronous","text-editors","web-programming","development-tools","database-implementations"] -version = "0.1.0-preview.2" +version = "0.1.0-preview.3" edition.workspace = true license.workspace = true authors.workspace = true @@ -20,7 +20,7 @@ serde_bare = "0.5.0" serde_json = "1.0" base64-url = "2.0.0" once_cell = "1.17.1" -zeroize = { version = "1.6.0", features = ["zeroize_derive"] } +zeroize = { version = "1.7.0", features = ["zeroize_derive"] } futures = "0.3.24" async-std = { version = "1.12.0", features = [ "attributes", "unstable" ] } async-trait = "0.1.64" @@ -28,15 +28,12 @@ async-once-cell = "0.5.3" web-time = "0.2.0" ng-repo = { path = "../ng-repo", version = "0.1.0-preview.1" } ng-net = { path = "../ng-net", version = "0.1.0-preview.1" } -ng-wallet = { path = "../ng-wallet", version = "0.1.0-preview.1" } +ng-wallet = { path = "../ng-wallet", version = "0.1.0-preview.3" } ng-client-ws = { path = "../ng-client-ws", version = "0.1.0-preview.1" } -ng-verifier = { path = "../ng-verifier", version = "0.1.0-preview.2" } +ng-verifier = { path = "../ng-verifier", version = "0.1.0-preview.3" } -[target.'cfg(all(not(target_arch = "wasm32"),not(doc)))'.dependencies] -ng-storage-rocksdb = { path = "../ng-storage-rocksdb", version = "0.1.0-preview.1" } - -[package.metadata.docs.rs] -rustc-args = [ "--cfg" , "doc"] +[target.'cfg(all(not(target_arch = "wasm32")))'.dependencies] +ng-storage-rocksdb = { path = "../ng-storage-rocksdb", version = "0.1.0-preview.3" } [[example]] name = "in_memory" diff --git a/nextgraph/README.md b/nextgraph/README.md index 0761ad5..c95cd31 100644 --- a/nextgraph/README.md +++ b/nextgraph/README.md @@ -43,7 +43,7 @@ A tokio-based version (as a feature) might be available in the future. ```toml [dependencies] -nextgraph = "0.1.0-preview.1" +nextgraph = "0.1.0-preview.3" async-std = "1.12.0" ``` diff --git a/nextgraph/src/local_broker.rs b/nextgraph/src/local_broker.rs index 9673aba..b6c488e 100644 --- a/nextgraph/src/local_broker.rs +++ b/nextgraph/src/local_broker.rs @@ -46,7 +46,7 @@ use ng_wallet::{create_wallet_first_step_v0, create_wallet_second_step_v0, types use ng_client_ws::remote_ws::ConnectionWebSocket; #[cfg(target_arch = "wasm32")] use ng_client_ws::remote_ws_wasm::ConnectionWebSocket; -#[cfg(not(any(target_family = "wasm",doc)))] +#[cfg(not(any(target_family = "wasm")))] use ng_storage_rocksdb::block_storage::RocksDbBlockStorage; #[doc(hidden)] @@ -824,7 +824,7 @@ impl LocalBroker { (VerifierType::Memory, LocalBrokerConfig::BasePath(_)) => { VerifierConfigType::Memory } - #[cfg(all(not(target_family = "wasm"),not(doc)))] + #[cfg(all(not(target_family = "wasm")))] (VerifierType::Save, LocalBrokerConfig::BasePath(base)) => { let mut path = base.clone(); path.push(format!("user{}", config.user_id().to_hash_string())); @@ -911,7 +911,7 @@ impl LocalBroker { Arc::new(std::sync::RwLock::new(HashMapBlockStorage::new())) as Arc> } else { - #[cfg(all(not(target_family = "wasm"),not(doc)))] + #[cfg(all(not(target_family = "wasm")))] { let key_material = wallet .client() diff --git a/ng-broker/Cargo.toml b/ng-broker/Cargo.toml index e65ff87..b1f2c21 100644 --- a/ng-broker/Cargo.toml +++ b/ng-broker/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ng-broker" -# version = "0.1.0" +version = "0.1.0-preview.3" description = "Broker library of NextGraph, a decentralized, secure and local-first web 3.0 ecosystem based on Semantic Web and CRDTs" version.workspace = true edition.workspace = true @@ -30,8 +30,8 @@ blake3 = "1.3.1" ng-repo = { path = "../ng-repo", version = "0.1.0-preview.1" } ng-net = { path = "../ng-net", version = "0.1.0-preview.1" } ng-client-ws = { path = "../ng-client-ws", version = "0.1.0-preview.1" } -ng-verifier = { path = "../ng-verifier", version = "0.1.0-preview.1" } -ng-storage-rocksdb = { path = "../ng-storage-rocksdb", version = "0.1.0-preview.1" } +ng-verifier = { path = "../ng-verifier", version = "0.1.0-preview.3" } +ng-storage-rocksdb = { path = "../ng-storage-rocksdb", version = "0.1.0-preview.3" } [target.'cfg(target_arch = "wasm32")'.dependencies.getrandom] version = "0.2.7" diff --git a/ng-oxigraph/Cargo.toml b/ng-oxigraph/Cargo.toml index bf8663d..aa87937 100644 --- a/ng-oxigraph/Cargo.toml +++ b/ng-oxigraph/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ng-oxigraph" -version = "0.4.0-alpha.7-ngpreview2" +version = "0.4.0-alpha.7-ngpreview3" authors = ["Tpt ", "Niko PLP "] license = "MIT OR Apache-2.0" readme = "README.md" @@ -44,9 +44,9 @@ quick-xml = ">=0.29, <0.32" memchr = "2.5" peg = "0.8" -[target.'cfg(all(not(target_family = "wasm"),not(doc)))'.dependencies] +[target.'cfg(all(not(target_family = "wasm")))'.dependencies] libc = "0.2" -ng-rocksdb = { version = "0.21.0", git = "https://git.nextgraph.org/NextGraph/rust-rocksdb.git", branch = "master", features = [ ] } +ng-rocksdb = { version = "0.21.0-ngpreview.1", git = "https://git.nextgraph.org/NextGraph/rust-rocksdb.git", branch = "master", features = [ ] } [target.'cfg(all(target_family = "wasm", target_os = "unknown"))'.dependencies] getrandom = "0.2.8" @@ -56,8 +56,6 @@ js-sys = { version = "0.3.60", optional = true } codspeed-criterion-compat = "2.3.3" zstd = ">=0.12, <0.14" -[package.metadata.docs.rs] -rustc-args = [ "--cfg" , "doc"] [lints.rust] absolute_paths_not_starting_with_crate = "warn" diff --git a/ng-oxigraph/src/oxigraph/storage/backend/mod.rs b/ng-oxigraph/src/oxigraph/storage/backend/mod.rs index 6df3606..b94eb65 100644 --- a/ng-oxigraph/src/oxigraph/storage/backend/mod.rs +++ b/ng-oxigraph/src/oxigraph/storage/backend/mod.rs @@ -1,12 +1,12 @@ //! A storage backend //! RocksDB is available, if not in memory -#[cfg(any(target_family = "wasm", doc))] +#[cfg(any(target_family = "wasm"))] pub use fallback::{ColumnFamily, ColumnFamilyDefinition, Db, Iter, Reader, Transaction}; -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] pub use oxi_rocksdb::{ColumnFamily, ColumnFamilyDefinition, Db, Iter, Reader, Transaction}; -#[cfg(any(target_family = "wasm", doc))] +#[cfg(any(target_family = "wasm"))] mod fallback; -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] mod oxi_rocksdb; diff --git a/ng-oxigraph/src/oxigraph/storage/binary_encoder.rs b/ng-oxigraph/src/oxigraph/storage/binary_encoder.rs index 4fb2120..d1cf1ac 100644 --- a/ng-oxigraph/src/oxigraph/storage/binary_encoder.rs +++ b/ng-oxigraph/src/oxigraph/storage/binary_encoder.rs @@ -5,7 +5,7 @@ use crate::oxsdatatypes::*; use std::io::Read; use std::mem::size_of; -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] pub const LATEST_STORAGE_VERSION: u64 = 1; pub const WRITTEN_TERM_MAX_SIZE: usize = size_of::() + 2 * size_of::(); diff --git a/ng-oxigraph/src/oxigraph/storage/mod.rs b/ng-oxigraph/src/oxigraph/storage/mod.rs index a928efe..a20740e 100644 --- a/ng-oxigraph/src/oxigraph/storage/mod.rs +++ b/ng-oxigraph/src/oxigraph/storage/mod.rs @@ -1,9 +1,9 @@ #![allow(clippy::same_name_method)] -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] use crate::oxigraph::model::Quad; use crate::oxigraph::model::{GraphNameRef, NamedOrBlankNodeRef, QuadRef, TermRef}; use crate::oxigraph::storage::backend::{Reader, Transaction}; -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] use crate::oxigraph::storage::binary_encoder::LATEST_STORAGE_VERSION; use crate::oxigraph::storage::binary_encoder::{ decode_term, encode_term, encode_term_pair, encode_term_quad, encode_term_triple, @@ -14,24 +14,24 @@ use crate::oxigraph::storage::binary_encoder::{ pub use crate::oxigraph::storage::error::{ CorruptionError, LoaderError, SerializerError, StorageError, }; -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] use crate::oxigraph::storage::numeric_encoder::Decoder; use crate::oxigraph::storage::numeric_encoder::{ insert_term, EncodedQuad, EncodedTerm, StrHash, StrLookup, }; use backend::{ColumnFamily, ColumnFamilyDefinition, Db, Iter}; -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] use std::collections::VecDeque; -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] use std::collections::{HashMap, HashSet}; use std::error::Error; -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] use std::mem::{swap, take}; -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] use std::path::{Path, PathBuf}; -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] use std::sync::Mutex; -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] use std::{io, thread}; mod backend; @@ -51,16 +51,16 @@ const DSPO_CF: &str = "dspo"; const DPOS_CF: &str = "dpos"; const DOSP_CF: &str = "dosp"; const GRAPHS_CF: &str = "graphs"; -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] const DEFAULT_CF: &str = "default"; -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] const DEFAULT_BULK_LOAD_BATCH_SIZE: usize = 1_000_000; /// Low level storage primitives #[derive(Clone)] pub struct Storage { db: Db, - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] default_cf: ColumnFamily, id2str_cf: ColumnFamily, spog_cf: ColumnFamily, @@ -80,7 +80,7 @@ impl Storage { Self::setup(Db::new(Self::column_families())?) } - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] pub fn open(path: &Path, key: Option<[u8; 32]>) -> Result { Self::setup(Db::open_read_write( Some(path), @@ -89,7 +89,7 @@ impl Storage { )?) } - // #[cfg(all(not(target_family = "wasm"), not(doc)))] + // #[cfg(all(not(target_family = "wasm")))] // pub fn open_secondary(primary_path: &Path) -> Result { // Self::setup(Db::open_secondary( // primary_path, @@ -98,7 +98,7 @@ impl Storage { // )?) // } - // #[cfg(all(not(target_family = "wasm"), not(doc)))] + // #[cfg(all(not(target_family = "wasm")))] // pub fn open_persistent_secondary( // primary_path: &Path, // secondary_path: &Path, @@ -110,7 +110,7 @@ impl Storage { // )?) // } - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] pub fn open_read_only(path: &Path, key: Option<[u8; 32]>) -> Result { Self::setup(Db::open_read_only(path, Self::column_families(), key)?) } @@ -188,7 +188,7 @@ impl Storage { fn setup(db: Db) -> Result { let this = Self { - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] default_cf: db.column_family(DEFAULT_CF)?, id2str_cf: db.column_family(ID2STR_CF)?, spog_cf: db.column_family(SPOG_CF)?, @@ -203,12 +203,12 @@ impl Storage { graphs_cf: db.column_family(GRAPHS_CF)?, db, }; - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] this.migrate()?; Ok(this) } - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] fn migrate(&self) -> Result<(), StorageError> { let mut version = self.ensure_version()?; if version == 0 { @@ -248,7 +248,7 @@ impl Storage { } } - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] fn ensure_version(&self) -> Result { Ok( if let Some(version) = self.db.get(&self.default_cf, b"oxversion")? { @@ -262,7 +262,7 @@ impl Storage { ) } - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] fn update_version(&self, version: u64) -> Result<(), StorageError> { self.db .insert(&self.default_cf, b"oxversion", &version.to_be_bytes())?; @@ -289,12 +289,12 @@ impl Storage { }) } - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] pub fn flush(&self) -> Result<(), StorageError> { self.db.flush() } - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] pub fn compact(&self) -> Result<(), StorageError> { self.db.compact(&self.default_cf)?; self.db.compact(&self.gspo_cf)?; @@ -309,7 +309,7 @@ impl Storage { self.db.compact(&self.id2str_cf) } - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] pub fn backup(&self, target_directory: &Path) -> Result<(), StorageError> { self.db.backup(target_directory) } @@ -634,7 +634,7 @@ impl StorageReader { } } - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] pub fn get_str(&self, key: &StrHash) -> Result, StorageError> { Ok(self .storage @@ -645,7 +645,7 @@ impl StorageReader { .map_err(CorruptionError::new)?) } - #[cfg(any(target_family = "wasm", doc))] + #[cfg(any(target_family = "wasm"))] pub fn get_str(&self, key: &StrHash) -> Result, StorageError> { Ok(self .reader @@ -655,21 +655,21 @@ impl StorageReader { .map_err(CorruptionError::new)?) } - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] pub fn contains_str(&self, key: &StrHash) -> Result { self.storage .db .contains_key(&self.storage.id2str_cf, &key.to_be_bytes()) } - #[cfg(any(target_family = "wasm", doc))] + #[cfg(any(target_family = "wasm"))] pub fn contains_str(&self, key: &StrHash) -> Result { self.reader .contains_key(&self.storage.id2str_cf, &key.to_be_bytes()) } /// Validates that all the storage invariants held in the data - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] pub fn validate(&self) -> Result<(), StorageError> { // triples let dspo_size = self.dspo_quads(&[]).count(); @@ -781,7 +781,7 @@ impl StorageReader { } /// Validates that all the storage invariants held in the data - #[cfg(any(target_family = "wasm", doc))] + #[cfg(any(target_family = "wasm"))] #[allow(clippy::unused_self, clippy::unnecessary_wraps)] pub fn validate(&self) -> Result<(), StorageError> { Ok(()) // TODO @@ -1005,7 +1005,7 @@ impl<'a> StorageWriter<'a> { } } - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] fn insert_str(&mut self, key: &StrHash, value: &str) -> Result<(), StorageError> { if self .storage @@ -1021,7 +1021,7 @@ impl<'a> StorageWriter<'a> { ) } - #[cfg(any(target_family = "wasm", doc))] + #[cfg(any(target_family = "wasm"))] fn insert_str(&mut self, key: &StrHash, value: &str) -> Result<(), StorageError> { self.transaction.insert( &self.storage.id2str_cf, @@ -1186,7 +1186,7 @@ impl<'a> StorageWriter<'a> { } } -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] #[must_use] pub struct StorageBulkLoader { storage: Storage, @@ -1195,7 +1195,7 @@ pub struct StorageBulkLoader { max_memory_size: Option, } -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] impl StorageBulkLoader { pub fn new(storage: Storage) -> Self { Self { @@ -1326,7 +1326,7 @@ impl StorageBulkLoader { } } -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] struct FileBulkLoader<'a> { storage: &'a Storage, id2str: HashMap>, @@ -1335,7 +1335,7 @@ struct FileBulkLoader<'a> { graphs: HashSet, } -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] impl<'a> FileBulkLoader<'a> { fn new(storage: &'a Storage, batch_size: usize) -> Self { Self { @@ -1541,7 +1541,7 @@ impl<'a> FileBulkLoader<'a> { } } -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] fn map_thread_result(result: thread::Result) -> io::Result { result.map_err(|e| { io::Error::new( diff --git a/ng-oxigraph/src/oxigraph/store.rs b/ng-oxigraph/src/oxigraph/store.rs index 523428b..310901e 100644 --- a/ng-oxigraph/src/oxigraph/store.rs +++ b/ng-oxigraph/src/oxigraph/store.rs @@ -25,7 +25,7 @@ //! }; //! # Result::<_, Box>::Ok(()) //! ``` -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] use super::io::RdfParseError; use super::io::{RdfFormat, RdfParser, RdfSerializer}; use super::model::*; @@ -34,7 +34,7 @@ use super::sparql::{ QueryResults, Update, UpdateOptions, }; use super::storage::numeric_encoder::{Decoder, EncodedQuad, EncodedTerm}; -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] use super::storage::StorageBulkLoader; use super::storage::{ ChainedDecodingQuadIterator, DecodingGraphIterator, Storage, StorageReader, StorageWriter, @@ -42,7 +42,7 @@ use super::storage::{ pub use super::storage::{CorruptionError, LoaderError, SerializerError, StorageError}; use std::error::Error; use std::io::{Read, Write}; -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] use std::path::Path; use std::{fmt, str}; @@ -100,14 +100,14 @@ impl Store { /// Only one read-write [`Store`] can exist at the same time. /// If you want to have extra [`Store`] instance opened on a same data /// use [`Store::open_read_only`]. - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] pub fn open(path: impl AsRef) -> Result { Ok(Self { storage: Storage::open(path.as_ref(), None)?, }) } - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] pub fn open_with_key(path: impl AsRef, key: [u8; 32]) -> Result { Ok(Self { storage: Storage::open(path.as_ref(), Some(key))?, @@ -124,7 +124,7 @@ impl Store { // /// If you prefer persistent storage use [`Store::open_persistent_secondary`]. // /// // /// If you want to simple read-only [`Store`] use [`Store::open_read_only`]. - // #[cfg(all(not(target_family = "wasm"), not(doc)))] + // #[cfg(all(not(target_family = "wasm")))] // pub fn open_secondary(primary_path: impl AsRef) -> Result { // Ok(Self { // storage: Storage::open_secondary(primary_path.as_ref())?, @@ -139,7 +139,7 @@ impl Store { /// `primary_path` must be the path of the primary instance and `secondary_path` an other directory for the secondary instance cache. /// /// If you want to simple read-only [`Store`] use [`Store::open_read_only`]. - // #[cfg(all(not(target_family = "wasm"), not(doc)))] + // #[cfg(all(not(target_family = "wasm")))] // pub fn open_persistent_secondary( // primary_path: impl AsRef, // secondary_path: impl AsRef, @@ -155,7 +155,7 @@ impl Store { /// Opens a read-only [`Store`] from disk. /// /// Opening as read-only while having an other process writing the database is undefined behavior. - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] pub fn open_read_only( path: impl AsRef, key: Option<[u8; 32]>, @@ -939,7 +939,7 @@ impl Store { /// Flushes all buffers and ensures that all writes are saved on disk. /// /// Flushes are automatically done using background threads but might lag a little bit. - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] pub fn flush(&self) -> Result<(), StorageError> { self.storage.flush() } @@ -949,7 +949,7 @@ impl Store { /// Useful to call after a batch upload or another similar operation. /// ///
Can take hours on huge databases.
- #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] pub fn optimize(&self) -> Result<(), StorageError> { self.storage.compact() } @@ -972,7 +972,7 @@ impl Store { /// This allows cheap regular backups. /// /// If you want to move your data to another RDF storage system, you should have a look at the [`Store::dump_to_write`] function instead. - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] pub fn backup(&self, target_directory: impl AsRef) -> Result<(), StorageError> { self.storage.backup(target_directory.as_ref()) } @@ -999,7 +999,7 @@ impl Store { /// assert!(store.contains(QuadRef::new(ex, ex, ex, ex))?); /// # Result::<_, Box>::Ok(()) /// ``` - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] pub fn bulk_loader(&self) -> BulkLoader { BulkLoader { storage: StorageBulkLoader::new(self.storage.clone()), @@ -1617,14 +1617,14 @@ impl Iterator for GraphNameIter { /// assert!(store.contains(QuadRef::new(ex, ex, ex, ex))?); /// # Result::<_, Box>::Ok(()) /// ``` -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] #[must_use] pub struct BulkLoader { storage: StorageBulkLoader, on_parse_error: Option Result<(), RdfParseError>>>, } -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] impl BulkLoader { /// Sets the maximal number of threads to be used by the bulk loader per operation. /// diff --git a/ng-repo/Cargo.toml b/ng-repo/Cargo.toml index 8331c65..66f0da7 100644 --- a/ng-repo/Cargo.toml +++ b/ng-repo/Cargo.toml @@ -38,7 +38,7 @@ bloomfilter = { version = "1.0.13", features = ["random","serde"] } curve25519-dalek = "3.2.0" threshold_crypto = "0.4.0" crypto_box = { version = "0.8.2", features = ["seal"] } -zeroize = { version = "1.6.0", features = ["zeroize_derive"] } +zeroize = { version = "1.7.0", features = ["zeroize_derive"] } base64-url = "2.0.0" web-time = "0.2.0" time = { version= "0.3.36", features = ["formatting"] } diff --git a/ng-storage-rocksdb/Cargo.toml b/ng-storage-rocksdb/Cargo.toml index 7650cf7..d0b7553 100644 --- a/ng-storage-rocksdb/Cargo.toml +++ b/ng-storage-rocksdb/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ng-storage-rocksdb" -# version = "0.1.0" +version = "0.1.0-preview.3" description = "Stores based on RocksDB for NextGraph" version.workspace = true edition.workspace = true @@ -20,4 +20,4 @@ ng-repo = { path = "../ng-repo", version = "0.1.0-preview.1" } git = "https://git.nextgraph.org/NextGraph/rust-rocksdb.git" branch = "master" features = [ ] -version = "0.21.0" +version = "0.21.0-ngpreview.1" diff --git a/ng-verifier/Cargo.toml b/ng-verifier/Cargo.toml index 8ca0ed9..50942b1 100644 --- a/ng-verifier/Cargo.toml +++ b/ng-verifier/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ng-verifier" -version = "0.1.0-preview.2" +version = "0.1.0-preview.3" description = "Verifier library of NextGraph" edition.workspace = true license.workspace = true @@ -32,17 +32,14 @@ yrs = "0.18.2" bloomfilter = { version = "1.0.13", features = ["random","serde"] } ng-repo = { path = "../ng-repo", version = "0.1.0-preview.1" } ng-net = { path = "../ng-net", version = "0.1.0-preview.1" } -ng-oxigraph = { path = "../ng-oxigraph", version = "0.4.0-alpha.7-ngpreview2" } +ng-oxigraph = { path = "../ng-oxigraph", version = "0.4.0-alpha.7-ngpreview3" } [target.'cfg(target_arch = "wasm32")'.dependencies] -ng-oxigraph = { path = "../ng-oxigraph", version = "0.4.0-alpha.7-ngpreview2", features = ["js"] } +ng-oxigraph = { path = "../ng-oxigraph", version = "0.4.0-alpha.7-ngpreview3", features = ["js"] } -[target.'cfg(all(not(target_arch = "wasm32"),not(doc)))'.dependencies] -ng-storage-rocksdb = { path = "../ng-storage-rocksdb", version = "0.1.0-preview.1" } +[target.'cfg(all(not(target_arch = "wasm32")))'.dependencies] +ng-storage-rocksdb = { path = "../ng-storage-rocksdb", version = "0.1.0-preview.3" } getrandom = "0.2.7" [dev-dependencies] -ng-repo = { path = "../ng-repo", version = "0.1.0-preview.1", features = ["testing"] } - -[package.metadata.docs.rs] -rustc-args = [ "--cfg" , "doc"] \ No newline at end of file +ng-repo = { path = "../ng-repo", version = "0.1.0-preview.1", features = ["testing"] } \ No newline at end of file diff --git a/ng-verifier/src/lib.rs b/ng-verifier/src/lib.rs index d28b395..b4567a7 100644 --- a/ng-verifier/src/lib.rs +++ b/ng-verifier/src/lib.rs @@ -12,5 +12,5 @@ mod commits; mod request_processor; -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] mod rocksdb_user_storage; diff --git a/ng-verifier/src/verifier.rs b/ng-verifier/src/verifier.rs index 12ed5a2..c025c97 100644 --- a/ng-verifier/src/verifier.rs +++ b/ng-verifier/src/verifier.rs @@ -13,11 +13,11 @@ use core::fmt; use std::cmp::max; use std::collections::BTreeMap; use std::collections::HashSet; -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] use std::fs::create_dir_all; -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] use std::fs::{read, File, OpenOptions}; -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] use std::io::Write; use std::{collections::HashMap, sync::Arc}; @@ -58,7 +58,7 @@ use ng_net::{ }; use crate::commits::*; -#[cfg(all(not(target_family = "wasm"), not(doc)))] +#[cfg(all(not(target_family = "wasm")))] use crate::rocksdb_user_storage::RocksDbUserStorage; use crate::types::*; use crate::user_storage::InMemoryUserStorage; @@ -714,7 +714,7 @@ impl Verifier { } Ok(res) } - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] VerifierConfigType::RocksDb(path) => { let mut path = path.clone(); path.push(format!("outbox{}", self.peer_id.to_hash_string())); @@ -794,7 +794,7 @@ impl Verifier { serde_bare::to_vec(&e)?, )?; } - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] VerifierConfigType::RocksDb(path) => { let mut path = path.clone(); std::fs::create_dir_all(path.clone()).unwrap(); @@ -1968,7 +1968,7 @@ impl Verifier { let res = (js.last_seq_function)(self.peer_id, qty)?; self.max_reserved_seq_num = res + qty as u64; } - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] VerifierConfigType::RocksDb(path) => { let mut path = path.clone(); std::fs::create_dir_all(path.clone()).unwrap(); @@ -2028,7 +2028,7 @@ impl Verifier { Some(Box::new(InMemoryUserStorage::new()) as Box), Some(block_storage), ), - #[cfg(all(not(target_family = "wasm"), not(doc)))] + #[cfg(all(not(target_family = "wasm")))] VerifierConfigType::RocksDb(path) => { let mut path_oxi = path.clone(); path_oxi.push("graph"); diff --git a/ng-wallet/Cargo.toml b/ng-wallet/Cargo.toml index 3c5f5fd..720da95 100644 --- a/ng-wallet/Cargo.toml +++ b/ng-wallet/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ng-wallet" -version = "0.1.0-preview.1" +version = "0.1.0-preview.3" description = "Wallet library of NextGraph. keeps the secret keys of all identities of the user in a safe wallet. NextGraph is a decentralized, secure and local-first web 3.0 ecosystem based on Semantic Web and CRDTs" categories = ["authentication"] edition.workspace = true @@ -23,7 +23,7 @@ async-std = { version = "1.12.0", features = ["attributes","unstable"] } getrandom = { version = "0.1.1", features = ["wasm-bindgen"] } rand = { version = "0.7", features = ["getrandom"] } aes-gcm-siv = {version = "0.11.1", features = ["aes","heapless","getrandom","std"] } -zeroize = { version = "1.6.0", features = ["zeroize_derive"] } +zeroize = { version = "1.7.0", features = ["zeroize_derive"] } crypto_box = { version = "0.8.2", features = ["seal"] } blake3 = "1.3.1" argon2 = "0.5.0" @@ -33,8 +33,8 @@ image = "0.24.6" web-time = "0.2.0" ng-repo = { path = "../ng-repo", version = "0.1.0-preview.1" } ng-net = { path = "../ng-net", version = "0.1.0-preview.1" } -ng-verifier = { path = "../ng-verifier", version = "0.1.0-preview.1" } +ng-verifier = { path = "../ng-verifier", version = "0.1.0-preview.3" } [dev-dependencies] ng-repo = { path = "../ng-repo", version = "0.1.0-preview.1", features = ["testing"] } -ng-verifier = { path = "../ng-verifier", version = "0.1.0-preview.1", features = ["testing"] } \ No newline at end of file +ng-verifier = { path = "../ng-verifier", version = "0.1.0-preview.3", features = ["testing"] } \ No newline at end of file diff --git a/ngcli/Cargo.toml b/ngcli/Cargo.toml index bd56996..62dc2e3 100644 --- a/ngcli/Cargo.toml +++ b/ngcli/Cargo.toml @@ -19,7 +19,7 @@ maintenance = { status = "actively-developed" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" async-std = { version = "1.12.0", features = ["attributes"] } -zeroize = { version = "1.6.0" } +zeroize = { version = "1.7.0" } getrandom = "0.2.7" blake3 = "1.3.1" duration-str = "0.7.1" diff --git a/ngd/Cargo.toml b/ngd/Cargo.toml index 01c8bb2..defbcc4 100644 --- a/ngd/Cargo.toml +++ b/ngd/Cargo.toml @@ -20,7 +20,7 @@ maintenance = { status = "actively-developed" } serde_bare = "0.5.0" serde_json = "1.0" async-std = { version = "1.12.0", features = ["attributes"] } -zeroize = { version = "1.6.0" } +zeroize = { version = "1.7.0" } addr = "0.15.6" regex = "1.8.4" lazy_static = "1.4.0" @@ -29,7 +29,7 @@ env_logger = "0.10" clap = { version = "4.3.21", features = ["derive","env","string"] } ng-repo = { path = "../ng-repo", version = "0.1.0-preview.1", features = ["server_log_output"] } ng-net = { path = "../ng-net", version = "0.1.0-preview.1" } -ng-broker = { path = "../ng-broker", version = "0.1.0-preview.1" } +ng-broker = { path = "../ng-broker", version = "0.1.0-preview.3" }