Skip to content

Avoid 'sed -i' when building modules - #14854

Closed
collinfunk wants to merge 1 commit into
redis:unstablefrom
collinfunk:avoid-sed-i-option
Closed

collinfunk wants to merge 1 commit into
redis:unstablefrom
collinfunk:avoid-sed-i-option

Conversation

@collinfunk

@collinfunk collinfunk commented Mar 6, 2026 •

Copy link
Copy Markdown

The macOS implementation of 'sed' has an -i option that is not compatible with GNU 'sed'. This leads to the following build error when running make with BUILD_WITH_MODULES=yes:

Disabling -Werror for all modules
Processing redisjson
sed: rename(): No such file or directory
Processing redistimeseries
sed: rename(): No such file or directory
Processing redisbloom
sed: rename(): No such file or directory
Processing redisearch
sed: rename(): No such file or directory
make[1]: *** [handle-werrors] Error 1

We can use the more portable method of redirecting the output to a temporary file and moving it.


Note

Low Risk
Low risk build-script portability change that only affects the optional DISABLE_WERRORS path when patching module build files; main build logic is unchanged.

Overview
Makes the handle-werrors step in modules/Makefile portable by replacing in-place sed -i edits with a temp-file rewrite (sed to $$f.tmp then mv).

This prevents macOS/BSD sed incompatibilities when stripping -Werror from module Makefile/*.mk/CMakeLists.txt files during module builds.

Written by Cursor Bugbot for commit a63eb40. This will update automatically on new commits. Configure here.

The macOS implementation of 'sed' has an -i option that is not
compatible with GNU 'sed'. This leads to the following build error when
running make with BUILD_WITH_MODULES=yes:

    Disabling -Werror for all modules
    Processing redisjson
    sed: rename(): No such file or directory
    Processing redistimeseries
    sed: rename(): No such file or directory
    Processing redisbloom
    sed: rename(): No such file or directory
    Processing redisearch
    sed: rename(): No such file or directory
    make[1]: *** [handle-werrors] Error 1

We can use the more portable method of redirecting the output to a
temporary file and moving it.
@CLAassistant

CLAassistant commented Mar 6, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@jit-ci

jit-ci Bot commented Mar 6, 2026

Copy link
Copy Markdown

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

@sundb

sundb commented Mar 7, 2026

Copy link
Copy Markdown
Collaborator

There is another issue on macOS M3
The generated so file name is macos-aarch64-release, but it's darwin-arm64v8-release in the cp command.

Build complete. Artifacts in /Users/debing.sun/data/redis_fork/modules/redisearch/src/bin/macos-aarch64-release/search-community
cp src/bin/darwin-arm64v8-release/search-community/redisearch.so ./
cp: src/bin/darwin-arm64v8-release/search-community/redisearch.so: No such file or directory
make[2]: *** [src/bin/darwin-arm64v8-release/search-community/redisearch.so] Error 1

@collinfunk

Copy link
Copy Markdown
Author

@sundb I noticed that to. It looks like RediSearch replaces it here: https://github.com/RediSearch/RediSearch/blob/969269694f24daa49bde8ccb23826c8997927949/sbin/get-platform#L32-L34

We can replace darwin with macos in GNU Make. Shall I amend this commit or create a separate PR?

@sundb

sundb commented Mar 8, 2026

Copy link
Copy Markdown
Collaborator

@sundb I noticed that to. It looks like RediSearch replaces it here: RediSearch/RediSearch@9692696/sbin/get-platform#L32-L34

We can replace darwin with macos in GNU Make. Shall I amend this commit or create a separate PR?

i'm not sure if we should fix it here, personally, i think darwin is more accurate.
CC @alonre24

@sundb sundb added this to Redis 8.8 Mar 9, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Redis 8.8 Mar 9, 2026
@alonre24

Copy link
Copy Markdown
Contributor

@sundb I noticed that to. It looks like RediSearch replaces it here: RediSearch/RediSearch@9692696/sbin/get-platform#L32-L34
We can replace darwin with macos in GNU Make. Shall I amend this commit or create a separate PR?

i'm not sure if we should fix it here, personally, i think darwin is more accurate. CC @alonre24

No objection from my side. We should coordinate such changes with @kalinstaykov to make sure we are aligned with OSS build flows

@kalinstaykov

Copy link
Copy Markdown
Contributor

@sundb I noticed that to. It looks like RediSearch replaces it here: RediSearch/RediSearch@9692696/sbin/get-platform#L32-L34
We can replace darwin with macos in GNU Make. Shall I amend this commit or create a separate PR?

i'm not sure if we should fix it here, personally, i think darwin is more accurate. CC @alonre24

No objection from my side. We should coordinate such changes with @kalinstaykov to make sure we are aligned with OSS build flows

No objection from me too - let's use darwin.

@sundb

sundb commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

@collinfunk

Copy link
Copy Markdown
Author

@sundb Oh, I didn't see that PR. I think this one should be good to close, then?

@sundb

sundb commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

@sundb Oh, I didn't see that PR. I think this one should be good to close, then?

I also just realized it, we can close this one.

@sundb sundb closed this Jun 18, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in Redis 8.10 Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants