Skip to content

Commit

Permalink
fix: openssl is compiled twice, once not vendored in linux
Browse files Browse the repository at this point in the history
It’s broken since the workspace-hack change (#12961).

Openssl-sys is compiled twice on Linux, because features are not unified.

The one for build-dependency doesn’t have openssl-sys feature. It’s depended by tls-native, which is depended by sql-x, which is build-dependency in workspace-hack. (Since we didn't configure hakari to unify target os-specific dependencies, hakari unified it only *partialy*, and this cause them unnecessarily compiled twice.)

Simply put, it’s now a build-dependency so
- Feature is not unified. This can be fixed easily and is done in this PR.
- It will be compiled twice in release mode. Unless #12362, but it’s broken. Not a large problem(? Well, I’m not sure But it has been so). Just slower…

This only happens on linux, but not mac, because native-tls works differently for different os.

Temporary workaround this by manually unify feature in workspace-config to unblock daily pipeline and stuff. Later, we might delete [build-dependencies] for docker/release. Or completely get rid of workspace-hack.

TLDR: After this change, on Linux openssl is compiled once in debug mode, and still twice in release mode. Both once on mac.
  • Loading branch information
xxchan committed Oct 23, 2023
1 parent abafae0 commit 18adafb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/utils/workspace-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@ zstd-sys = { version = "2", optional = true, default-features = false, features
# 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.92", optional = true, features = ["vendored"] }

[lints]
workspace = true

0 comments on commit 18adafb

Please sign in to comment.