Skip to content

build: make dynamic linking opt-in instead of default #9626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 11, 2023
Merged

Conversation

xxchan
Copy link
Member

@xxchan xxchan commented May 5, 2023

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

  • It seems dynamic linking still needs configuration (especially OpenSSL), so it might be better to static link by default.
  • Still dynamic linking in CI debug build. It's 30s faster

Checklist For Contributors

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • I have demonstrated that backward compatibility is not broken by breaking changes and created issues to track deprecated features to be removed in the future. (Please refer to the issue)
  • All checks passed in ./risedev check (or alias, ./risedev c)

Checklist For Reviewers

  • I have requested macro/micro-benchmarks as this PR can affect performance substantially, and the results are shown.

Documentation

  • My PR DOES NOT contain user-facing changes.
Click here for Documentation

Types of user-facing changes

Please keep the types that apply to your changes, and remove the others.

  • Installation and deployment
  • Connector (sources & sinks)
  • SQL commands, functions, and operators
  • RisingWave cluster configuration changes
  • Other (please specify in the release note below)

Release note

@xxchan xxchan requested a review from BugenZhao May 5, 2023 16:06
Comment on lines -88 to +87
sudo apt install make build-essential cmake protobuf-compiler curl openssl libssl-dev libsasl2-dev libcurl4-openssl-dev pkg-config postgresql-client tmux lld libzstd-dev
sudo apt install make build-essential cmake protobuf-compiler curl openssl libssl-dev libsasl2-dev libcurl4-openssl-dev pkg-config postgresql-client tmux lld
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think more can be removed, but I'm not brave enough to do it. 😅

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this can be aligned with ci/Dockerfile. 👀

Copy link
Member Author

@xxchan xxchan May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving to a different crate so that it compiles fast & won't fail.

@codecov
Copy link

codecov bot commented May 5, 2023

Codecov Report

Merging #9626 (118ab1e) into main (f512021) will decrease coverage by 0.22%.
The diff coverage is 0.00%.

❗ Current head 118ab1e differs from pull request most recent head 0914f1f. Consider uploading reports for the commit 0914f1f to get more accurate results

@@            Coverage Diff             @@
##             main    #9626      +/-   ##
==========================================
- Coverage   70.99%   70.77%   -0.22%     
==========================================
  Files        1245     1233      -12     
  Lines      208372   206790    -1582     
==========================================
- Hits       147927   146353    -1574     
+ Misses      60445    60437       -8     
Flag Coverage Δ
rust 70.77% <0.00%> (-0.22%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/risedevtool/config/src/main.rs 0.40% <0.00%> (ø)

... and 212 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Makefile.toml Outdated
set_env ENABLE_TELEMETRY "false"

is_sanitizer_enabled = get_env ENABLE_SANITIZER
is_all_in_one_enabled = get_env ENABLE_ALL_IN_ONE
is_hdfs_backend = get_env ENABLE_HDFS
is_release = get_env ENABLE_RELEASE_PROFILE
is_release = set ${is_release} or false
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines -332 to +343
--features "${RISINGWAVE_FEATURES}" \
${RISINGWAVE_FEATURE_FLAGS} \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered make rw-static-link default feature, and add --no-default-features for dynamic linking. But not sure.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both LGTM as long as we handle and hide all this stuff in RiseDev. 🤣

Comment on lines -18 to +20
openssl = { version = "0.10", optional = true, features = ["vendored"] }
rdkafka = { workspace = true, optional = true, features = ["cmake-build", "ssl-vendored", "gssapi-vendored"] }
openssl-sys = { version = "0.9", optional = true, features = ["vendored"] }
sasl2-sys = { version = "0.1", optional = true, features = ["gssapi-vendored"] }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if any crate enabled vendored ssl, the eventual result is enabling openssl-sys/vendored. So I just use its own feature here to be more transparent.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -9,14 +9,15 @@ repository = { workspace = true }
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
# Use a feature flag to control enable or not, otherwise `cargo test` will compile all dependencies.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t understand the comment, so removed 😅

@@ -49,6 +54,12 @@ else
set_env BUILD_HDFS_BACKEND_CMD ""
end

if ${is_not_release} and ${is_dynamic_linking}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: if not ${is_release} and ${is_dynamic_linking} doesn't work. sagiegurari/duckscript#326

@xxchan xxchan mentioned this pull request May 9, 2023
2 tasks
@xxchan xxchan enabled auto-merge May 10, 2023 12:30
@xxchan
Copy link
Member Author

xxchan commented May 10, 2023

@BugenZhao request approval

@xxchan xxchan requested a review from TennyZhuang May 10, 2023 13:10
Copy link
Member

@BugenZhao BugenZhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@xxchan xxchan added this pull request to the merge queue May 11, 2023
Merged via the queue into main with commit d2fe694 May 11, 2023
@xxchan xxchan deleted the xxchan/ancient-fowl branch May 11, 2023 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants