docker-library / memcached

Docker Official Image packaging for memcached
http://memcached.org/
BSD 3-Clause "New" or "Revised" License
132 stars 99 forks source link

v1.6.12 Docker Image? #71

Closed arnitolog closed 3 years ago

arnitolog commented 3 years ago

Hello,

any plans to create an image for Memcached 1.6.12?

tianon commented 3 years ago

Ah, good catch -- looks like the bot has been failing to compile:

In file included from cache.h:5,
                 from cache.c:11:
queue.h:40:10: fatal error: sys/cdefs.h: No such file or directory
   40 | #include <sys/cdefs.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:964: memcached-cache.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from cache.h:5,
                 from memcached.h:42,
                 from jenkins_hash.c:12:
queue.h:40:10: fatal error: sys/cdefs.h: No such file or directory
   40 | #include <sys/cdefs.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:838: memcached-jenkins_hash.o] Error 1
In file included from cache.h:5,
                 from memcached.h:42,
                 from slabs.c:10:
queue.h:40:10: fatal error: sys/cdefs.h: No such file or directory
   40 | #include <sys/cdefs.h>
      |          ^~~~~~~~~~~~~
In file included from cache.h:5,
                 from memcached.h:42,
                 from hash.c:3:
queue.h:40:10: fatal error: sys/cdefs.h: No such file or directory
   40 | #include <sys/cdefs.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
compilation terminated.
In file included from cache.h:5,
                 from memcached.h:42,
                 from memcached.c:16:
queue.h:40:10: fatal error: sys/cdefs.h: No such file or directory
   40 | #include <sys/cdefs.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
In file included from cache.h:5,
                 from memcached.h:42,
                 from thread.c:5:
queue.h:40:10: fatal error: sys/cdefs.h: No such file or directory
   40 | #include <sys/cdefs.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
In file included from cache.h:5,
                 from memcached.h:42,
                 from assoc.c:14:
queue.h:40:10: fatal error: sys/cdefs.h: No such file or directory
   40 | #include <sys/cdefs.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:866: memcached-slabs.o] Error 1
make[2]: *** [Makefile:810: memcached-memcached.o] Error 1
make[2]: *** [Makefile:824: memcached-hash.o] Error 1
make[2]: *** [Makefile:908: memcached-thread.o] Error 1
make[2]: *** [Makefile:894: memcached-assoc.o] Error 1
In file included from cache.h:5,
                 from memcached.h:42,
                 from stats_prefix.c:3:
queue.h:40:10: fatal error: sys/cdefs.h: No such file or directory
   40 | #include <sys/cdefs.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
In file included from cache.h:5,
                 from memcached.h:42,
                 from daemon.c:42:
queue.h:40:10: fatal error: sys/cdefs.h: No such file or directory
   40 | #include <sys/cdefs.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:936: memcached-stats_prefix.o] Error 1
In file included from cache.h:5,
                 from memcached.h:42,
                 from util.c:9:
queue.h:40:10: fatal error: sys/cdefs.h: No such file or directory
   40 | #include <sys/cdefs.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:922: memcached-daemon.o] Error 1
make[2]: *** [Makefile:950: memcached-util.o] Error 1
In file included from cache.h:5,
                 from memcached.h:42,
                 from items.c:2:
queue.h:40:10: fatal error: sys/cdefs.h: No such file or directory
   40 | #include <sys/cdefs.h>
      |          ^~~~~~~~~~~~~
compilation terminated.

I'll start working on a PR. :+1:

tianon commented 3 years ago

Adding bsd-compat-headers to get /usr/include/sys/cdefs.h gave me a bunch of the following:

/usr/include/sys/cdefs.h:1:2: error: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Werror=cpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~

Followed eventually by the inevitable:

cc1: all warnings being treated as errors

:sweat_smile:

@dormando looks like this was added in https://github.com/memcached/memcached/pull/809; any ideas/suggestions for how to get Alpine past this without just disabling -Werror (which feels kinda wrong)? :innocent:

tianon commented 3 years ago

Ironically, I was able to build successfully with sed -i -e '/cdefs/d' queue.h, so perhaps the #include ought to be conditional?

dormando commented 3 years ago

It's not clear to me if that cdefs include is necessary at all on any platform. I see it replaced with something to define NULL in the OpenBSD version of queue.h - so it may just be that it's there in case it's included very early or from another header. NULL certainly exists at the point in which we use it.

So I guess I'll just patch out the line?

dormando commented 3 years ago

Just pushed out a patch to next. will see if this passes my buildbots.

tianon commented 3 years ago

Awesome, sounds good! I'll go ahead with the hacky sed for now so we can get 1.6.12 out. :muscle: :heart:

tianon commented 3 years ago

Ended up applying your commit directly via https://github.com/docker-library/memcached/commit/2f7d163ec21401699a4f87e6e293b2ed45227598, which is I guess supporting evidence that it works correctly as you committed it. :smile: