Skip to content
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

Memcached Proxy build in ARM64 #1048

Open
tomasAlabes opened this issue Jun 14, 2023 · 24 comments
Open

Memcached Proxy build in ARM64 #1048

tomasAlabes opened this issue Jun 14, 2023 · 24 comments

Comments

@tomasAlabes
Copy link

Describe the bug
ARM64 build instructions fail because of AMD Lua sources

To Reproduce
I don't have a clear snippet to provide, also because I'm not familiar with C compiling and Lua. If I find one I will add it here.
It should be as easy as running make in ARM64.

System Information

  • OS/Distro: Linux 84bf4a63ca7a 5.4.17-2136.318.7.1.el7uek.aarch64 # 2 SMP Thu Apr 13 17:58:57 PDT 2023 aarch64 aarch64 aarch64 GNU/Linux
  • Version of memcached: 1.6.20

Details

./configure --prefix=/usr --enable-proxy
make install
 ---> Running in d45d657a8a0d
make  install-recursive
make[1]: Entering directory `/memcached-1.6.20'
Making install in doc
make[2]: Entering directory `/memcached-1.6.20/doc'
make  install-am
make[3]: Entering directory `/memcached-1.6.20/doc'
make[4]: Entering directory `/memcached-1.6.20/doc'
make[4]: Nothing to be done for `install-exec-am'.
 /usr/bin/mkdir -p '/usr/share/man/man1'
 /usr/bin/install -c -m 644 memcached.1 '/usr/share/man/man1'
make[4]: Leaving directory `/memcached-1.6.20/doc'
make[3]: Leaving directory `/memcached-1.6.20/doc'
make[2]: Leaving directory `/memcached-1.6.20/doc'
Making install in vendor
make[2]: Entering directory `/memcached-1.6.20/vendor'
make[2]: `install' is up to date.
make[2]: Leaving directory `/memcached-1.6.20/vendor'
make[2]: Entering directory `/memcached-1.6.20'
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-memcached.o -MD -MP -MF .deps/memcached-memcached.Tpo -c -o memcached-memcached.o `test -f 'memcached.c' || echo './'`memcached.c
mv -f .deps/memcached-memcached.Tpo .deps/memcached-memcached.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-hash.o -MD -MP -MF .deps/memcached-hash.Tpo -c -o memcached-hash.o `test -f 'hash.c' || echo './'`hash.c
mv -f .deps/memcached-hash.Tpo .deps/memcached-hash.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-jenkins_hash.o -MD -MP -MF .deps/memcached-jenkins_hash.Tpo -c -o memcached-jenkins_hash.o `test -f 'jenkins_hash.c' || echo './'`jenkins_hash.c
mv -f .deps/memcached-jenkins_hash.Tpo .deps/memcached-jenkins_hash.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-murmur3_hash.o -MD -MP -MF .deps/memcached-murmur3_hash.Tpo -c -o memcached-murmur3_hash.o `test -f 'murmur3_hash.c' || echo './'`murmur3_hash.c
mv -f .deps/memcached-murmur3_hash.Tpo .deps/memcached-murmur3_hash.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-slabs.o -MD -MP -MF .deps/memcached-slabs.Tpo -c -o memcached-slabs.o `test -f 'slabs.c' || echo './'`slabs.c
mv -f .deps/memcached-slabs.Tpo .deps/memcached-slabs.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-items.o -MD -MP -MF .deps/memcached-items.Tpo -c -o memcached-items.o `test -f 'items.c' || echo './'`items.c
mv -f .deps/memcached-items.Tpo .deps/memcached-items.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-assoc.o -MD -MP -MF .deps/memcached-assoc.Tpo -c -o memcached-assoc.o `test -f 'assoc.c' || echo './'`assoc.c
mv -f .deps/memcached-assoc.Tpo .deps/memcached-assoc.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-thread.o -MD -MP -MF .deps/memcached-thread.Tpo -c -o memcached-thread.o `test -f 'thread.c' || echo './'`thread.c
mv -f .deps/memcached-thread.Tpo .deps/memcached-thread.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-daemon.o -MD -MP -MF .deps/memcached-daemon.Tpo -c -o memcached-daemon.o `test -f 'daemon.c' || echo './'`daemon.c
mv -f .deps/memcached-daemon.Tpo .deps/memcached-daemon.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-stats_prefix.o -MD -MP -MF .deps/memcached-stats_prefix.Tpo -c -o memcached-stats_prefix.o `test -f 'stats_prefix.c' || echo './'`stats_prefix.c
mv -f .deps/memcached-stats_prefix.Tpo .deps/memcached-stats_prefix.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-util.o -MD -MP -MF .deps/memcached-util.Tpo -c -o memcached-util.o `test -f 'util.c' || echo './'`util.c
mv -f .deps/memcached-util.Tpo .deps/memcached-util.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-cache.o -MD -MP -MF .deps/memcached-cache.Tpo -c -o memcached-cache.o `test -f 'cache.c' || echo './'`cache.c
mv -f .deps/memcached-cache.Tpo .deps/memcached-cache.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-bipbuffer.o -MD -MP -MF .deps/memcached-bipbuffer.Tpo -c -o memcached-bipbuffer.o `test -f 'bipbuffer.c' || echo './'`bipbuffer.c
mv -f .deps/memcached-bipbuffer.Tpo .deps/memcached-bipbuffer.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-base64.o -MD -MP -MF .deps/memcached-base64.Tpo -c -o memcached-base64.o `test -f 'base64.c' || echo './'`base64.c
mv -f .deps/memcached-base64.Tpo .deps/memcached-base64.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-logger.o -MD -MP -MF .deps/memcached-logger.Tpo -c -o memcached-logger.o `test -f 'logger.c' || echo './'`logger.c
mv -f .deps/memcached-logger.Tpo .deps/memcached-logger.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-crawler.o -MD -MP -MF .deps/memcached-crawler.Tpo -c -o memcached-crawler.o `test -f 'crawler.c' || echo './'`crawler.c
mv -f .deps/memcached-crawler.Tpo .deps/memcached-crawler.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-itoa_ljust.o -MD -MP -MF .deps/memcached-itoa_ljust.Tpo -c -o memcached-itoa_ljust.o `test -f 'itoa_ljust.c' || echo './'`itoa_ljust.c
mv -f .deps/memcached-itoa_ljust.Tpo .deps/memcached-itoa_ljust.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-slab_automove.o -MD -MP -MF .deps/memcached-slab_automove.Tpo -c -o memcached-slab_automove.o `test -f 'slab_automove.c' || echo './'`slab_automove.c
mv -f .deps/memcached-slab_automove.Tpo .deps/memcached-slab_automove.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-authfile.o -MD -MP -MF .deps/memcached-authfile.Tpo -c -o memcached-authfile.o `test -f 'authfile.c' || echo './'`authfile.c
mv -f .deps/memcached-authfile.Tpo .deps/memcached-authfile.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-restart.o -MD -MP -MF .deps/memcached-restart.Tpo -c -o memcached-restart.o `test -f 'restart.c' || echo './'`restart.c
mv -f .deps/memcached-restart.Tpo .deps/memcached-restart.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-proto_text.o -MD -MP -MF .deps/memcached-proto_text.Tpo -c -o memcached-proto_text.o `test -f 'proto_text.c' || echo './'`proto_text.c
mv -f .deps/memcached-proto_text.Tpo .deps/memcached-proto_text.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-proto_bin.o -MD -MP -MF .deps/memcached-proto_bin.Tpo -c -o memcached-proto_bin.o `test -f 'proto_bin.c' || echo './'`proto_bin.c
mv -f .deps/memcached-proto_bin.Tpo .deps/memcached-proto_bin.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-proto_proxy.o -MD -MP -MF .deps/memcached-proto_proxy.Tpo -c -o memcached-proto_proxy.o `test -f 'proto_proxy.c' || echo './'`proto_proxy.c
proto_proxy.c: In function 'process_proxy_stats':
proto_proxy.c:51:12: warning: missing braces around initializer [-Wmissing-braces]
     struct proxy_int_stats istats = {0};
            ^
proto_proxy.c:51:12: warning: (near initialization for 'istats.counters') [-Wmissing-braces]
mv -f .deps/memcached-proto_proxy.Tpo .deps/memcached-proto_proxy.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-proxy_xxhash.o -MD -MP -MF .deps/memcached-proxy_xxhash.Tpo -c -o memcached-proxy_xxhash.o `test -f 'proxy_xxhash.c' || echo './'`proxy_xxhash.c
mv -f .deps/memcached-proxy_xxhash.Tpo .deps/memcached-proxy_xxhash.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-proxy_await.o -MD -MP -MF .deps/memcached-proxy_await.Tpo -c -o memcached-proxy_await.o `test -f 'proxy_await.c' || echo './'`proxy_await.c
mv -f .deps/memcached-proxy_await.Tpo .deps/memcached-proxy_await.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-proxy_ustats.o -MD -MP -MF .deps/memcached-proxy_ustats.Tpo -c -o memcached-proxy_ustats.o `test -f 'proxy_ustats.c' || echo './'`proxy_ustats.c
mv -f .deps/memcached-proxy_ustats.Tpo .deps/memcached-proxy_ustats.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-proxy_jump_hash.o -MD -MP -MF .deps/memcached-proxy_jump_hash.Tpo -c -o memcached-proxy_jump_hash.o `test -f 'proxy_jump_hash.c' || echo './'`proxy_jump_hash.c
mv -f .deps/memcached-proxy_jump_hash.Tpo .deps/memcached-proxy_jump_hash.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-proxy_request.o -MD -MP -MF .deps/memcached-proxy_request.Tpo -c -o memcached-proxy_request.o `test -f 'proxy_request.c' || echo './'`proxy_request.c
mv -f .deps/memcached-proxy_request.Tpo .deps/memcached-proxy_request.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-proxy_network.o -MD -MP -MF .deps/memcached-proxy_network.Tpo -c -o memcached-proxy_network.o `test -f 'proxy_network.c' || echo './'`proxy_network.c
mv -f .deps/memcached-proxy_network.Tpo .deps/memcached-proxy_network.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-proxy_lua.o -MD -MP -MF .deps/memcached-proxy_lua.Tpo -c -o memcached-proxy_lua.o `test -f 'proxy_lua.c' || echo './'`proxy_lua.c
mv -f .deps/memcached-proxy_lua.Tpo .deps/memcached-proxy_lua.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-proxy_config.o -MD -MP -MF .deps/memcached-proxy_config.Tpo -c -o memcached-proxy_config.o `test -f 'proxy_config.c' || echo './'`proxy_config.c
mv -f .deps/memcached-proxy_config.Tpo .deps/memcached-proxy_config.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-proxy_ring_hash.o -MD -MP -MF .deps/memcached-proxy_ring_hash.Tpo -c -o memcached-proxy_ring_hash.o `test -f 'proxy_ring_hash.c' || echo './'`proxy_ring_hash.c
mv -f .deps/memcached-proxy_ring_hash.Tpo .deps/memcached-proxy_ring_hash.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-proxy_internal.o -MD -MP -MF .deps/memcached-proxy_internal.Tpo -c -o memcached-proxy_internal.o `test -f 'proxy_internal.c' || echo './'`proxy_internal.c
mv -f .deps/memcached-proxy_internal.Tpo .deps/memcached-proxy_internal.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-md5.o -MD -MP -MF .deps/memcached-md5.Tpo -c -o memcached-md5.o `test -f 'md5.c' || echo './'`md5.c
mv -f .deps/memcached-md5.Tpo .deps/memcached-md5.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-extstore.o -MD -MP -MF .deps/memcached-extstore.Tpo -c -o memcached-extstore.o `test -f 'extstore.c' || echo './'`extstore.c
mv -f .deps/memcached-extstore.Tpo .deps/memcached-extstore.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-crc32c.o -MD -MP -MF .deps/memcached-crc32c.Tpo -c -o memcached-crc32c.o `test -f 'crc32c.c' || echo './'`crc32c.c
mv -f .deps/memcached-crc32c.Tpo .deps/memcached-crc32c.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-storage.o -MD -MP -MF .deps/memcached-storage.Tpo -c -o memcached-storage.o `test -f 'storage.c' || echo './'`storage.c
mv -f .deps/memcached-storage.Tpo .deps/memcached-storage.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-slab_automove_extstore.o -MD -MP -MF .deps/memcached-slab_automove_extstore.Tpo -c -o memcached-slab_automove_extstore.o `test -f 'slab_automove_extstore.c' || echo './'`slab_automove_extstore.c
mv -f .deps/memcached-slab_automove_extstore.Tpo .deps/memcached-slab_automove_extstore.Po
gcc -std=gnu11  -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls   -o memcached memcached-memcached.o memcached-hash.o memcached-jenkins_hash.o memcached-murmur3_hash.o memcached-slabs.o memcached-items.o memcached-assoc.o memcached-thread.o memcached-daemon.o memcached-stats_prefix.o memcached-util.o memcached-cache.o memcached-bipbuffer.o memcached-base64.o memcached-logger.o memcached-crawler.o memcached-itoa_ljust.o memcached-slab_automove.o memcached-authfile.o memcached-restart.o memcached-proto_text.o memcached-proto_bin.o       memcached-proto_proxy.o memcached-proxy_xxhash.o memcached-proxy_await.o memcached-proxy_ustats.o memcached-proxy_jump_hash.o memcached-proxy_request.o memcached-proxy_network.o memcached-proxy_lua.o memcached-proxy_config.o memcached-proxy_ring_hash.o memcached-proxy_internal.o memcached-md5.o memcached-extstore.o memcached-crc32c.o memcached-storage.o memcached-slab_automove_extstore.o    vendor/lua/src/liblua.a vendor/mcmc/mcmc.o  -levent  -lm -ldl
/usr/bin/ld: vendor/lua/src/liblua.a(lapi.o): Relocations in generic ELF (EM: 62)
/usr/bin/ld: vendor/lua/src/liblua.a(lapi.o): Relocations in generic ELF (EM: 62)
/usr/bin/ld: vendor/lua/src/liblua.a(lapi.o): Relocations in generic ELF (EM: 62)
/usr/bin/ld: vendor/lua/src/liblua.a(lapi.o): Relocations in generic ELF (EM: 62)
/usr/bin/ld: vendor/lua/src/liblua.a(lapi.o): Relocations in generic ELF (EM: 62)
/usr/bin/ld: vendor/lua/src/liblua.a(lapi.o): Relocations in generic ELF (EM: 62)
vendor/lua/src/liblua.a: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
make[2]: *** [memcached] Error 1
make[2]: Leaving directory `/memcached-1.6.20'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/memcached-1.6.20'
make: *** [install] Error 2
The command '/bin/sh -c make install' returned a non-zero code: 2
@dormando
Copy link
Member

Thanks for your report!

I was able to reproduce this on an ARM32 at least (ARM64 I can try a little later). This appears to be a packaging problem with the tarball.

In the meantime building from the git source does work; I've been doing tests on AWS graviton and such.

You can build from there with a few more steps:

git clone etc
cd memcached
cd vendor && ./fetch.sh
cd ..
./autogen.sh
./configure --enable-proxy
make

Going to leave this issue open until I figure out the tarball issue. It's not obvious at a glance.

@dormando
Copy link
Member

Note for self: Running make clean then make a second time compiles successfully and passes tests. Something's leaking into the tarball.

@dormando
Copy link
Member

yup, the tarball process is pulling in compiled objects under vendor/ .. sigh.

@tomasAlabes
Copy link
Author

@dormando thanks for your time and fixing it! One small problem though, the following command is still providing version 1.6.19

wget http://memcached.org/latest

Maybe some CD needs to be run to update it?

@tomasAlabes
Copy link
Author

I think they have been failing for a while: https://build.memcached.org/#/builders/9

@dormando
Copy link
Member

No the link from the homepage works fine: https://memcached.org/ - I moved the release script to a new machine and it was failing to restart ngninx so the /latest redirect wasn't updating. it should be fine now. Thanks for letting me know.

@dormando
Copy link
Member

The builder isn't related to the tarball release; it's an "aspirational" builder for pre-testing the tarball so I stop breaking it like this :) Haven't had time to go make the test work after setting it up.

@tomasAlabes
Copy link
Author

tomasAlabes commented Jun 20, 2023

Thanks, I was able to download the tar now, but while building a couple of files were missing:

[...]
mv -f .deps/memcached-slab_automove_extstore.Tpo .deps/memcached-slab_automove_extstore.Po
gcc -std=gnu11  -g -O2 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls   -o memcached memcached-memcached.o memcached-hash.o memcached-jenkins_hash.o memcached-murmur3_hash.o memcached-slabs.o memcached-items.o memcached-assoc.o memcached-thread.o memcached-daemon.o memcached-stats_prefix.o memcached-util.o memcached-cache.o memcached-bipbuffer.o memcached-base64.o memcached-logger.o memcached-crawler.o memcached-itoa_ljust.o memcached-slab_automove.o memcached-authfile.o memcached-restart.o memcached-proto_text.o memcached-proto_bin.o       memcached-proto_proxy.o memcached-proxy_xxhash.o memcached-proxy_await.o memcached-proxy_ustats.o memcached-proxy_jump_hash.o memcached-proxy_request.o memcached-proxy_network.o memcached-proxy_lua.o memcached-proxy_config.o memcached-proxy_ring_hash.o memcached-proxy_internal.o memcached-md5.o memcached-extstore.o memcached-crc32c.o memcached-storage.o memcached-slab_automove_extstore.o    vendor/lua/src/liblua.a vendor/mcmc/mcmc.o  -levent  -lm -ldl
�[91mgcc: error: vendor/lua/src/liblua.a: No such file or directory
gcc: error: vendor/mcmc/mcmc.o: No such file or directory
�[0m�[91mmake[2]: *** [memcached] Error 1
�[0mmake[2]: Leaving directory `/memcached-1.6.21'
�[91mmake[1]: *** [install-recursive] Error 1
�[0mmake[1]: Leaving directory `/memcached-1.6.21'
�[91mmake: *** [install] Error 2
�[0mThe command '/bin/sh -c ./configure --prefix=/usr --enable-proxy     && CFLAGS="-std=c99" make install' returned a non-zero code: 2
gcc: error: vendor/lua/src/liblua.a: No such file or directory
gcc: error: vendor/mcmc/mcmc.o: No such file or directory

What I did was

# download + extract http://memcached.org/latest
./configure --prefix=/usr --enable-proxy
make install

@dormando
Copy link
Member

can you gist or attach the full build log? I just tried the .21 tarball on amd64 and arm32 and both build fine. I pre-tested them before release as well.

Try separating the commands?

./configure --prefix=/usr --enable-proxy
make
make install

in case some middle step is failing?

@dormando
Copy link
Member

dormando commented Jun 20, 2023

on raspberry pi I got the same error by running make install directly. Please run make before make install.

edit: reopening this issue since I'm pretty sure make install without make should work.

@dormando dormando reopened this Jun 20, 2023
@tomasAlabes
Copy link
Author

I'm trying, but I get stuck with the make, I keep getting a C compilation error (I'm not familiar with gcc):

sh-4.2# ./configure --prefix=/usr --enable-proxy
sh-4.2# make
make  all-recursive
make[1]: Entering directory `/memcached-1.6.21'
Making all in doc
make[2]: Entering directory `/memcached-1.6.21/doc'
make  all-am
make[3]: Entering directory `/memcached-1.6.21/doc'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/memcached-1.6.21/doc'
make[2]: Leaving directory `/memcached-1.6.21/doc'
Making all in vendor
make[2]: Entering directory `/memcached-1.6.21/vendor'
cd lua && make all CFLAGS="-g" && cd ..
make[3]: Entering directory `/memcached-1.6.21/vendor/lua'
make[4]: Entering directory `/memcached-1.6.21/vendor/lua/src'
Guessing Linux
make[5]: Entering directory `/memcached-1.6.21/vendor/lua/src'
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl"
make[6]: Entering directory `/memcached-1.6.21/vendor/lua/src'
gcc -std=gnu99 -g   -c -o lapi.o lapi.c
gcc -std=gnu99 -g  -c lcode.c
gcc -std=gnu99 -g   -c -o lctype.o lctype.c
gcc -std=gnu99 -g   -c -o ldebug.o ldebug.c
gcc -std=gnu99 -g   -c -o ldo.o ldo.c
gcc -std=gnu99 -g   -c -o ldump.o ldump.c
gcc -std=gnu99 -g   -c -o lfunc.o lfunc.c
gcc -std=gnu99 -g   -c -o lgc.o lgc.c
gcc -std=gnu99 -g  -c llex.c
gcc -std=gnu99 -g   -c -o lmem.o lmem.c
gcc -std=gnu99 -g   -c -o lobject.o lobject.c
gcc -std=gnu99 -g   -c -o lopcodes.o lopcodes.c
gcc -std=gnu99 -g  -c lparser.c
gcc -std=gnu99 -g   -c -o lstate.o lstate.c
gcc -std=gnu99 -g   -c -o lstring.o lstring.c
gcc -std=gnu99 -g   -c -o ltable.o ltable.c
gcc -std=gnu99 -g   -c -o ltm.o ltm.c
gcc -std=gnu99 -g   -c -o lundump.o lundump.c
gcc -std=gnu99 -g   -c -o lvm.o lvm.c
gcc -std=gnu99 -g   -c -o lzio.o lzio.c
gcc -std=gnu99 -g   -c -o lauxlib.o lauxlib.c
gcc -std=gnu99 -g   -c -o lbaselib.o lbaselib.c
gcc -std=gnu99 -g   -c -o lcorolib.o lcorolib.c
gcc -std=gnu99 -g   -c -o ldblib.o ldblib.c
gcc -std=gnu99 -g   -c -o liolib.o liolib.c
gcc -std=gnu99 -g   -c -o lmathlib.o lmathlib.c
gcc -std=gnu99 -g   -c -o loadlib.o loadlib.c
gcc -std=gnu99 -g   -c -o loslib.o loslib.c
gcc -std=gnu99 -g   -c -o lstrlib.o lstrlib.c
gcc -std=gnu99 -g   -c -o ltablib.o ltablib.c
gcc -std=gnu99 -g   -c -o lutf8lib.o lutf8lib.c
gcc -std=gnu99 -g   -c -o linit.o linit.c
ar rcu liblua.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o
ranlib liblua.a
gcc -std=gnu99 -g   -c -o lua.o lua.c
gcc -std=gnu99 -o lua   lua.o liblua.a -lm -Wl,-E -ldl
liblua.a(loslib.o): In function `os_tmpname':
/memcached-1.6.21/vendor/lua/src/loslib.c:172: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
gcc -std=gnu99 -g   -c -o luac.o luac.c
gcc -std=gnu99 -o luac   luac.o liblua.a -lm -Wl,-E -ldl
make[6]: Leaving directory `/memcached-1.6.21/vendor/lua/src'
make[5]: Leaving directory `/memcached-1.6.21/vendor/lua/src'
make[4]: Leaving directory `/memcached-1.6.21/vendor/lua/src'
make[3]: Leaving directory `/memcached-1.6.21/vendor/lua'
cd mcmc && make all && cd ..
make[3]: Entering directory `/memcached-1.6.21/vendor/mcmc'
gcc -g -O2 -Wall -Werror -pedantic -o example example.c mcmc.c
In file included from example.c:12:0:
mcmc.h:11:27: error: C++ style comments are not allowed in ISO C90 [-Werror]
 #define MCMC_CONNECTING 3 // nonblock mode.
                           ^
mcmc.h:11:27: error: (this will be reported only once per input file) [-Werror]
mcmc.h:66:10: error: ISO C90 doesn't support unnamed structs/unions [-Werror=pedantic]
         };
          ^
mcmc.h:74:10: error: ISO C90 doesn't support unnamed structs/unions [-Werror=pedantic]
         };
          ^
