Skip to content

[MOD-19641] Link macOS builds against OpenSSL 4 - #11897

Merged
alonre24 merged 4 commits into
masterfrom
alon-mod-19641-openssl4
Oct 15, 2026
Merged

alonre24 merged 4 commits into
masterfrom
alon-mod-19641-openssl4

Conversation

@alonre24

@alonre24 alonre24 commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Describe the changes in the pull request

  1. Current: The Homebrew Redis package builds Redis core against OpenSSL 4, as homebrew-core does. RediSearch's macOS builds link openssl@3. The package therefore mixes OpenSSL major versions and fails to start when only openssl@4 is installed.
  2. Change: macOS builds (module, CI and packaging) link openssl@4 only, and CI builds Redis against it as well. A new CI step fails a macOS build if redisearch.so links libssl or libcrypto from anywhere other than openssl@4.
  3. Outcome: macOS artifacts load in a Homebrew Redis that ships only openssl@4. On Linux the module is unchanged, but all CI and benchmarks now run against a newer pinned Redis (see below).

Which additional issues this PR fixes

  1. MOD-19641

Main objects this PR modified

  1. macOS OpenSSL selection: .install/macos.sh, build/hiredis/hiredis.cmake (no longer hard-codes /usr/local/opt/openssl), and the root CMake file. CMake now looks only for openssl@4 and fails at configure time if the OpenSSL it finds is not major version 4. Before, it fell back silently to Homebrew's unversioned opt/openssl.
  2. Pinned Redis ref, used by all CI workflows, the benchmark defaults and .agents/setup. It moves 63 commits on unstable, to tls: replace deprecated X509_NAME_get_text_by_NID API redis/redis#15227. That commit replaces the tls.c call OpenSSL 4 deprecates, which is why [MOD-19076] Build Redis against OpenSSL 3 on macOS CI #11620 had pinned openssl@3. No single commit has that fix without the other 62. Among them are changes to module timers and the monotonic clock, ACL checks at EXEC, and RDB. Benchmark numbers taken before and after this merge are not comparable.
  3. runtests.sh adds --cluster_bus_port_protected_mode no to cluster runs whenever the redis-server binary supports it. The new ref includes Make an unauthenticated cluster bus port an explicit choice redis/redis#15722, which refuses a non-TLS cluster bus by default. CI used to waive that only for the literal unstable ref.
  4. New validate-openssl-linkage action, run after the macOS build in the test and artifact jobs.

Manual validation: PR CI doesn't run on macOS, so I dispatched macOS builds and flow tests (QUICK=1) by hand. All six artifacts (macos-14/15/26 × x86_64/arm64) link only .../openssl@4/lib/libssl.4.dylib and libcrypto.4.dylib. Redis builds with TLS on every platform. Flow-run links will follow in a comment.

On macOS x86_64, tag queries crash with a Rust misaligned-pointer panic in the trie pattern iterator. Unmodified master on macos-14 x86_64 crashes the same way, so the crash predates this PR and will be tracked separately.

Note for developers: an existing local build directory keeps the OpenSSL it cached at configure time. Rebuild with ./build.sh FORCE to pick up openssl@4.

Follow-ups, not in this PR: the Homebrew cask must declare openssl@4 as its run-time dependency, RedisTimeSeries needs the matching change, and release branches are not covered yet.

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

Release Notes

  • This PR requires release notes
  • This PR does not require release notes

If a release note is required (bug fix / new feature / enhancement), describe the user impact of this PR in the title.

🤖 Generated with Claude Code

The Homebrew Redis package now ships Redis core against openssl@4 (as
homebrew-core does), so the module must link the same major version.

- macOS setup installs openssl@4; CMake prefers it over openssl@3.
- CI builds Redis against openssl@4. Bump the pinned Redis ref to
  redis/redis#15227, which replaces the tls.c API OpenSSL 4 deprecates
  (it broke Redis's -Werror build, the reason for the openssl@3 pin).
- Drop the hard-coded /usr/local/opt/openssl from hiredis.cmake: it
  could pick a different OpenSSL than OPENSSL_ROOT_DIR.
- New CI check fails the macOS build if redisearch.so links any
  libssl/libcrypto outside openssl@4.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T15:53:44.729919Z 6c5ef5b New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0f4ed7fb02

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread CMakeLists.txt Resolved
The pinned Redis ref now includes redis/redis#15722, which refuses to
start a cluster node with a non-TLS bus unless
cluster-bus-port-protected-mode is waived. CI waived it only for the
literal `unstable` ref, so every coordinator flow test failed on the
new pin.

runtests.sh now adds the waiver for cluster runs whenever the
redis-server binary knows the option. That covers CI and local runs,
and any future pin, without matching ref names.

Also move the macOS OpenSSL linkage check from task-build.yml, which
only runs on Linux, to task-test.yml, which builds the macOS test
jobs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.62%. Comparing base (8cfcfe7) to head (6c5ef5b).
⚠️ Report is 24 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11897      +/-   ##
==========================================
- Coverage   84.33%   83.62%   -0.71%     
==========================================
  Files         660      681      +21     
  Lines       87319    88224     +905     
  Branches    41650    11423   -30227     
==========================================
+ Hits        73642    73780     +138     
+ Misses      13305    10818    -2487     
- Partials      372     3626    +3254     
Flag Coverage Δ
flow 72.43% <ø> (-12.27%) ⬇️
unit 57.63% <ø> (-2.94%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Drop the unversioned Homebrew `opt/openssl` fallbacks and fail CMake
configure when the OpenSSL found is not major version 4. A host without
openssl@4 used to fall back silently to whatever `opt/openssl` pointed
at, producing a module that fails to load in the Homebrew Redis package.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f62f29a3be

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread tests/pytests/runtests.sh Resolved
@alonre24

Copy link
Copy Markdown
Collaborator Author

@dariaguy, this is the RediSearch side of moving the Homebrew package to OpenSSL 4. Could you take a look?

macOS validation

PR CI doesn't run on macOS, so I dispatched these runs by hand.

Artifacts built from the head commit (f62f29a3be). CMake finds openssl@4 (4.0.x), and otool -L on the packaged redisearch.so shows only .../opt/openssl@4/lib/libssl.4.dylib and libcrypto.4.dylib:

Platform Run
macos-14 arm64 + x86_64 38588588106
macos-15 arm64 + x86_64 38588594370
macos-26 arm64 + x86_64 38588599877

Flow tests (QUICK=1, standalone and coordinator, Redis built against openssl@4), at c4a9ed2748. The only commit since then makes CMake require OpenSSL 4, and the artifact builds above cover it.

Platform arm64 x86_64 Run
macos-14 all pass crash, see below 38572631678
macos-15 1 flaky failure (MOD_19840) crash, see below 38572638512
macos-26 all pass crash, see below 38572643433

The x86_64 crashes have nothing to do with OpenSSL. They're a misaligned-pointer panic in the Rust allocator (MOD_17680), and unmodified master crashes the same way (38547960094). The fix is in #11909, which passes on macOS x86_64.

Not in this PR

  • The Homebrew cask must declare openssl@4 as its run-time dependency.
  • RedisTimeSeries needs the matching change.

`make run REDIS_STANDALONE=0` sets ENV_ONLY=1, which starts the cluster
through run_env and exits before the test path's waiver, so its nodes
refused to start on a Redis that has cluster-bus-port-protected-mode.
Probe the option in one helper and apply it on both paths.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added size:M and removed size:S labels Oct 15, 2026
@alonre24
alonre24 enabled auto-merge October 15, 2026 16:14
@sonarqubecloud

Copy link
Copy Markdown

@alonre24
alonre24 added this pull request to the merge queue Oct 15, 2026
Merged via the queue into master with commit f27ed95 Oct 15, 2026
61 checks passed
@alonre24
alonre24 deleted the alon-mod-19641-openssl4 branch October 15, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants