Skip to content

Commit

Permalink
chore(hakari): configure patch directive for local workspace-hack
Browse files Browse the repository at this point in the history
  • Loading branch information
snormore committed Jul 4, 2024
1 parent fe63b79 commit 504659c
Show file tree
Hide file tree
Showing 46 changed files with 62 additions and 52 deletions.
3 changes: 3 additions & 0 deletions .config/hakari.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ platforms = [
# Write out exact versions rather than a semver range. (Defaults to false.)
# exact-versions = true

# Style of workspace-hack lines to output.
workspace-hack-line-style = "workspace-dotted"

# Crates to exclude while traversing the dependency graph.
[traversal-excludes]
third-party = [
Expand Down
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ version = "0.1.0"
edition = "2021"

[workspace.dependencies]
workspace-hack = "0.1.0"
anyhow = "1.0"
async-trait = "0.1"
autometrics = { version = "0.6.0", features = ["prometheus-exporter"] }
Expand Down Expand Up @@ -82,6 +83,13 @@ panic-report = { path = "lib/panic-report" }
better-shutdown = { path = "lib/better-shutdown" }
fleek-blake3 = "1.5"

# This ensures that while building within the workspace, the real workspace-hack is used. When
# building outside of the workspace, such as via a Git or path dependency, the [patch] directive
# is inactive, and the stub crate from crates.io is used.
# See https://docs.rs/cargo-hakari/0.9.29/cargo_hakari/patch_directive/index.html
[patch.crates-io.workspace-hack]
path = "etc/workspace-hack"

# Since MystenLabs uses Hakari in the sui repository, and we bring narwhal in from there, this
# results into all of their dependencies and packages to be listed in their workspace-hack crate.
# That adds a huge amount of unwanted dependencies to our crate. The `empty-workspace-hack` is an
Expand Down
2 changes: 1 addition & 1 deletion core/application/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fleek-crypto.workspace = true
hp-fixed.workspace = true
atomo-rocks.workspace = true
resolved-pathbuf.workspace = true
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true
serde_with = "3.8.1"


Expand Down
2 changes: 1 addition & 1 deletion core/archive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ethers.workspace = true
rocksdb = "0.21"
atomo-rocks.workspace = true
atomo.workspace = true
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true


[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion core/blockstore-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ futures.workspace = true
anyhow.workspace = true
tracing.workspace = true
thiserror = "1.0"
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
lightning-test-utils = { path = "../test-utils" }
Expand Down
2 changes: 1 addition & 1 deletion core/blockstore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ thiserror.workspace = true
tokio.workspace = true
derive_more = "0.99"
arrayref = "0.3"
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true
2 changes: 1 addition & 1 deletion core/broadcast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ smallvec = "1.11.0"
ta = "0.5.0"
tracing.workspace = true
rand.workspace = true
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
lightning-test-utils = { path = "../test-utils" }
Expand Down
2 changes: 1 addition & 1 deletion core/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ panic-report.workspace = true
once_cell = "1.19"
os_info = "3.7.0"
tui-logger = { version = "0.11", optional = true }
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
serial_test = "3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion core/consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ tonic = { version = "0.8.2", features = ["transport", "tls"] }
prometheus = "0.13.3"
multiaddr = "0.17.1"
fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "c961a01596a87e76f590c7e43aca9d57106dbbb1" }
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
tempfile.workspace = true
2 changes: 1 addition & 1 deletion core/dack-aggregator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ affair.workspace = true
tracing.workspace = true
resolved-pathbuf.workspace = true
queue-file = "1.4.10"
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
lightning-test-utils = { path = "../test-utils" }
Expand Down
2 changes: 1 addition & 1 deletion core/e2e/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ fleek-blake3 = "1.5"
toml = "0.7"
resolve-path = "0.1.0"
clap = { version = "4.2", features = ["derive"] }
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true
2 changes: 1 addition & 1 deletion core/fetcher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tracing.workspace = true
tokio-stream.workspace = true
bytes.workspace = true
thiserror = "1.0"
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
lightning-blockstore = { path = "../blockstore" }
Expand Down
2 changes: 1 addition & 1 deletion core/final-bindings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ toml = "0.7"
anyhow.workspace = true
resolved-pathbuf.workspace = true
tracing.workspace = true
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[features]
default = []
Expand Down
2 changes: 1 addition & 1 deletion core/firewall/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true
tower = "0.4.13"
tokio.workspace = true
thiserror.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion core/forwarder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ rand = "0.8.5"
# These dependencies MUST be pinned to the same versions used by `lightning-consensus`
narwhal-types = { git = "https://github.com/MystenLabs/sui.git", rev = "b06ada015694890d7c46347b13fbc3e9a763513c", package = "narwhal-types" }
tonic = { version = "0.8.3", features = ["transport", "tls"] }
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
lightning-test-utils = { path = "../test-utils" }
2 changes: 1 addition & 1 deletion core/handshake/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ serde_json.workspace = true
cid.workspace = true
hex = "0.4"
url = { version = "2.5.0", features = ["serde"] }
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
criterion = { version = "0.5.0", features = ["html_reports", "async_tokio"] }
Expand Down
2 changes: 1 addition & 1 deletion core/indexer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tokio.workspace = true
tracing.workspace = true

lightning-interfaces = { path = "../interfaces" }
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
lightning-test-utils = { path = "../test-utils" }
Expand Down
2 changes: 1 addition & 1 deletion core/interfaces/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ better-shutdown.workspace = true

# Currently we need the SDK because of the FFI types.
fn-sdk = { path = "../../lib/sdk" }
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
criterion = { version = "0.5.0", features = ["html_reports"] }
Expand Down
2 changes: 1 addition & 1 deletion core/keystore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ serde.workspace = true
tracing.workspace = true
resolved-pathbuf.workspace = true
triomphe = "0.1"
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
lightning-test-utils = { path = "../test-utils" }
2 changes: 1 addition & 1 deletion core/metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ once_cell = "1.18.0"
prometheus = "0.13.3"
stdext = "0.3.1"
tokio.workspace = true
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true
2 changes: 1 addition & 1 deletion core/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ tokio.workspace = true
tracing.workspace = true
anyhow.workspace = true
thread-local-panic-hook = "0.1.0"
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true
2 changes: 1 addition & 1 deletion core/notifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ lightning-utils = { path = "../utils" }
tokio.workspace = true
anyhow.workspace = true
futures.workspace = true
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
lightning-application = { path = "../application", features = ["test"] }
4 changes: 2 additions & 2 deletions core/origin-arweave/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
lightning-interfaces = {path="../interfaces"}
lightning-interfaces = { path = "../interfaces" }
anyhow.workspace = true
serde.workspace = true
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true
2 changes: 1 addition & 1 deletion core/origin-demuxer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ lightning-origin-http = { path = "../origin-http" }
serde.workspace = true
tokio.workspace = true
tracing.workspace = true
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
fleek-crypto.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions core/origin-filecoin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
lightning-interfaces = {path="../interfaces"}
lightning-interfaces = { path = "../interfaces" }
anyhow.workspace = true
serde.workspace = true
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true
2 changes: 1 addition & 1 deletion core/origin-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ lightning-interfaces = { path = "../interfaces" }
reqwest = { version = "0.11", features = ["rustls-tls"] }
serde.workspace = true
url = "2.5.0"
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
fleek-crypto.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion core/origin-ipfs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ tracing.workspace = true
unsigned-varint = { version = "0.8", features = ["std"] }
libipld = { version = "0.16", features = ["dag-cbor", "derive"] }
thiserror = "1"
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
fleek-crypto.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion core/pinger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ humantime-serde.workspace = true
rand.workspace = true
tracing.workspace = true
fleek-crypto.workspace = true
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
lightning-test-utils = { path = "../test-utils" }
Expand Down
2 changes: 1 addition & 1 deletion core/pool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ thiserror = "1.0"
webpki = { version = "0.22", features = ["std"] }
x509-parser = "0.15.1"
serde_json = "1.0"
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
lightning-test-utils = { path = "../test-utils" }
Expand Down
2 changes: 1 addition & 1 deletion core/rep-collector/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tokio.workspace = true
lru.workspace = true
scc.workspace = true
tracing.workspace = true
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
lightning-test-utils = { path = "../test-utils" }
Expand Down
7 changes: 3 additions & 4 deletions core/reputation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
lightning-interfaces = {path="../interfaces"}
lightning-interfaces = { path = "../interfaces" }
fleek-crypto.workspace = true
hp-fixed.workspace = true
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
lightning-test-utils = {path="../test-utils"}
lightning-test-utils = { path = "../test-utils" }
rand.workspace = true

2 changes: 1 addition & 1 deletion core/resolver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resolved-pathbuf.workspace = true
serde.workspace = true
tokio.workspace = true
rocksdb = "0.21"
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
lightning-test-utils = { path = "../test-utils" }
Expand Down
2 changes: 1 addition & 1 deletion core/rpc-openrpc-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ quote = "1.0.33"
syn = { version = "1.0.104", features = ["full", "derive", "extra-traits"] }
unescape = "0.1.0"
lightning-openrpc = { path = "../rpc-openrpc" }
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true
2 changes: 1 addition & 1 deletion core/rpc-openrpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ schemars = "0.8.16"
serde.workspace = true
serde_json.workspace = true
versions = "5.0.1"
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true
2 changes: 1 addition & 1 deletion core/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ alloy-primitives = "0.5.2"
resolved-pathbuf = { path = "../../lib/resolved-pathbuf" }

futures.workspace = true
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true
sha2 = "0.10.8"
hmac = "0.12.1"
rand.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion core/schema/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ lightning-types.workspace = true
bytes = "1.5"
arrayref = "0.3"
flexbuffers = "2.0"
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true
2 changes: 1 addition & 1 deletion core/service-executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ bincode = "1.3.3"
fleek-service-fetcher = { path = "../../services/fetcher", optional = true }
fleek-service-js-poc = { path = "../../services/js-poc", optional = true }
fleek-service-ai = { path = "../../services/ai", optional = true }
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[features]
default = []
Expand Down
2 changes: 1 addition & 1 deletion core/signer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tokio.workspace = true
fleek-crypto.workspace = true
affair.workspace = true
resolved-pathbuf.workspace = true
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
lightning-test-utils = { path = "../test-utils" }
Expand Down
2 changes: 1 addition & 1 deletion core/syncronizer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ tokio.workspace = true
rand.workspace = true
fleek-crypto.workspace = true
async-channel = "2.2"
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true
2 changes: 1 addition & 1 deletion core/test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ rand_distr = "0.4"
rand_chacha = "0.3"
resolved-pathbuf = { path = "../../lib/resolved-pathbuf" }
tui-logger = "0.11"
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true
lazy_static.workspace = true
2 changes: 1 addition & 1 deletion core/topology/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ serde = { version = "1.0", features = ["derive"] }
fleek-crypto.workspace = true
tracing.workspace = true
tokio.workspace = true
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true

[dev-dependencies]
lightning-application = { path = "../application" }
Expand Down
2 changes: 1 addition & 1 deletion core/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ ethers.workspace = true
ruint = "1.11.1"
url = "2.5.0"
compile-time-run = "0.2.12"
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true
4 changes: 2 additions & 2 deletions core/utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ serde_json.workspace = true
reqwest.workspace = true
resolved-pathbuf.workspace = true
toml = "0.7"
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
lazy_static.workspace = true
workspace-hack.workspace = true
lazy_static.workspace = true
2 changes: 1 addition & 1 deletion services/ai/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tracing.workspace = true
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tokio.workspace = true
url = "2.5.0"
workspace-hack = { version = "0.1", path = "../../etc/workspace-hack" }
workspace-hack.workspace = true
lightning-utils = { path = "../../core/utils" }
lazy_static.workspace = true

Expand Down
Loading

0 comments on commit 504659c

Please sign in to comment.