mirror of
https://github.com/neondatabase/neon.git
synced 2025-12-22 21:59:59 +00:00
use cargo-hakari to manage workspace_hack crate
workspace_hack is needed to avoid recompilation when different crates inside the workspace depend on the same packages but with different features being enabled. Problem occurs when you build crates separately one by one. So this is irrelevant to our CI setup because there we build all binaries at once, but it may be relevant for local development. this also changes cargo's resolver version to 2
This commit is contained in:
committed by
Dmitry Rodionov
parent
fd78110c2b
commit
eee0f51e0c
24
.config/hakari.toml
Normal file
24
.config/hakari.toml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# This file contains settings for `cargo hakari`.
|
||||||
|
# See https://docs.rs/cargo-hakari/latest/cargo_hakari/config for a full list of options.
|
||||||
|
|
||||||
|
hakari-package = "workspace_hack"
|
||||||
|
|
||||||
|
# Format for `workspace-hack = ...` lines in other Cargo.tomls. Requires cargo-hakari 0.9.8 or above.
|
||||||
|
dep-format-version = "2"
|
||||||
|
|
||||||
|
# Setting workspace.resolver = "2" in the root Cargo.toml is HIGHLY recommended.
|
||||||
|
# Hakari works much better with the new feature resolver.
|
||||||
|
# For more about the new feature resolver, see:
|
||||||
|
# https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#cargos-new-feature-resolver
|
||||||
|
resolver = "2"
|
||||||
|
|
||||||
|
# Add triples corresponding to platforms commonly used by developers here.
|
||||||
|
# https://doc.rust-lang.org/rustc/platform-support.html
|
||||||
|
platforms = [
|
||||||
|
# "x86_64-unknown-linux-gnu",
|
||||||
|
# "x86_64-apple-darwin",
|
||||||
|
# "x86_64-pc-windows-msvc",
|
||||||
|
]
|
||||||
|
|
||||||
|
# Write out exact versions rather than a semver range. (Defaults to false.)
|
||||||
|
# exact-versions = true
|
||||||
15
Cargo.lock
generated
15
Cargo.lock
generated
@@ -407,6 +407,7 @@ dependencies = [
|
|||||||
"serde_json",
|
"serde_json",
|
||||||
"tar",
|
"tar",
|
||||||
"tokio",
|
"tokio",
|
||||||
|
"workspace_hack",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1803,6 +1804,7 @@ dependencies = [
|
|||||||
"tokio-postgres 0.7.1 (git+https://github.com/zenithdb/rust-postgres.git?rev=2949d98df52587d562986aad155dd4e889e408b7)",
|
"tokio-postgres 0.7.1 (git+https://github.com/zenithdb/rust-postgres.git?rev=2949d98df52587d562986aad155dd4e889e408b7)",
|
||||||
"tokio-postgres-rustls",
|
"tokio-postgres-rustls",
|
||||||
"tokio-rustls 0.22.0",
|
"tokio-rustls 0.22.0",
|
||||||
|
"workspace_hack",
|
||||||
"zenith_metrics",
|
"zenith_metrics",
|
||||||
"zenith_utils",
|
"zenith_utils",
|
||||||
]
|
]
|
||||||
@@ -3041,7 +3043,14 @@ dependencies = [
|
|||||||
name = "workspace_hack"
|
name = "workspace_hack"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
|
"bytes",
|
||||||
|
"cc",
|
||||||
|
"clap 2.34.0",
|
||||||
|
"either",
|
||||||
|
"hashbrown 0.11.2",
|
||||||
"libc",
|
"libc",
|
||||||
|
"log",
|
||||||
"memchr",
|
"memchr",
|
||||||
"num-integer",
|
"num-integer",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
@@ -3049,8 +3058,13 @@ dependencies = [
|
|||||||
"quote",
|
"quote",
|
||||||
"regex",
|
"regex",
|
||||||
"regex-syntax",
|
"regex-syntax",
|
||||||
|
"reqwest",
|
||||||
|
"scopeguard",
|
||||||
"serde",
|
"serde",
|
||||||
"syn",
|
"syn",
|
||||||
|
"tokio",
|
||||||
|
"tracing",
|
||||||
|
"tracing-core",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -3101,6 +3115,7 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"prometheus",
|
"prometheus",
|
||||||
|
"workspace_hack",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ members = [
|
|||||||
"zenith_metrics",
|
"zenith_metrics",
|
||||||
"zenith_utils",
|
"zenith_utils",
|
||||||
]
|
]
|
||||||
|
resolver = "2"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
# This is useful for profiling and, to some extent, debug.
|
# This is useful for profiling and, to some extent, debug.
|
||||||
|
|||||||
@@ -17,3 +17,4 @@ serde = { version = "1.0", features = ["derive"] }
|
|||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
tar = "0.4"
|
tar = "0.4"
|
||||||
tokio = { version = "1", features = ["macros", "rt", "rt-multi-thread"] }
|
tokio = { version = "1", features = ["macros", "rt", "rt-multi-thread"] }
|
||||||
|
workspace_hack = { version = "0.1", path = "../workspace_hack" }
|
||||||
|
|||||||
@@ -20,4 +20,4 @@ reqwest = { version = "0.11", default-features = false, features = ["blocking",
|
|||||||
pageserver = { path = "../pageserver" }
|
pageserver = { path = "../pageserver" }
|
||||||
walkeeper = { path = "../walkeeper" }
|
walkeeper = { path = "../walkeeper" }
|
||||||
zenith_utils = { path = "../zenith_utils" }
|
zenith_utils = { path = "../zenith_utils" }
|
||||||
workspace_hack = { path = "../workspace_hack" }
|
workspace_hack = { version = "0.1", path = "../workspace_hack" }
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ For more detailed info, see `/walkeeper/README`
|
|||||||
`/workspace_hack`:
|
`/workspace_hack`:
|
||||||
The workspace_hack crate exists only to pin down some dependencies.
|
The workspace_hack crate exists only to pin down some dependencies.
|
||||||
|
|
||||||
|
We use [cargo-hakari](https://crates.io/crates/cargo-hakari) for automation.
|
||||||
|
|
||||||
`/zenith`
|
`/zenith`
|
||||||
|
|
||||||
Main entry point for the 'zenith' CLI utility.
|
Main entry point for the 'zenith' CLI utility.
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ async-compression = {version = "0.3", features = ["zstd", "tokio"]}
|
|||||||
postgres_ffi = { path = "../postgres_ffi" }
|
postgres_ffi = { path = "../postgres_ffi" }
|
||||||
zenith_metrics = { path = "../zenith_metrics" }
|
zenith_metrics = { path = "../zenith_metrics" }
|
||||||
zenith_utils = { path = "../zenith_utils" }
|
zenith_utils = { path = "../zenith_utils" }
|
||||||
workspace_hack = { path = "../workspace_hack" }
|
workspace_hack = { version = "0.1", path = "../workspace_hack" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
hex-literal = "0.3"
|
hex-literal = "0.3"
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ log = "0.4.14"
|
|||||||
memoffset = "0.6.2"
|
memoffset = "0.6.2"
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
workspace_hack = { path = "../workspace_hack" }
|
|
||||||
zenith_utils = { path = "../zenith_utils" }
|
zenith_utils = { path = "../zenith_utils" }
|
||||||
|
workspace_hack = { version = "0.1", path = "../workspace_hack" }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
bindgen = "0.59.1"
|
bindgen = "0.59.1"
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ tokio-rustls = "0.22.0"
|
|||||||
|
|
||||||
zenith_utils = { path = "../zenith_utils" }
|
zenith_utils = { path = "../zenith_utils" }
|
||||||
zenith_metrics = { path = "../zenith_metrics" }
|
zenith_metrics = { path = "../zenith_metrics" }
|
||||||
|
workspace_hack = { version = "0.1", path = "../workspace_hack" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tokio-postgres-rustls = "0.8.0"
|
tokio-postgres-rustls = "0.8.0"
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ const_format = "0.2.21"
|
|||||||
tokio-postgres = { git = "https://github.com/zenithdb/rust-postgres.git", rev="2949d98df52587d562986aad155dd4e889e408b7" }
|
tokio-postgres = { git = "https://github.com/zenithdb/rust-postgres.git", rev="2949d98df52587d562986aad155dd4e889e408b7" }
|
||||||
|
|
||||||
postgres_ffi = { path = "../postgres_ffi" }
|
postgres_ffi = { path = "../postgres_ffi" }
|
||||||
workspace_hack = { path = "../workspace_hack" }
|
|
||||||
zenith_metrics = { path = "../zenith_metrics" }
|
zenith_metrics = { path = "../zenith_metrics" }
|
||||||
zenith_utils = { path = "../zenith_utils" }
|
zenith_utils = { path = "../zenith_utils" }
|
||||||
|
workspace_hack = { version = "0.1", path = "../workspace_hack" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tempfile = "3.2"
|
tempfile = "3.2"
|
||||||
|
|||||||
@@ -1,22 +1,50 @@
|
|||||||
|
# This file is generated by `cargo hakari`.
|
||||||
|
# To regenerate, run:
|
||||||
|
# cargo hakari generate
|
||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "workspace_hack"
|
name = "workspace_hack"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
description = "workspace-hack package, managed by hakari"
|
||||||
|
# You can choose to publish this crate: see https://docs.rs/cargo-hakari/latest/cargo_hakari/publishing.
|
||||||
|
publish = false
|
||||||
|
|
||||||
[target.'cfg(all())'.dependencies]
|
# The parts of the file between the BEGIN HAKARI SECTION and END HAKARI SECTION comments
|
||||||
libc = { version = "0.2", features = ["default", "extra_traits", "std"] }
|
# are managed by hakari.
|
||||||
memchr = { version = "2", features = ["default", "std", "use_std"] }
|
|
||||||
|
### BEGIN HAKARI SECTION
|
||||||
|
[dependencies]
|
||||||
|
anyhow = { version = "1", features = ["backtrace", "std"] }
|
||||||
|
bytes = { version = "1", features = ["serde", "std"] }
|
||||||
|
clap = { version = "2", features = ["ansi_term", "atty", "color", "strsim", "suggestions", "vec_map"] }
|
||||||
|
either = { version = "1", features = ["use_std"] }
|
||||||
|
hashbrown = { version = "0.11", features = ["ahash", "inline-more", "raw"] }
|
||||||
|
libc = { version = "0.2", features = ["extra_traits", "std"] }
|
||||||
|
log = { version = "0.4", default-features = false, features = ["serde", "std"] }
|
||||||
|
memchr = { version = "2", features = ["std", "use_std"] }
|
||||||
num-integer = { version = "0.1", default-features = false, features = ["std"] }
|
num-integer = { version = "0.1", default-features = false, features = ["std"] }
|
||||||
num-traits = { version = "0.2", default-features = false, features = ["std"] }
|
num-traits = { version = "0.2", features = ["std"] }
|
||||||
regex = { version = "1", features = ["aho-corasick", "default", "memchr", "perf", "perf-cache", "perf-dfa", "perf-inline", "perf-literal", "std", "unicode", "unicode-age", "unicode-bool", "unicode-case", "unicode-gencat", "unicode-perl", "unicode-script", "unicode-segment"] }
|
regex = { version = "1", features = ["aho-corasick", "memchr", "perf", "perf-cache", "perf-dfa", "perf-inline", "perf-literal", "std", "unicode", "unicode-age", "unicode-bool", "unicode-case", "unicode-gencat", "unicode-perl", "unicode-script", "unicode-segment"] }
|
||||||
regex-syntax = { version = "0.6", features = ["default", "unicode", "unicode-age", "unicode-bool", "unicode-case", "unicode-gencat", "unicode-perl", "unicode-script", "unicode-segment"] }
|
regex-syntax = { version = "0.6", features = ["unicode", "unicode-age", "unicode-bool", "unicode-case", "unicode-gencat", "unicode-perl", "unicode-script", "unicode-segment"] }
|
||||||
serde = { version = "1", features = ["default", "derive", "serde_derive", "std"] }
|
reqwest = { version = "0.11", default-features = false, features = ["__rustls", "__tls", "blocking", "hyper-rustls", "json", "rustls", "rustls-pemfile", "rustls-tls", "rustls-tls-webpki-roots", "serde_json", "stream", "tokio-rustls", "tokio-util", "webpki-roots"] }
|
||||||
|
scopeguard = { version = "1", features = ["use_std"] }
|
||||||
|
serde = { version = "1", features = ["alloc", "derive", "serde_derive", "std"] }
|
||||||
|
tokio = { version = "1", features = ["bytes", "fs", "io-util", "libc", "macros", "memchr", "mio", "net", "num_cpus", "once_cell", "process", "rt", "rt-multi-thread", "signal-hook-registry", "sync", "time", "tokio-macros"] }
|
||||||
|
tracing = { version = "0.1", features = ["attributes", "std", "tracing-attributes"] }
|
||||||
|
tracing-core = { version = "0.1", features = ["lazy_static", "std"] }
|
||||||
|
|
||||||
[target.'cfg(all())'.build-dependencies]
|
[build-dependencies]
|
||||||
libc = { version = "0.2", features = ["default", "extra_traits", "std"] }
|
cc = { version = "1", default-features = false, features = ["jobserver", "parallel"] }
|
||||||
memchr = { version = "2", features = ["default", "std", "use_std"] }
|
clap = { version = "2", features = ["ansi_term", "atty", "color", "strsim", "suggestions", "vec_map"] }
|
||||||
proc-macro2 = { version = "1", features = ["default", "proc-macro"] }
|
either = { version = "1", features = ["use_std"] }
|
||||||
quote = { version = "1", features = ["default", "proc-macro"] }
|
libc = { version = "0.2", features = ["extra_traits", "std"] }
|
||||||
regex = { version = "1", features = ["aho-corasick", "default", "memchr", "perf", "perf-cache", "perf-dfa", "perf-inline", "perf-literal", "std", "unicode", "unicode-age", "unicode-bool", "unicode-case", "unicode-gencat", "unicode-perl", "unicode-script", "unicode-segment"] }
|
log = { version = "0.4", default-features = false, features = ["serde", "std"] }
|
||||||
regex-syntax = { version = "0.6", features = ["default", "unicode", "unicode-age", "unicode-bool", "unicode-case", "unicode-gencat", "unicode-perl", "unicode-script", "unicode-segment"] }
|
memchr = { version = "2", features = ["std", "use_std"] }
|
||||||
syn = { version = "1", features = ["clone-impls", "default", "derive", "full", "parsing", "printing", "proc-macro", "quote", "visit", "visit-mut"] }
|
proc-macro2 = { version = "1", features = ["proc-macro"] }
|
||||||
|
quote = { version = "1", features = ["proc-macro"] }
|
||||||
|
regex = { version = "1", features = ["aho-corasick", "memchr", "perf", "perf-cache", "perf-dfa", "perf-inline", "perf-literal", "std", "unicode", "unicode-age", "unicode-bool", "unicode-case", "unicode-gencat", "unicode-perl", "unicode-script", "unicode-segment"] }
|
||||||
|
regex-syntax = { version = "0.6", features = ["unicode", "unicode-age", "unicode-bool", "unicode-case", "unicode-gencat", "unicode-perl", "unicode-script", "unicode-segment"] }
|
||||||
|
serde = { version = "1", features = ["alloc", "derive", "serde_derive", "std"] }
|
||||||
|
syn = { version = "1", features = ["clone-impls", "derive", "extra-traits", "full", "parsing", "printing", "proc-macro", "quote", "visit", "visit-mut"] }
|
||||||
|
|
||||||
|
### END HAKARI SECTION
|
||||||
|
|||||||
@@ -1,23 +1 @@
|
|||||||
//! This crate contains no code.
|
// This is a stub lib.rs.
|
||||||
//!
|
|
||||||
//! The workspace_hack crate exists only to pin down some dependencies,
|
|
||||||
//! so that those dependencies always build with the same features,
|
|
||||||
//! under a few different cases that can be problematic:
|
|
||||||
//! - Running `cargo check` or `cargo build` from a crate sub-directory
|
|
||||||
//! instead of the workspace root.
|
|
||||||
//! - Running `cargo install`, which can only be done per-crate
|
|
||||||
//!
|
|
||||||
//! The dependency lists in Cargo.toml were automatically generated by
|
|
||||||
//! a tool called
|
|
||||||
//! [Hakari](https://github.com/facebookincubator/cargo-guppy/tree/main/tools/hakari).
|
|
||||||
//!
|
|
||||||
//! Hakari doesn't have a CLI yet; in the meantime the example code in
|
|
||||||
//! their `README` file is enough to regenerate the dependencies.
|
|
||||||
//! Hakari's output was pasted into Cargo.toml, except for the
|
|
||||||
//! following manual edits:
|
|
||||||
//! - `winapi` dependency was removed. This is probably just due to the
|
|
||||||
//! fact that Hakari's target analysis is incomplete.
|
|
||||||
//!
|
|
||||||
//! There isn't any penalty to this data falling out of date; it just
|
|
||||||
//! means that under the conditions above Cargo will rebuild more
|
|
||||||
//! packages than strictly necessary.
|
|
||||||
|
|||||||
@@ -15,4 +15,4 @@ control_plane = { path = "../control_plane" }
|
|||||||
walkeeper = { path = "../walkeeper" }
|
walkeeper = { path = "../walkeeper" }
|
||||||
postgres_ffi = { path = "../postgres_ffi" }
|
postgres_ffi = { path = "../postgres_ffi" }
|
||||||
zenith_utils = { path = "../zenith_utils" }
|
zenith_utils = { path = "../zenith_utils" }
|
||||||
workspace_hack = { path = "../workspace_hack" }
|
workspace_hack = { version = "0.1", path = "../workspace_hack" }
|
||||||
|
|||||||
@@ -8,3 +8,4 @@ prometheus = {version = "0.13", default_features=false} # removes protobuf depen
|
|||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
lazy_static = "1.4"
|
lazy_static = "1.4"
|
||||||
once_cell = "1.8.0"
|
once_cell = "1.8.0"
|
||||||
|
workspace_hack = { version = "0.1", path = "../workspace_hack" }
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ git-version = "0.3.5"
|
|||||||
serde_with = "1.12.0"
|
serde_with = "1.12.0"
|
||||||
|
|
||||||
zenith_metrics = { path = "../zenith_metrics" }
|
zenith_metrics = { path = "../zenith_metrics" }
|
||||||
workspace_hack = { path = "../workspace_hack" }
|
workspace_hack = { version = "0.1", path = "../workspace_hack" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
byteorder = "1.4.3"
|
byteorder = "1.4.3"
|
||||||
|
|||||||
Reference in New Issue
Block a user