Skip to content

Commit

Permalink
build: reduced required rustc version to 1.63 (from 1.66)
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Pospesel committed Feb 19, 2024
1 parent 456b460 commit 67d6615
Show file tree
Hide file tree
Showing 14 changed files with 158 additions and 111 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ It is meant to generalize (and improve upon) the authentication scheme [Ricochet
Gosling currently has the following required build dependencies:

- [cmake >= 3.17](https://cmake.org)
- [rust >= 1.66.0](https://rust-lang.org)
- [rust >= 1.63.0](https://rust-lang.org)

Cargo will automatically download and build the required Rust crates. The list of current dependencies can be found in each crate's Cargo.toml file:

Expand Down
9 changes: 5 additions & 4 deletions source/bindings/cpp/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[package]
name = "build_cpp_bindings"
version = "0.1.0"
rust-version = "1.63"
edition = "2021"

[[bin]]
name = "build_cpp_bindings"
path = "./build_cpp_bindings.rs"

[dependencies]
handlebars = "4.5.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
regex = "1.10"
handlebars = "^4.3.0"
regex = ">= 1.9, <= 1.9.6"
serde = { version = "^1.0", features = ["derive"] }
serde_json = "^1.0"
11 changes: 6 additions & 5 deletions source/bindings/java/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
[package]
name = "build_java_bindings"
version = "0.1.0"
rust-version = "1.63"
edition = "2021"

[[bin]]
name = "build_java_bindings"
path = "./build_java_bindings.rs"

[dependencies]
handlebars = "4.5.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
regex = "1.10"
heck = "0.4.1"
handlebars = "^4.3.0"
heck = "^0.4"
regex = ">= 1.9, <= 1.9.6"
serde = { version = "^1.0", features = ["derive"] }
serde_json = "^1.0"
11 changes: 6 additions & 5 deletions source/bindings/python/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
[package]
name = "build_python_bindings"
version = "0.1.0"
rust-version = "1.63"
edition = "2021"

[[bin]]
name = "build_python_bindings"
path = "./build_python_bindings.rs"

[dependencies]
handlebars = "4.5.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
regex = "1.10"
heck = "0.4.1"
handlebars = "^4.3.0"
heck = "^0.4"
regex = ">= 1.9, <= 1.9.6"
serde = { version = "^1.0", features = ["derive"] }
serde_json = "^1.0"
22 changes: 12 additions & 10 deletions source/gosling/crates/cgosling/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@
name = "cgosling"
build = "build.rs"
authors = ["Richard Pospesel <richard@blueprintforfreespeech.net>"]
version = "0.2.0"
rust-version = "1.66"
version = "0.2.1"
rust-version = "1.63"
edition = "2021"

[build-dependencies]
cbindgen = "0.20.0"
regex = "1.10.2"
regex = "<= 1.9.6"
serde = "1.0.193"
serde_json = "1.0"


[dependencies]
anyhow = "1.0"
bson = "2.2.0"
gosling = { version = "0.1.0", path = "../gosling" }
paste = "1.0"
static_assertions = "1.1.0"
tor-interface = { version = "0.2.0", path = "../tor-interface" }
which = "4.3.0"
anyhow = "^1"
backtrace = ">= 0.3, <= 0.3.67"
bson = ">= 2.0, <= 2.4.0"
gosling = { version = "^0.1.0", path = "../gosling" }
home = ">= 0.5, <= 0.5.5"
paste = "^1.0"
static_assertions = "^1.1"
tor-interface = { version = "^0.2.0", path = "../tor-interface" }
which = ">= 4.4.2, <= 5.0.0"

[lib]
name = "cgosling"
Expand Down
3 changes: 2 additions & 1 deletion source/gosling/crates/cgosling/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[package]
name = "cgosling-fuzz"
version = "0.0.0"
rust-version = "1.63"
publish = false
edition = "2021"

[package.metadata]
cargo-fuzz = true

[dependencies]
libfuzzer-sys = { version = "0.4.0", features = ["arbitrary-derive"] }
libfuzzer-sys = { version = "^0.4", features = ["arbitrary-derive"] }

[dependencies.cgosling]
path = ".."
Expand Down
35 changes: 27 additions & 8 deletions source/gosling/crates/cgosling/src/object_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::option::Option;
// for the unique id portion of the returne dkeys)
pub struct ObjectRegistry<T, const TAG: usize, const TAG_BITS: u32> {
// our internal mapping from handles to Ts
map: BTreeMap<usize, T>,
map: Option<BTreeMap<usize, T>>,
// number of Ts registered to this registry over its lifetime
counter: usize,
}
Expand All @@ -41,38 +41,57 @@ impl<T, const TAG: usize, const TAG_BITS: u32> ObjectRegistry<T, TAG, TAG_BITS>
assert!(TAG_BITS == 0 || (TAG << Self::COUNTER_BITS) >> Self::COUNTER_BITS == TAG);

ObjectRegistry {
map: BTreeMap::new(),
map: None,
counter: 0,
}
}

// determine if the registry has an object with the specified key
pub fn contains_key(&self, key: usize) -> bool {
self.map.contains_key(&key)
match &self.map {
Some(map) => map.contains_key(&key),
None => false,
}
}

// remove and return an object with the specified key
pub fn remove(&mut self, key: usize) -> Option<T> {
self.map.remove(&key)
match &mut self.map {
Some(map) => map.remove(&key),
None => None,
}
}

// add object into registry and return key to reference it
pub fn insert(&mut self, val: T) -> usize {
let key = self.next_key();
if self.map.insert(key, val).is_some() {
panic!();
match &mut self.map {
Some(map) => if map.insert(key, val).is_some() {
panic!();
},
None => {
let mut map = BTreeMap::new();
map.insert(key, val);
self.map = Some(map);
}
}
key
}

// gets a reference to a value by the given key
pub fn get(&self, key: usize) -> Option<&T> {
self.map.get(&key)
match &self.map {
Some(map) => map.get(&key),
None => None,
}
}

// gets a mutable reference to a value by the given key
pub fn get_mut(&mut self, key: usize) -> Option<&mut T> {
self.map.get_mut(&key)
match &mut self.map {
Some(map) => map.get_mut(&key),
None => None,
}
}

#[cfg(test)]
Expand Down
41 changes: 21 additions & 20 deletions source/gosling/crates/gosling/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
[package]
name = "gosling"
authors = ["Richard Pospesel <richard@blueprintforfreespeech.net>"]
version = "0.1.0"
rust-version = "1.66"
version = "0.1.1"
rust-version = "1.63"
edition = "2021"
license = "BSD-3-Clause"
description = "A library for developing fully anonymous, peer-to-peer, metadata-resistant applications using tor onion services"
homepage = "https://blueprint-freespeech.github.io/gosling/index.xhtml"
repository = "https://github.com/blueprint-freespeech/gosling"

[dependencies]
bson = "2.2.0"
data-encoding = "2.3.2"
data-encoding-macro = "0.1.12"
bson = ">= 2.0, <= 2.4.0"
data-encoding = "^2"
data-encoding-macro = "^0.1"
honk-rpc = { version = "0.1.0", path = "../honk-rpc" }
num_enum = "0.5.6"
paste = "1.0"
rand = "0.8.5"
rand_core = "0.6.3"
regex = "1.5.5"
signature = "1.5.0"
socks = "0.3.4"
static_assertions = "1.1.0"
tor-interface = { version = "0.2.0", path = "../tor-interface" }
tor-llcrypto = { version = "0.2.0", features = ["relay"] }
url = "2.2.2"
num_enum = "^0.6"
paste = "^1.0"
rand = "^0.8"
rand_core = "^0.6"
regex = ">= 1.9, <= 1.9.6"
signature = "^1.5"
socks = "^0.3"
static_assertions = "^1.1"
thiserror = "^1"
tor-interface = { version = "^0.2.0", path = "../tor-interface" }
tor-llcrypto = { version = ">= 0.3, <= 0.4.4", features = ["relay"] }
url = "^2.3"
zeroize = "^1"
thiserror = "1.0"

[dev-dependencies]
anyhow = "1.0"
serial_test = "0.9.0"
which = "4.3.0"
anyhow = "^1"
dashmap = ">= 5, <= 5.4.0"
serial_test = "0.9.*"
which = ">= 4.4.2, <= 5.0.0"

[features]
offline-test = ["tor-interface/offline-test"]
9 changes: 5 additions & 4 deletions source/gosling/crates/gosling/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
[package]
name = "gosling-fuzz"
version = "0.0.0"
rust-version = "1.63"
publish = false
edition = "2021"

[package.metadata]
cargo-fuzz = true

[dependencies]
bson = "2.2.0"
data-encoding = "2.3.2"
libfuzzer-sys = { version = "0.4.0", features = ["arbitrary-derive"] }
tor-interface = { path = "../../tor-interface" }
bson = ">= 2.0, <= 2.4.0"
data-encoding = "^2"
honk-rpc = { path = "../../honk-rpc" }
libfuzzer-sys = { version = "^0.4", features = ["arbitrary-derive"] }
tor-interface = { path = "../../tor-interface" }

[dependencies.gosling]
path = ".."
Expand Down
14 changes: 7 additions & 7 deletions source/gosling/crates/honk-rpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[package]
name = "honk-rpc"
authors = ["Richard Pospesel <richard@blueprintforfreespeech.net>"]
version = "0.1.0"
rust-version = "1.66"
version = "0.1.1"
rust-version = "1.63"
edition = "2021"
license = "BSD-3-Clause"
description = "A library implementing an asynchrynous, bi-directional, dynamic, and BSON-based remote procedure call system"
repository = "https://github.com/blueprint-freespeech/gosling"

[dependencies]
bson = "2.2.0"
thiserror = "1.0"
bson = ">= 2.0, <= 2.4.0"
thiserror = "^1"

[dev-dependencies]
anyhow = "1.0"
data-encoding = "2.3.2"
sha3 = "0.10.8"
anyhow = "^1"
data-encoding = "^2"
sha3 = "^0.10"
5 changes: 3 additions & 2 deletions source/gosling/crates/honk-rpc/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
[package]
name = "honk-rpc-fuzz"
version = "0.0.0"
rust-version = "1.63"
publish = false
edition = "2021"

[package.metadata]
cargo-fuzz = true

[dependencies]
bson = "2.2.0"
libfuzzer-sys = { version = "0.4.0", features = ["arbitrary-derive"] }
bson = ">= 2.0, <= 2.4.0"
libfuzzer-sys = { version = "^0.4", features = ["arbitrary-derive"] }

[dependencies.honk-rpc]
path = ".."
Expand Down
34 changes: 18 additions & 16 deletions source/gosling/crates/tor-interface/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
[package]
name = "tor-interface"
authors = ["Richard Pospesel <richard@blueprintforfreespeech.net>"]
version = "0.2.0"
rust-version = "1.66"
version = "0.2.1"
rust-version = "1.63"
edition = "2021"
license = "BSD-3-Clause"
description = "A library providing a Rust interface to interact with the legacy tor daemon"
keywords = ["tor", "anonymity"]
repository = "https://github.com/blueprint-freespeech/gosling"

[dependencies]
data-encoding = "2.3.2"
data-encoding-macro = "0.1.12"
rand = "0.8.5"
rand_core = "0.6.3"
regex = "1.5.5"
sha1 = "0.10.6"
sha3 = "0.10.8"
signature = "1.5.0"
socks = "0.3.4"
tor-llcrypto = { version = "0.2.0", features = ["relay"] }
thiserror = "1.0"
data-encoding = "^2"
data-encoding-macro = "^0.1"
rand = "^0.8"
rand_core = "^0.6"
regex = ">= 1.9, <= 1.9.6"
sha1 = "^0.10"
sha3 = "^0.10"
signature = "^1.5"
socks = "^0.3"
thiserror = "^1"
time-macros = ">= 0.2, <= 0.2.8"
tor-llcrypto = { version = ">= 0.3, <= 0.4.4", features = ["relay"] }

[dev-dependencies]
anyhow = "1.0"
serial_test = "0.9.0"
which = "4.3.0"
anyhow = "^1"
dashmap = ">= 5, <= 5.4.0"
serial_test = "0.9.*"
which = ">= 4.4.2, <= 5.0.0"

[features]
offline-test = []
3 changes: 2 additions & 1 deletion source/gosling/crates/tor-interface/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[package]
name = "tor-interface-fuzz"
version = "0.0.0"
rust-version = "1.63"
publish = false
edition = "2021"

[package.metadata]
cargo-fuzz = true

[dependencies]
libfuzzer-sys = { version = "0.4.0", features = ["arbitrary-derive"] }
libfuzzer-sys = { version = "^0.4", features = ["arbitrary-derive"] }

[dependencies.tor-interface]
path = ".."
Expand Down
Loading

0 comments on commit 67d6615

Please sign in to comment.