Skip to content

Commit

Permalink
Update dependencies (#369)
Browse files Browse the repository at this point in the history
Specify `js` feature for `uuid` when building wasm by
specifying it as a non-optional dependency in wasm binding's Cargo.toml.

Signed-off-by: Anand Krishnamoorthi <[email protected]>
  • Loading branch information
anakrish authored Mar 3, 2025
1 parent 5fa55d7 commit 6174af1
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 23 deletions.
22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,25 +105,25 @@ serde_json = { version = "1.0.89", default-features = false, features = ["alloc"
lazy_static = { version = "1.4.0", default-features = false }

# Crypto
constant_time_eq = {version = "0.3.0", optional = true, default-features = false }
constant_time_eq = {version = "0.4.0", optional = true, default-features = false }
hmac = {version = "0.12.1", optional = true, default-features = false}
sha2 = {version= "0.10.8", optional = true, default-features = false }
hex = {version = "0.4.3", optional = true, default-features = false, features = ["alloc"] }
sha1 = {version = "0.10.6", optional = true, default-features = false }
md-5 = {version = "0.10.6", optional = true, default-features = false }

data-encoding = { version = "2.4.0", optional = true, default-features=false, features = ["alloc"] }
scientific = { version = "0.5.2" }
data-encoding = { version = "2.8.0", optional = true, default-features=false, features = ["alloc"] }
scientific = { version = "0.5.3" }

regex = {version = "1.10.2", optional = true, default-features = false }
semver = {version = "1.0.20", optional = true, default-features = false }
regex = {version = "1.11.1", optional = true, default-features = false }
semver = {version = "1.0.25", optional = true, default-features = false }
wax = { version = "0.6.0", features = [], default-features = false, optional = true }
url = { version = "2.5.0", optional = true }
uuid = { version = "1.6.1", default-features = false, features = ["v4", "fast-rng"], optional = true }
jsonschema = { version = "0.28.1", default-features = false, optional = true }
chrono = { version = "0.4.31", optional = true }
chrono-tz = { version = "0.10.0", optional = true }
jsonwebtoken = { version = "9.2.0", optional = true }
url = { version = "2.5.4", optional = true }
uuid = { version = "1.15.1", default-features = false, features = ["v4", "fast-rng"], optional = true }
jsonschema = { version = "0.29.0", default-features = false, optional = true }
chrono = { version = "0.4.40", optional = true }
chrono-tz = { version = "0.10.1", optional = true }
jsonwebtoken = { version = "9.3.1", optional = true }
itertools = { version = "0.14.0", default-features = false, optional = true }

serde_yaml = {version = "0.9.16", default-features = false, optional = true }
Expand Down
2 changes: 1 addition & 1 deletion bindings/ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ crate-type = ["cdylib", "staticlib"]
[dependencies]
anyhow = "1.0"
regorus = { path = "../..", default-features = false }
serde_json = "1.0.113"
serde_json = "1.0.140"

[features]
default = ["ast", "std", "coverage", "regorus/arc", "regorus/full-opa"]
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ coverage = ["regorus/coverage"]

[dependencies]
anyhow = "1.0"
ordered-float = "4.2.0"
ordered-float = "5.0.0"
pyo3 = {version = "0.22.0", features = ["anyhow", "extension-module"] }
regorus = { path = "../..", default-features = false, features = ["arc"] }
serde_json = "1.0.112"
serde_json = "1.0.140"

8 changes: 7 additions & 1 deletion bindings/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ coverage = ["regorus/coverage"]

[dependencies]
regorus = { path = "../..", default-features = false, features = ["arc"] }
serde_json = "1.0.111"
serde_json = "1.0.140"
wasm-bindgen = "=0.2.93"
# Specify uuid as a mandatory dependency so as to enable `js` feature which is now required
# when targeting wasm32-unknown-unknown.
uuid = { version = "1.15.1", default-features = false, features = ["v4", "fast-rng", "js"]}

[dev-dependencies]
wasm-bindgen-test = "0.3.40"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(wasm_bindgen_unstable_test_coverage)'] }
16 changes: 8 additions & 8 deletions src/builtins/uuid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,16 @@ fn timestamp(uuid: &Uuid) -> Option<Timestamp> {
const fn decode_rfc4122_timestamp(uuid: &Uuid) -> (u64, u16) {
let bytes = uuid.as_bytes();

let ticks: u64 = ((bytes[6] & 0x0F) as u64) << 56
| (bytes[7] as u64) << 48
| (bytes[4] as u64) << 40
| (bytes[5] as u64) << 32
| (bytes[0] as u64) << 24
| (bytes[1] as u64) << 16
| (bytes[2] as u64) << 8
let ticks: u64 = (((bytes[6] & 0x0F) as u64) << 56)
| ((bytes[7] as u64) << 48)
| ((bytes[4] as u64) << 40)
| ((bytes[5] as u64) << 32)
| ((bytes[0] as u64) << 24)
| ((bytes[1] as u64) << 16)
| ((bytes[2] as u64) << 8)
| (bytes[3] as u64);

let counter: u16 = ((bytes[8] & 0x3F) as u16) << 8 | (bytes[9] as u16);
let counter: u16 = (((bytes[8] & 0x3F) as u16) << 8) | (bytes[9] as u16);

(ticks, counter)
}

0 comments on commit 6174af1

Please sign in to comment.