mhassan1 / redis-memory-server

Redis Server for testing. The server will allow you to connect your favorite client library to the Redis Server and run parallel integration tests isolated from each other.
MIT License
76 stars 11 forks source link

Install started to fail on MacOS 13.5.2 #22

Closed oferbh closed 1 year ago

oferbh commented 1 year ago

We are seeing the following compilation error when trying to install the package on our local machines that are on the latest MacOS as of today - 13.5.2. This blocks development on many of our local environments.

npm ERR! path /Users/myuser/test-redis-memory-server/node_modules/redis-memory-server
npm ERR! command failed
npm ERR! command sh -c node ./scripts/postinstall
npm ERR! redis-memory-server: checking Redis binaries cache...
npm ERR! Downloading Redis stable: 0 % (0mb / 3.3mb)
npm ERR! failed to download/install Redis binaries. The error: Error: Command failed: make
npm ERR!     CC Makefile.dep
npm ERR! /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libhiredis.a(sockcompat.o) has no symbols
npm ERR!     CC adlist.o
npm ERR!     CC quicklist.o
npm ERR!     CC ae.o
npm ERR!     CC anet.o
npm ERR!     CC dict.o
npm ERR!     CC server.o
npm ERR!     CC sds.o
npm ERR!     CC zmalloc.o
npm ERR!     CC lzf_c.o
npm ERR!     CC lzf_d.o
npm ERR!     CC pqsort.o
npm ERR!     CC zipmap.o
npm ERR!     CC sha1.o
npm ERR!     CC ziplist.o
npm ERR!     CC release.o
npm ERR!     CC networking.o
npm ERR!     CC util.o
npm ERR!     CC object.o
npm ERR!     CC db.o
npm ERR!     CC replication.o
npm ERR! replication.c:1666:21: error: 'fstat64' is deprecated: first deprecated in macOS 10.6 [-Werror,-Wdeprecated-declarations]
npm ERR!                     redis_fstat(slave->repldbfd,&buf) == -1) {
npm ERR!                     ^
npm ERR! ./config.h:45:21: note: expanded from macro 'redis_fstat'
npm ERR! #define redis_fstat fstat64
npm ERR!                     ^
npm ERR! /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stat.h:430:9: note: 'fstat64' has been explicitly marked deprecated here
npm ERR! int     fstat64(int, struct stat64 *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_NA, __IPHONE_NA);
npm ERR!         ^
npm ERR! 1 error generated.
npm ERR! make[1]: *** [replication.o] Error 1
npm ERR! make: *** [all] Error 2
oferbh commented 1 year ago

Update: the issue probably stems from the latest default redis binary. Once fixating the version on latest 6.x (6.2.13), install succeeds.

mhassan1 commented 1 year ago

Thanks for the report! I am able to reproduce the same error in 7.2, but not 7.0 or 6.x. This looks similar to https://github.com/redis/redis/issues/12585; the error is different, but the workaround here solves the problem for me.

I think we'll need to wait until Redis releases a patch to 7.2. Until then, you should be able to stick with 7.0 or 6.x.

lizhen1412 commented 1 year ago

I had the same problem and urgently needed an official solution

jvelasquez-cl commented 1 year ago

I just set the redis version as @oferbh said REDISMS_VERSION=6.2.13 npn install

lizhen1412 commented 1 year ago

I just set the redis version as @oferbh said REDISMS_VERSION=6.2.13 npn install

But I need to use the latest version 7.2.1, but I just upgraded the m1 OS to 13.6, so I'm going to try it out now to see if it works.

lizhen1412 commented 1 year ago

I just set the redis version as @oferbh said REDISMS_VERSION=6.2.13 npn install

But I need to use the latest version 7.2.1, but I just upgraded the m1 OS to 13.6, so I'm going to try it out now to see if it works.

➜ redis git:(7.2) make cd src && /Applications/Xcode.app/Contents/Developer/usr/bin/make all CC replication.o replication.c:1617:31: error: variable has incomplete type 'struct stat64' struct redis_stat buf; ^ replication.c:1617:20: note: forward declaration of 'struct stat64' struct redis_stat buf; ^ ./config.h:46:20: note: expanded from macro 'redis_stat'

define redis_stat stat64

               ^

replication.c:1666:21: error: call to undeclared function 'fstat64'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] redis_fstat(slave->repldbfd,&buf) == -1) { ^ ./config.h:45:21: note: expanded from macro 'redis_fstat'

define redis_fstat fstat64

                ^

2 errors generated. make[1]: [replication.o] Error 1 make: [all] Error 2 ➜ redis git:(7.2)

I've tried, and I still get the following error

lizhen1412 commented 1 year ago

I just set the redis version as @oferbh said REDISMS_VERSION=6.2.13 npn install

MAKE hdr_histogram cd hdr_histogram && /Applications/Xcode.app/Contents/Developer/usr/bin/make cc -Wall -Os -g -c hdr_histogram.c CC adlist.o In file included from adlist.c:34: ./zmalloc.h:119:19: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] int jemalloc_purge(); ^ void 1 warning generated. CC quicklist.o In file included from quicklist.c:33: ./zmalloc.h:119:19: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] int jemalloc_purge(); ^ void 1 warning generated. CC ae.o In file included from ae.c:33: In file included from ./ae.h:36: ./monotonic.h:36:26: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] const char monotonicInit(); ^ void ./monotonic.h:39:32: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] const char monotonicInfoString(); ^ void ./monotonic.h:42:38: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] monotonic_clock_type monotonicGetType(); ^ void In file included from ae.c:46: ./zmalloc.h:119:19: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] int jemalloc_purge(); ^ void In file included from ae.c:60: ./ae_select.c:52:37: warning: unused parameter 'eventLoop' [-Wunused-parameter] static int aeApiResize(aeEventLoop *eventLoop, int setsize) { ^ 5 warnings generated. CC anet.o CC dict.o In file included from dict.c:47: ./zmalloc.h:119:19: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] int jemalloc_purge(); ^ void 1 warning generated. make[1]: No rule to make target commands.h', needed byserver.o'. Stop. make: [all] Error 2 ➜ redis git:(6.2) ✗

I also tried to switch to REDISMS_VERSION=6.2.13, there will be the above error, in addition, npm install is not the operation of node?

nicolaschambrier commented 1 year ago

Using MacOS v 13.6 I have the same issue :( I just installed the XCode Command Line Tools and when running yarn I get various errors depending on the Redis version requested, but it never works :(

REDISMS_VERSION=6.2.13
error /Users/nicolaschambrierbulard/Projects/jetlang-release-manager/node_modules/redis-memory-server: Command failed.
Exit code: 1
Command: node ./scripts/postinstall
Arguments:
Directory: /Users/nicolaschambrierbulard/Projects/jetlang-release-manager/node_modules/redis-memory-server
Output:
redis-memory-server: checking Redis binaries cache...
failed to download/install Redis binaries. The error: Error: Command failed: make
    CC replication.o
In file included from replication.c:32:
In file included from ./server.h:36:
In file included from ./rio.h:38:
./connection.h:206:29: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
connection *connCreateSocket();
                            ^
                             void
./connection.h:209:26: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
connection *connCreateTLS();
                         ^
                          void
./connection.h:234:22: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
int tlsHasPendingData();
                     ^
                      void
./connection.h:235:26: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
int tlsProcessPendingData();
                         ^
                          void
In file included from replication.c:32:
In file included from ./server.h:61:
In file included from ./ae.h:36:
./monotonic.h:36:26: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
const char *monotonicInit();
                         ^
                          void
./monotonic.h:39:32: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
const char *monotonicInfoString();
                               ^
                                void
./monotonic.h:42:38: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
monotonic_clock_type monotonicGetType();
                                     ^
                                      void
In file included from replication.c:32:
In file included from ./server.h:65:
./zmalloc.h:119:19: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
int jemalloc_purge();
                  ^
                   void
In file included from replication.c:32:
./server.h:1790:35: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
int moduleAllDatatypesHandleErrors();
                                  ^
                                   void
./server.h:1900:22: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void whileBlockedCron();
                     ^
                      void
./server.h:1901:29: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void blockingOperationStarts();
                            ^
                             void
./server.h:1902:27: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void blockingOperationEnds();
                          ^
                           void
./server.h:1975:26: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void beforePropagateMulti();
                         ^
                          void
./server.h:1976:24: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void afterPropagateExec();
                       ^
                        void
./server.h:2073:35: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
const char *getFailoverStateString();
                                  ^
                                   void
./server.h:2107:25: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void restartAOFAfterSYNC();
                        ^
                         void
./server.h:2119:26: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
int hasActiveChildProcess();
                         ^
                          void
./server.h:2120:21: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void resetChildState();
                    ^
                     void
./server.h:2148:28: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
user *ACLCreateUnlinkedUser();
                           ^
                            void
./server.h:2220:37: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
size_t freeMemoryGetNotCountedMemory();
                                    ^
                                     void
./server.h:2341:22: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void initConfigValues();
                     ^
                      void
./server.h:2382:32: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
long long dbTotalServerKeyCount();
                               ^
                                void
replication.c:1316:31: error: variable has incomplete type 'struct stat64'
            struct redis_stat buf;
                              ^
replication.c:1316:20: note: forward declaration of 'struct stat64'
            struct redis_stat buf;
                   ^
./config.h:45:20: note: expanded from macro 'redis_stat'
#define redis_stat stat64
                   ^
replication.c:1363:21: error: call to undeclared function 'fstat64'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                    redis_fstat(slave->repldbfd,&buf) == -1) {
                    ^
./config.h:44:21: note: expanded from macro 'redis_fstat'
#define redis_fstat fstat64
                    ^
replication.c:1493:25: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void restartAOFAfterSYNC() {
                        ^
                         void
replication.c:1510:27: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
static int useDisklessLoad() {
                          ^
                           void
replication.c:3553:35: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
const char *getFailoverStateString() {
                                  ^
                                   void
replication.c:3565:24: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void clearFailoverState() {
                       ^
                        void
no REDISMS_VERSION (the shortest error message, at least there's that...)
error /Users/nicolaschambrierbulard/Projects/jetlang-release-manager/node_modules/redis-memory-server: Command failed.
Exit code: 1
Command: node ./scripts/postinstall
Arguments:
Directory: /Users/nicolaschambrierbulard/Projects/jetlang-release-manager/node_modules/redis-memory-server
Output:
redis-memory-server: checking Redis binaries cache...
failed to download/install Redis binaries. The error: Error: Command failed: make
    CC Makefile.dep
    CC replication.o
replication.c:1617:31: error: variable has incomplete type 'struct stat64'
            struct redis_stat buf;
                              ^
replication.c:1617:20: note: forward declaration of 'struct stat64'
            struct redis_stat buf;
                   ^
./config.h:46:20: note: expanded from macro 'redis_stat'
#define redis_stat stat64
                   ^
replication.c:1666:21: error: call to undeclared function 'fstat64'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                    redis_fstat(slave->repldbfd,&buf) == -1) {
                    ^
./config.h:45:21: note: expanded from macro 'redis_fstat'
#define redis_fstat fstat64
                    ^
REDISMS_VERSION=6.0.10
error /Users/nicolaschambrierbulard/Projects/jetlang-release-manager/node_modules/redis-memory-server: Command failed.
Exit code: 1
Command: node ./scripts/postinstall
Arguments:
Directory: /Users/nicolaschambrierbulard/Projects/jetlang-release-manager/node_modules/redis-memory-server
Output:
redis-memory-server: checking Redis binaries cache...
failed to download/install Redis binaries. The error: Error: Command failed: make
    CC release.o
    CC replication.o
In file included from replication.c:32:
In file included from ./server.h:36:
In file included from ./rio.h:38:
./connection.h:206:29: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
connection *connCreateSocket();
                            ^
                             void
./connection.h:209:26: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
connection *connCreateTLS();
                         ^
                          void
./connection.h:234:22: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
int tlsHasPendingData();
                     ^
                      void
./connection.h:235:26: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
int tlsProcessPendingData();
                         ^
                          void
In file included from replication.c:32:
In file included from ./server.h:64:
./zmalloc.h:90:19: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
int jemalloc_purge();
                  ^
                   void
In file included from replication.c:32:
./server.h:1636:35: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
int moduleAllDatatypesHandleErrors();
                                  ^
                                   void
./server.h:1913:25: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void restartAOFAfterSYNC();
                        ^
                         void
./server.h:1923:26: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
int hasActiveChildProcess();
                         ^
                          void
./server.h:1949:28: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
user *ACLCreateUnlinkedUser();
                           ^
                            void
./server.h:2019:37: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
size_t freeMemoryGetNotCountedMemory();
                                    ^
                                     void
./server.h:2126:22: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void initConfigValues();
                     ^
                      void
./server.h:2165:32: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
long long dbTotalServerKeyCount();
                               ^
                                void
replication.c:1108:20: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void RdbPipeCleanup() {
                   ^
                    void
replication.c:1241:31: error: variable has incomplete type 'struct stat64'
            struct redis_stat buf;
                              ^
replication.c:1241:20: note: forward declaration of 'struct stat64'
            struct redis_stat buf;
                   ^
./config.h:45:20: note: expanded from macro 'redis_stat'
#define redis_stat stat64
                   ^
replication.c:1288:21: error: call to undeclared function 'fstat64'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                    redis_fstat(slave->repldbfd,&buf) == -1) {
                    ^
./config.h:44:21: note: expanded from macro 'redis_fstat'
#define redis_fstat fstat64
                    ^
replication.c:1406:25: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void restartAOFAfterSYNC() {
                        ^
                         void
replication.c:1423:27: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
static int useDisklessLoad() {
                          ^
                           void

Did someone manage to get it work? I'm not sure it's something new as I changed my computer just today and I don't have access to previous one.

nicolaschambrier commented 1 year ago

The patch here worked for me.

Clearly not viable, but until a fix is actually deployed it did the trick.

mhassan1 commented 1 year ago

Once this Redis PR is merged and released, this issue should be resolved. I'd love to avoid applying the workaround programmatically in redis-memory-server, but that could be an option if the Redis PR takes too long.

melishev commented 1 year ago

@mhassan1 Redis PR has been merged, I think this problem can be closed, although I have not checked on the latest version of the package

mhassan1 commented 1 year ago

Let's keep this open until a version of Redis that contains the fix is released.

weslley39 commented 1 year ago

What worked for me, while using a Mac M1 with MacOS Ventura 13.6, was to downgrade Xcode to 14.3.1

mhassan1 commented 1 year ago

This has been resolved by Redis. Please use either stable, 7.2.2, 7.0.14, or 6.2.14. NOTE: If you are using stable, you may need to delete the node_modules/.cache/redis-memory-server/redis-binaries/redis-stable.tar.gz file if you have the previous version of stable.