mcmc.h:81:10: error: ISO C90 doesn't support unnamed structs/unions [-Werror=pedantic]
         };
          ^
mcmc.h:61:5: error: union has no named members [-Werror=pedantic]
     union {
     ^
mcmc.h:82:6: error: ISO C90 doesn't support unnamed structs/unions [-Werror=pedantic]
     };
      ^
example.c:14:1: error: C++ style comments are not allowed in ISO C90 [-Werror]
 // in this form the socket syscalls are handled externally to the client, so
 ^
example.c:14:1: error: (this will be reported only once per input file) [-Werror]
example.c: In function 'show_response_buffer':
example.c:43:9: error: ISO C90 forbids mixed declarations and code [-Werror=pedantic]
         size_t toread = resp.vlen - resp.vlen_read;
         ^
example.c: In function 'buffer_mode':
example.c:158:5: error: 'for' loop initial declarations are only allowed in C99 mode
     for (int x = 0; strlen(requests[x]) != 0; x++) {
     ^
example.c:158:5: note: use option -std=c99 or -std=gnu99 to compile your code
example.c: In function 'main':
example.c:174:32: error: '__STDC_VERSION__' undeclared (first use in this function)
     printf("C version: %ld\n", __STDC_VERSION__);
                                ^
example.c:174:32: note: each undeclared identifier is reported only once for each function it appears in
cc1: all warnings being treated as errors
mcmc.c:11:1: error: C++ style comments are not allowed in ISO C90 [-Werror]
 // TODO: move these structs into mcmc.h, but only expose them if
 ^
mcmc.c:11:1: error: (this will be reported only once per input file) [-Werror]
In file included from mcmc.c:13:0:
mcmc.h:11:27: error: C++ style comments are not allowed in ISO C90 [-Werror]
 #define MCMC_CONNECTING 3 // nonblock mode.
                           ^
mcmc.h:11:27: error: (this will be reported only once per input file) [-Werror]
mcmc.h:66:10: error: ISO C90 doesn't support unnamed structs/unions [-Werror=pedantic]
         };
          ^
