Skip to content

Commit

Permalink
chore: make --features static-link more static (#15754)
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
Co-authored-by: Huangjw <[email protected]>
  • Loading branch information
BugenZhao and huangjw806 authored Mar 19, 2024
1 parent a4b1f79 commit 6bd10ab
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 39 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ opentelemetry = "0.21"
opentelemetry-otlp = "0.14"
opentelemetry_sdk = { version = "0.21", default-features = false }
opentelemetry-semantic-conventions = "0.13"
sea-orm = { version = "0.12.14", features = [
"sqlx-mysql",
"sqlx-postgres",
"sqlx-sqlite",
"runtime-tokio-native-tls",
] }
tokio-util = "0.7"
tracing-opentelemetry = "0.22"

Expand Down
4 changes: 2 additions & 2 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1074,8 +1074,8 @@ script = """
echo "Running $(tput setaf 4)cargo sort$(tput sgr0) checks and attempting to fix"
# Rewriting Cargo.toml will cause a full rebuild of all crates, so we always check before fix.
(cargo sort -w -c > /dev/null) || cargo sort -w
test $? -eq 0 || { echo "cargo sort check failed. You may run $(tput setaf 4)cargo sort -w$(tput sgr0) to fix it."; exit 1; }
(cargo sort -g -w -c > /dev/null) || cargo sort -g -w
test $? -eq 0 || { echo "cargo sort check failed. You may run $(tput setaf 4)cargo sort -g -w$(tput sgr0) to fix it."; exit 1; }
"""

[tasks.check-fmt]
Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if [[ "$profile" != "ci-dev" ]] && [[ "$profile" != "ci-release" ]]; then
fi

echo "--- Rust cargo-sort check"
cargo sort --check --workspace
cargo sort --check --workspace --grouped

echo "--- Rust cargo-hakari check"
cargo hakari generate --diff
Expand Down
8 changes: 1 addition & 7 deletions src/meta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,7 @@ risingwave_rpc_client = { workspace = true }
risingwave_sqlparser = { workspace = true }
rw_futures_util = { workspace = true }
scopeguard = "1.2.0"
sea-orm = { version = "0.12.14", features = [
"sqlx-mysql",
"sqlx-postgres",
"sqlx-sqlite",
"runtime-tokio-native-tls",
"macros",
] }
sea-orm = { workspace = true }
serde = { version = "1.0.196", features = ["derive"] }
serde_json = "1.0.113"
strum = { version = "0.25", features = ["derive"] }
Expand Down
8 changes: 1 addition & 7 deletions src/meta/model_v2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ prost = { workspace = true }
risingwave_common = { workspace = true }
risingwave_hummock_sdk = { workspace = true }
risingwave_pb = { workspace = true }
sea-orm = { version = "0.12.14", features = [
"sqlx-mysql",
"sqlx-postgres",
"sqlx-sqlite",
"runtime-tokio-native-tls",
"macros",
] }
sea-orm = { workspace = true }
serde = { version = "1.0.196", features = ["derive"] }
serde_json = "1.0.113"
8 changes: 1 addition & 7 deletions src/meta/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,7 @@ risingwave_meta_model_migration = { workspace = true }
risingwave_meta_service = { workspace = true }
risingwave_pb = { workspace = true }
risingwave_rpc_client = { workspace = true }
sea-orm = { version = "0.12.14", features = [
"sqlx-mysql",
"sqlx-postgres",
"sqlx-sqlite",
"runtime-tokio-native-tls",
"macros",
] }
sea-orm = { workspace = true }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror-ext = { workspace = true }
Expand Down
8 changes: 1 addition & 7 deletions src/meta/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,7 @@ risingwave_hummock_sdk = { workspace = true }
risingwave_meta = { workspace = true }
risingwave_meta_model_v2 = { workspace = true }
risingwave_pb = { workspace = true }
sea-orm = { version = "0.12.14", features = [
"sqlx-mysql",
"sqlx-postgres",
"sqlx-sqlite",
"runtime-tokio-native-tls",
"macros",
] }
sea-orm = { workspace = true }
sync-point = { path = "../../utils/sync-point" }
thiserror-ext = { workspace = true }
tokio = { version = "0.2", package = "madsim-tokio", features = [
Expand Down
20 changes: 12 additions & 8 deletions src/utils/workspace-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,26 @@ repository = { workspace = true }
[features]
# some crates opt-in static linking, while some opt-in dynamic linking,
# so they are two features :)
rw-static-link = ["openssl-sys", "sasl2-sys"]
rw-dynamic-link = ["zstd-sys"]
rw-static-link = ["static-libz-sys", "static-lzma-sys", "static-openssl-sys", "static-sasl2-sys"]
rw-dynamic-link = ["dynamic-zstd-sys"]

[dependencies]
# Disable verbose logs for release builds
log = { version = "0.4", features = ["release_max_level_debug"] }
openssl-sys = { version = "0.9.96", optional = true, features = ["vendored"] }
sasl2-sys = { version = "0.1", optional = true, features = ["gssapi-vendored"] }
tracing = { version = "0.1", features = ["release_max_level_debug"] }
zstd-sys = { version = "2", optional = true, default-features = false, features = ["pkg-config"] }

# Static linking
static-libz-sys = { package = "libz-sys", version = "1", optional = true, features = ["static"] }
static-lzma-sys = { package = "lzma-sys", version = "0.1", optional = true, features = ["static"] }
static-openssl-sys = { package = "openssl-sys", version = "0.9.96", optional = true, features = ["vendored"] }
static-sasl2-sys = { package = "sasl2-sys", version = "0.1", optional = true, features = ["gssapi-vendored"] }

# Dynamic linking
dynamic-zstd-sys = { package = "zstd-sys", version = "2", optional = true, default-features = false, features = ["pkg-config"] }
# workspace-hack = { path = "../../workspace-hack" }
# Don't add workspace-hack into this crate!

# FIXME(xxchan): This is a temporary fix due to how cargo and hakari works. See related PR for more details.
# We will revisit how to handle workspace-hack and build-dependency issues later.
[build-dependencies]
openssl-sys = { version = "0.9.96", optional = true, features = ["vendored"] }

[lints]
workspace = true

0 comments on commit 6bd10ab

Please sign in to comment.