Skip to content

Commit

Permalink
feat(build): disable vendored openssl (#16761)
Browse files Browse the repository at this point in the history
Signed-off-by: Runji Wang <[email protected]>
  • Loading branch information
wangrunji0408 authored May 23, 2024
1 parent f0b4b7b commit eb6ca34
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 24 deletions.
11 changes: 0 additions & 11 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions ci/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ if [[ "$profile" == "ci-dev" ]]; then
RISINGWAVE_FEATURE_FLAGS=(--features rw-dynamic-link --no-default-features)
else
RISINGWAVE_FEATURE_FLAGS=(--features rw-static-link)
export OPENSSL_STATIC=1
fi

cargo build \
Expand Down
6 changes: 3 additions & 3 deletions ci/scripts/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ sccache --show-stats
sccache --zero-stats

echo "--- Run clippy check (release)"
cargo clippy --release --all-targets --features "rw-static-link" --locked -- -D warnings
OPENSSL_STATIC=1 cargo clippy --release --all-targets --features "rw-static-link" --locked -- -D warnings

echo "--- Run cargo check on building the release binary (release)"
cargo check -p risingwave_cmd_all --features "rw-static-link" --profile release
cargo check -p risingwave_cmd --bin risectl --features "rw-static-link" --profile release
OPENSSL_STATIC=1 cargo check -p risingwave_cmd_all --features "rw-static-link" --profile release
OPENSSL_STATIC=1 cargo check -p risingwave_cmd --bin risectl --features "rw-static-link" --profile release

echo "--- Show sccache stats"
sccache --show-stats
Expand Down
4 changes: 2 additions & 2 deletions ci/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ if [ "${ARCH}" == "aarch64" ]; then
# see https://github.com/tikv/jemallocator/blob/802969384ae0c581255f3375ee2ba774c8d2a754/jemalloc-sys/build.rs#L218
export JEMALLOC_SYS_WITH_LG_PAGE=16
fi
cargo build -p risingwave_cmd_all --features "rw-static-link" --features external-udf --features wasm-udf --features js-udf --profile release
cargo build -p risingwave_cmd --bin risectl --features "rw-static-link" --profile release
OPENSSL_STATIC=1 cargo build -p risingwave_cmd_all --features "rw-static-link" --features external-udf --features wasm-udf --features js-udf --profile release
OPENSSL_STATIC=1 cargo build -p risingwave_cmd --bin risectl --features "rw-static-link" --profile release
cd target/release && chmod +x risingwave risectl

echo "--- Upload nightly binary to s3"
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ COPY ./ /risingwave
WORKDIR /risingwave

ENV ENABLE_BUILD_DASHBOARD=1
ENV OPENSSL_STATIC=1

RUN cargo fetch && \
cargo build -p risingwave_cmd_all --release --features "rw-static-link" --features all-udf && \
Expand Down
2 changes: 2 additions & 0 deletions docker/Dockerfile.hdfs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ ARG JAVA_HOME_PATH
ENV JAVA_HOME ${JAVA_HOME_PATH}
ENV LD_LIBRARY_PATH ${JAVA_HOME_PATH}/lib/server:${LD_LIBRARY_PATH}

ENV OPENSSL_STATIC=1

RUN cargo fetch && \
cargo build -p risingwave_cmd_all --release -p risingwave_object_store --features hdfs-backend --features "rw-static-link" --features all-udf && \
mkdir -p /risingwave/bin && \
Expand Down
3 changes: 2 additions & 1 deletion docs/developer-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ RiseDev is the development mode of RisingWave. To develop RisingWave, you need t
* Rust toolchain
* CMake
* protobuf (>= 3.12.0)
* OpenSSL (>= 3)
* PostgreSQL (psql) (>= 14.1)
* Tmux (>= v3.2a)
* LLVM 16 (For macOS only, to workaround some bugs in macOS toolchain. See https://github.com/risingwavelabs/risingwave/issues/6205)
Expand All @@ -80,7 +81,7 @@ RiseDev is the development mode of RisingWave. To develop RisingWave, you need t
To install the dependencies on macOS, run:

```shell
brew install postgresql cmake protobuf tmux cyrus-sasl llvm
brew install postgresql cmake protobuf tmux cyrus-sasl llvm openssl@3
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

Expand Down
5 changes: 1 addition & 4 deletions src/connector/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,7 @@ pulsar = { version = "6.2", default-features = false, features = [
] }
rdkafka = { workspace = true, features = [
"cmake-build",
# "ssl",
# FIXME: temporary workaround before we find an ideal solution.
# See why it's needed and why it's not ideal in https://github.com/risingwavelabs/risingwave/issues/9852
"ssl-vendored",
"ssl",
"gssapi",
"zstd",
] }
Expand Down
2 changes: 1 addition & 1 deletion src/expr/impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ linkme = { version = "0.3", features = ["used_linker"] }
md5 = "0.7"
moka = { version = "0.12", features = ["sync"] }
num-traits = "0.2"
openssl = { version = "0.10", features = ["vendored"] }
openssl = "0.10"
regex = "1"
risingwave_common = { workspace = true }
risingwave_common_estimate_size = { workspace = true }
Expand Down
3 changes: 1 addition & 2 deletions src/utils/workspace-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository = { workspace = true }
[features]
# some crates opt-in static linking, while some opt-in dynamic linking,
# so they are two features :)
rw-static-link = ["static-libz-sys", "static-lzma-sys", "static-openssl-sys", "static-sasl2-sys"]
rw-static-link = ["static-libz-sys", "static-lzma-sys", "static-sasl2-sys"]
rw-dynamic-link = ["dynamic-zstd-sys"]

[dependencies]
Expand All @@ -22,7 +22,6 @@ tracing = { version = "0.1", features = ["release_max_level_debug"] }
# 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
Expand Down

0 comments on commit eb6ca34

Please sign in to comment.