mcmc.h:74:10: error: ISO C90 doesn't support unnamed structs/unions [-Werror=pedantic]
         };
          ^
mcmc.h:81:10: error: ISO C90 doesn't support unnamed structs/unions [-Werror=pedantic]
         };
          ^
mcmc.h:61:5: error: union has no named members [-Werror=pedantic]
     union {
     ^
mcmc.h:82:6: error: ISO C90 doesn't support unnamed structs/unions [-Werror=pedantic]
     };
      ^
mcmc.c: In function '_mcmc_parse_value_line':
mcmc.c:71:5: error: ISO C90 forbids mixed declarations and code [-Werror=pedantic]
     char *n = NULL;
     ^
mcmc.c:73:5: error: ISO C90 forbids mixed declarations and code [-Werror=pedantic]
     uint32_t flags = strtoul(p, &n, 10);
     ^
mcmc.c:80:5: error: ISO C90 forbids mixed declarations and code [-Werror=pedantic]
     uint32_t bytes = strtoul(p, &n, 10);
     ^
mcmc.c:87:5: error: ISO C90 forbids mixed declarations and code [-Werror=pedantic]
     uint64_t cas = 0;
     ^
mcmc.c:99:5: error: ISO C90 forbids mixed declarations and code [-Werror=pedantic]
     int buffer_remain = ctx->buffer_used - (r->value - ctx->buffer_head);
     ^
mcmc.c: In function '_mcmc_parse_stat_line':
mcmc.c:130:5: error: ISO C90 forbids mixed declarations and code [-Werror=pedantic]
     int snamelen = p - sname;
     ^
mcmc.c:134:5: error: ISO C90 forbids mixed declarations and code [-Werror=pedantic]
     char *stat = p;
     ^
mcmc.c: In function '_mcmc_parse_response':
mcmc.c:183:5: error: ISO C90 forbids mixed declarations and code [-Werror=pedantic]
     int code = MCMC_ERR;
     ^
mcmc.c:240:25: error: ISO C90 forbids mixed declarations and code [-Werror=pedantic]
                         char *n = NULL;
                         ^
mcmc.c:248:29: error: ISO C90 forbids mixed declarations and code [-Werror=pedantic]
                             int buffer_remain = ctx->buffer_used - (r->value - ctx->buffer_head);
                             ^
mcmc.c: In function 'mcmc_request_writev':
mcmc.c:566:5: error: 'for' loop initial declarations are only allowed in C99 mode
     for (int i = 0; i < iovcnt; i++) {
     ^
mcmc.c:566:5: note: use option -std=c99 or -std=gnu99 to compile your code
cc1: all warnings being treated as errors
make[3]: *** [all] Error 1
make[3]: Leaving directory `/memcached-1.6.21/vendor/mcmc'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/memcached-1.6.21/vendor'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/memcached-1.6.21'
make: *** [all] Error 2

Checking the ./configure command, I found the env options:

sh-4.2# ./configure CFLAGS="-std=c99" --prefix=/usr --enable-proxy
sh-4.2# make

# but exact same error, same stack

And if I run make install again with the CFLAGS option, now it fails with something else:

sh-4.2# ./configure CFLAGS="-std=c99" --prefix=/usr --enable-proxy
sh-4.2# make install
make  install-recursive
make[1]: Entering directory `/memcached-1.6.21'
Making install in doc
make[2]: Entering directory `/memcached-1.6.21/doc'
make  install-am
make[3]: Entering directory `/memcached-1.6.21/doc'
make[4]: Entering directory `/memcached-1.6.21/doc'
make[4]: Nothing to be done for `install-exec-am'.
 /usr/bin/mkdir -p '/usr/share/man/man1'
 /usr/bin/install -c -m 644 memcached.1 '/usr/share/man/man1'
make[4]: Leaving directory `/memcached-1.6.21/doc'
make[3]: Leaving directory `/memcached-1.6.21/doc'
make[2]: Leaving directory `/memcached-1.6.21/doc'
Making install in vendor
make[2]: Entering directory `/memcached-1.6.21/vendor'
make[2]: `install' is up to date.
make[2]: Leaving directory `/memcached-1.6.21/vendor'
make[2]: Entering directory `/memcached-1.6.21'
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -std=c99 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-memcached.o -MD -MP -MF .deps/memcached-memcached.Tpo -c -o memcached-memcached.o `test -f 'memcached.c' || echo './'`memcached.c
mv -f .deps/memcached-memcached.Tpo .deps/memcached-memcached.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -std=c99 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-hash.o -MD -MP -MF .deps/memcached-hash.Tpo -c -o memcached-hash.o `test -f 'hash.c' || echo './'`hash.c
mv -f .deps/memcached-hash.Tpo .deps/memcached-hash.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -std=c99 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-jenkins_hash.o -MD -MP -MF .deps/memcached-jenkins_hash.Tpo -c -o memcached-jenkins_hash.o `test -f 'jenkins_hash.c' || echo './'`jenkins_hash.c
mv -f .deps/memcached-jenkins_hash.Tpo .deps/memcached-jenkins_hash.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -std=c99 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-murmur3_hash.o -MD -MP -MF .deps/memcached-murmur3_hash.Tpo -c -o memcached-murmur3_hash.o `test -f 'murmur3_hash.c' || echo './'`murmur3_hash.c
mv -f .deps/memcached-murmur3_hash.Tpo .deps/memcached-murmur3_hash.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -std=c99 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-slabs.o -MD -MP -MF .deps/memcached-slabs.Tpo -c -o memcached-slabs.o `test -f 'slabs.c' || echo './'`slabs.c
mv -f .deps/memcached-slabs.Tpo .deps/memcached-slabs.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -std=c99 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-items.o -MD -MP -MF .deps/memcached-items.Tpo -c -o memcached-items.o `test -f 'items.c' || echo './'`items.c
mv -f .deps/memcached-items.Tpo .deps/memcached-items.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -std=c99 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-assoc.o -MD -MP -MF .deps/memcached-assoc.Tpo -c -o memcached-assoc.o `test -f 'assoc.c' || echo './'`assoc.c
mv -f .deps/memcached-assoc.Tpo .deps/memcached-assoc.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -std=c99 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-thread.o -MD -MP -MF .deps/memcached-thread.Tpo -c -o memcached-thread.o `test -f 'thread.c' || echo './'`thread.c
mv -f .deps/memcached-thread.Tpo .deps/memcached-thread.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -std=c99 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-daemon.o -MD -MP -MF .deps/memcached-daemon.Tpo -c -o memcached-daemon.o `test -f 'daemon.c' || echo './'`daemon.c
mv -f .deps/memcached-daemon.Tpo .deps/memcached-daemon.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -std=c99 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-stats_prefix.o -MD -MP -MF .deps/memcached-stats_prefix.Tpo -c -o memcached-stats_prefix.o `test -f 'stats_prefix.c' || echo './'`stats_prefix.c
mv -f .deps/memcached-stats_prefix.Tpo .deps/memcached-stats_prefix.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -std=c99 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-util.o -MD -MP -MF .deps/memcached-util.Tpo -c -o memcached-util.o `test -f 'util.c' || echo './'`util.c
mv -f .deps/memcached-util.Tpo .deps/memcached-util.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -std=c99 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-cache.o -MD -MP -MF .deps/memcached-cache.Tpo -c -o memcached-cache.o `test -f 'cache.c' || echo './'`cache.c
cache.c: In function 'cache_create':
cache.c:20:5: warning: implicit declaration of function 'strdup' [-Wimplicit-function-declaration]
     char* nm = strdup(name);
     ^
cache.c:20:16: warning: initialization makes pointer from integer without a cast [enabled by default]
     char* nm = strdup(name);
                ^
mv -f .deps/memcached-cache.Tpo .deps/memcached-cache.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -std=c99 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-bipbuffer.o -MD -MP -MF .deps/memcached-bipbuffer.Tpo -c -o memcached-bipbuffer.o `test -f 'bipbuffer.c' || echo './'`bipbuffer.c
mv -f .deps/memcached-bipbuffer.Tpo .deps/memcached-bipbuffer.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -std=c99 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-base64.o -MD -MP -MF .deps/memcached-base64.Tpo -c -o memcached-base64.o `test -f 'base64.c' || echo './'`base64.c
mv -f .deps/memcached-base64.Tpo .deps/memcached-base64.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG -Ivendor/lua/src -Ivendor/liburing/src/include   -std=c99 -pthread -pthread -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-logger.o -MD -MP -MF .deps/memcached-logger.Tpo -c -o memcached-logger.o `test -f 'logger.c' || echo './'`logger.c
logger.c: In function 'logger_thread':
logger.c:863:5: error: unknown type name 'useconds_t'
     useconds_t to_sleep = MIN_LOGGER_SLEEP;
     ^
logger.c:875:13: warning: implicit declaration of function 'usleep' [-Wimplicit-function-declaration]
             usleep(to_sleep);
             ^
make[2]: *** [memcached-logger.o] Error 1
make[2]: Leaving directory `/memcached-1.6.21'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/memcached-1.6.21'
make: *** [install] Error 2

I also tried with CFLAGS="-std=gnu99", running make CFLAGS="-std=c99".
make install CFLAGS="-std=c99"


gcc version:

sh-4.2# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-44.0.3) (GCC)

@tomasAlabes
Copy link
Author

I'm trying to make it easy to reproduce, I hope something like this helps? (it got stuck on configuring libevent for me though)

FROM oraclelinux:7-slim

ARG MEMCACHED_VERSION="1.6.21"

RUN yum install -y make gcc wget gzip

RUN wget https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz && tar -xzf libevent-2.1.12-stable.tar.gz
RUN cd libevent-2.1.12-stable && ./configure && make && make install

RUN wget http://memcached.org/latest \
  -O memcached-${MEMCACHED_VERSION}.tar.gz \
  && tar xzf memcached-${MEMCACHED_VERSION}.tar.gz

WORKDIR memcached-${MEMCACHED_VERSION}

RUN ./configure --prefix=/usr --enable-proxy
RUN make
RUN make install

@dormando
Copy link
Member

dormando commented Jun 21, 2023

Sorry, I wasn't expecting an 8+ year old version of gcc for the proxy. I don't have any buildbots that old either.

Can you try with CFLAGS="-std=c11"? - the mcmc client uses c11 style code. Please make sure you run make clean first. That might work.

If it does I need to circle back with extra configure tests when proxy is enabled.

@tomasAlabes
Copy link
Author

Come on, using an up-to-date compiler is easy, right? 😆
I couldn't make it work with OL7 (std=c11 option included), but it make && make install works with OL8 (gcc version 8.5.0 20210514 (Red Hat 8.5.0-18.0.2) ).
I'll leave it up to you if you want to keep this open or not. Maybe there's a workaround for more C-savy people in my situation but this is good enough for me.

@dormando
Copy link
Member

I'll keep it open because I need to fix bare make install and add some extra configure tests with proxy enabled to ensure c11 works. Thanks for your patience; you've found a lot of build problems :)

May I ask why you were using such an old version of linux? (the oldest one even offered by oracle, apparently). I was worried you were stuck there but you seem to be able to use something newer.

@tomasAlabes
Copy link
Author

Can't say specifically why but, company policy. Because I'm starting to explore the Memcached Proxy as a mcrouter replacement, I have time to be allowed to use OL8, which has a newer gcc.

@dormando
Copy link
Member

Thanks, that's good to know. Are you on an old version of mcrouter? The recent stuff only builds with very new GCC so far as I know.

The memcached proxy is in a stage where I'm grinding out polish. The documentation and example configurations (https://github.com/memcached/memcached-proxylibs) are in need of work. If you're having trouble figuring out how to translate a mcrouter configuration into mc proxy please let me know. I'll happily write a configuration for you, or ideally update the standard libraries to make what you need to do easy.

I don't really intend long term that most people write "route libraries", but it's abstracted this way so bigger users can fully customize things.

@tomasAlabes
Copy link
Author

That'd be awesome! We were probably on an old version, we had to drop it because of ARM building issues.
We were using a pretty basic functionality, so hopefully it should be able to be replaced easily.

Our topology would be something like:

[service] x N -> [mc proxy] x 2 -> [mc] x 3

Our config was 1 pool, all sync. This was our helm chart snippet, defining the mcrouter config:

{
  "pools": {
    "pool-1": {
      "servers": [
        {{- $global := . }}
        {{- range $i, $e := until (.Values.memcached.replicas | int) }}
        "memcached-{{ $i }}.memcached.svc.cluster.local:{{ $global.Values.memcached.port }}",
        {{- end }}
      ]
    }
  },
  "named_handles": [],
  "route": {
    "type": "PrefixSelectorRoute",
    "policies": {
      "pr_": {
        "type": "OperationSelectorRoute",
        "default_policy": "AllSyncRoute|Pool|Process",
        "operation_policies": {
          "get": {
            "type": "FailoverRoute",
            "children": [{
              "type": "PoolRoute",
              "pool": "pool-1"
            }]
          }
        }
      }
    },
    "wildcard": "NullRoute"
  }
}

Of course, after this we'd like to improve it, but this is the most basic setup.

I don't know how this can work with the Lua scripts. Passing env variables with Helm is an option I guess.
Still haven't started with the full replacement, but any idea or snippet is of course welcome.

@dormando
Copy link
Member

Thanks! I'll get back to you in a day with maybe a full example. My plan is that people don't write lua code directly, you use one of the provided libraries (probaly simple.lua).

It looks from your configuration like you have a single memcached node that is replicated 3 times (for I'm guessing redundancy?). You would use a configuration like:

https://github.com/memcached/memcached-proxylibs/blob/main/examples/basic-replicate.lua

I'll follow up tomorrow with a more complete example that uses the prefix routing (you seem to be routing 'pr_*" and nulling the rest). You'd probably use the same type of helm chart to generate the lua file. Just need to fill in the server list at the bottom there.

I haven't decided how to expand simple.lua's features yet, as I kind of need to hear from actual users like yourself. In this case it should do mostly what you want, but it doesn't spread gets across all three servers unless the first one fails, so I'll add some options for that.

@tomasAlabes
Copy link
Author

tomasAlabes commented Aug 15, 2023

@dormando, I've been trying with different variations and I can't make it work.

What I need:

  • By default, the item is set in 1 backend, defined by a hash function
  • Depending on the key prefix, have a particular behavior. For example, replicate it in more than 1 backend.
    • We use pr_myService#, pr_myOtherService#,...

My config:

local s = require("simple")

verbose(true)

router {
    router_type = "keyprefix",
    default_pool = "default",
    match_prefix = "pr_(%a+)#",
}

pool {
    name = "default",
    -- choose 1 backend with builtin hash function
    backends = {
        "memcached-0.memcached.cache.svc.cluster.local:11211",
        "memcached-1.memcached.cache.svc.cluster.local:11211",
        "memcached-2.memcached.cache.svc.cluster.local:11211"
    },
}

pool {
    -- example key = "pr_mySvc#whatever"
    name = "mySvc",
    -- replicate in all backends
    backends = {
        "memcached-0.memcached.cache.svc.cluster.local:11211",
        "memcached-1.memcached.cache.svc.cluster.local:11211",
        "memcached-2.memcached.cache.svc.cluster.local:11211"
    },
}
addkey pr_dmn#hello 0 60 3
CLIENT_ERROR parsing request

get some
SERVER_ERROR lua failure

set mykey 0 60 3
CLIENT_ERROR parsing request

set pr_dmn#hello 0 60 3
CLIENT_ERROR parsing request

I don't quite get the zones concept. But I tried with this config:

router {
    router_type = "keyprefix",
    default_pool = "default",
    match_prefix = "pr_(%a+)#",
}

pool {
    name = "default",
    -- choose 1 backend with builtin hash function
    backends = {
        "memcached-0.memcached.cache.svc.cluster.local:11211",
        "memcached-1.memcached.cache.svc.cluster.local:11211",
        "memcached-2.memcached.cache.svc.cluster.local:11211"
    },
}

pool {
    name = "dmn",
    -- replicate in all zones
    backends = { -- what should I put in backends? I'm forced by an error
        "memcached-0.memcached.cache.svc.cluster.local:11211",
        "memcached-1.memcached.cache.svc.cluster.local:11211",
        "memcached-2.memcached.cache.svc.cluster.local:11211"
    },
    zones = {
        z1 = {
            "memcached-0.memcached.cache.svc.cluster.local:11211",
        },
        z2 = {
            "memcached-1.memcached.cache.svc.cluster.local:11211",
        },
        z3 = {
            "memcached-2.memcached.cache.svc.cluster.local:11211"
        },
    },
}

Same errors with zones.
Also tried the basic configs, but triggered an NPE:

router {
    router_type = "flat",
}

pool {
    name = "default",
    backends = {
        "memcached-0.memcached.cache.svc.cluster.local:11211",
        "memcached-1.memcached.cache.svc.cluster.local:11211",
        "memcached-2.memcached.cache.svc.cluster.local:11211"
    },
}
router: overriding default for	router_type
making backend for... memcached-0.memcached.cache.svc.cluster.local:11211
making backend for... memcached-1.memcached.cache.svc.cluster.local:11211
making backend for... memcached-2.memcached.cache.svc.cluster.local:11211
setting up a zoneless flat pool
Failed to execute mcp_config_routes: ./simple.lua:284: attempt to index a nil value (global 'o')
setting up a zoneless flat pool
Failed to execute mcp_config_routes: ./simple.lua:284: attempt to index a nil value (global 'o')
setting up a zoneless flat pool
Failed to execute mcp_config_routes: ./simple.lua:284: attempt to index a nil value (global 'o')
setting up a zoneless flat pool
Failed to execute mcp_config_routes: ./simple.lua:284: attempt to index a nil value (global 'o')

@dormando
Copy link
Member

@tomasAlabes sorry! I was out sick.

That's unfortunate you're seeing some errors there, and also what you're trying to do won't work with simple.lua as I wrote it thus far. It sounds like you want some replicated and some non replicated clusters but simple can only do one or the other type.

Would you be open to a short chat on discord? (see link at https://memcached.org) - I'd like to either write a short config that does what you need to figure out how to adjust simple.lua. If not we can continue to discuss in this issue I'd just like to take less of your time. It's currently possible to do everything you need via the raw API, but not via any abstraction like simple, and the documentation is incomplete.

I'm still pushing for the polishing stage of this project. My current task is doing an adjustment to the raw API before creating a better route library. This is to avoid having to deal with back compat issues, and is probably a few weeks of work.

@tomasAlabes
Copy link
Author

Started the conversation in Discord :)

@dormando
Copy link
Member

@tomasAlabes I don't see any conversation in the discord. Did you join this one? https://discord.gg/4c4GDKk

@dormando
Copy link
Member

The build fix is now released in 1.6.22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants