Closed gitHusband closed 4 years ago
I fix libhashkit/common.h in my computer and then I can make successfully.
#ifndef __WORDSIZE
# ifdef __MINGW32__
# define __WORDSIZE 32
+ # else
+ # define __WORDSIZE 64
# endif
#endif
Thank you, @gitHusband!
Patched master could be faultless build on Ubuntu 18.04 with gcc
7.5.0.
Thank you, @gitHusband! Patched master could be faultless build on Ubuntu 18.04 with
gcc
7.5.0.
It's my pleasure. Would you fix the two bugs when you have time? @p-alik
Yes, I'll do that.
Cool! Thanks!
Using a modified bootstrap.sh
and libhashkit/common.h
, I was able to bootstrap, build, and test. Here's the Dockerfile I used:
FROM alpine
MAINTAINER gearmand
# Install packages
RUN apk add musl-dev gcc g++ autoconf automake m4 git libtool make bash py3-sphinx \
file util-linux-dev libuuid libevent-dev gperf boost-dev openssl-dev
# Switch to non-root user
RUN adduser --disabled-password --shell /bin/bash gearman
USER gearman
ARG GEARMAN_REPO=https://github.com/gearman/gearmand
RUN cd /tmp && git clone --depth 1 --branch master ${GEARMAN_REPO}.git
WORKDIR /tmp/gearmand
COPY bootstrap.sh /tmp/gearmand/
COPY common.h /tmp/gearmand/libhashkit/
RUN ./bootstrap.sh -a
RUN ./configure --enable-ssl 2>&1 | tee ./configure.log
RUN make 2>&1 | tee ./build.log
RUN make test 2>&1 | tee ./test.log
Here are the diffs on my bootstrap.sh
just for comparison:
--- /path/to/github/gearmand/bootstrap.sh 2019-11-27 17:02:43.416800000 -0500
+++ ./bootstrap.sh 2020-07-30 18:51:38.209550000 -0400
@@ -194,6 +194,9 @@
opensuse*)
VENDOR_DISTRIBUTION='opensuse'
;;
+ alpine)
+ VENDOR_DISTRIBUTION='alpine'
+ ;;
*)
die "attempt to set an invalid VENDOR_DISTRIBUTION=$dist"
;;
@@ -263,6 +266,9 @@
opensuse)
VENDOR_RELEASE="$release"
;;
+ alpine)
+ VENDOR_RELEASE="$release"
+ ;;
unknown)
die "attempt to set VENDOR_RELEASE without setting VENDOR_DISTRIBUTION"
;;
@@ -273,13 +279,16 @@
}
-# Valid values are: apple, redhat, centos, canonical, oracle, suse
+# Valid values are: apple, redhat, centos, canonical, oracle, suse, alpine
set_VENDOR ()
{
local vendor
vendor="$(echo "$1" | tr '[:upper:]' '[:lower:]')"
case $vendor in
+ alpine)
+ VENDOR='alpine'
+ ;;
apple)
VENDOR='apple'
;;
@@ -372,6 +381,10 @@
# shellcheck disable=SC1091
source '/etc/lsb-release'
set_VENDOR 'canonical' "$DISTRIB_ID" "$DISTRIB_CODENAME"
+ elif [[ -f '/etc/alpine-release' ]]; then
+ local alpine_version
+ alpine_version="$(cat /etc/alpine-release)"
+ set_VENDOR 'alpine' 'alpine' "$alpine_version"
fi
rebuild_host_os
Hope this helps!
@esabol, could you put the snippets in a PR, please?
Regarding libhashkit, it's a part of geamand
and libmemcached.
geamand
version of the lib is a bit elder. For instance update_continuum
seems to be useless
08:34 $ git grep update_continuum
libhashkit/common.h:/* int update_continuum(hashkit_st *hashkit); */
libhashkit/ketama.cc:int update_continuum(hashkit_st *hashkit)
Removing update_continuum
from libhashkit/common.h
appears to be harmless. The remaining md5_signature
seems to be alike libhashkit_md5_signature
git grep "md5_signature(const"
libhashkit-1.0/algorithm.h:void libhashkit_md5_signature(const unsigned char *key, size_t length, unsigned char *result);
libhashkit/algorithm.cc:void libhashkit_md5_signature(const unsigned char *key, size_t length, unsigned char *result)
libhashkit/common.h:void md5_signature(const unsigned char *key, unsigned int length, unsigned char *result);
libhashkit/md5.cc:void md5_signature(const unsigned char *key, unsigned int length, unsigned char *result)
Wouldn't replacement of md5_signature
by libhashkit_md5_signature
make libhashkit/common.h
obsolete?
Wouldn't replacement of md5_signature by libhashkit_md5_signature make libhashkit/common.h obsolete?
I think libhashkit has been copied here from another project (libmemcached?). If so, I think it makes sense to just keep it as it is in order to facilitate comparisons with the upstream codebase.
I think libhashkit has been copied here from another project (libmemcached?)
@dormando, @BrianAker, could you share your knowledge regarding libhashkit
. Would you recommend to keep it in gearmand code base?
If so, I think it makes sense to just keep it as it is in order to facilitate comparisons with the upstream codebase.
I'm of the opposite opinion because:
gearmand
version of libhash
since migration from https://code.launchpad.net/gearmandlibhash
we could get rid of bunch of redundant code and issues with regard to libhash
$ wc -l `find libhashkit -name "*.cc"`|tail -n1
4564 total
@p-alik: Looking through the code, it appears to me that libhashkit_md5_signature
is the C++ interface and md5_signature
is the C interface. Am I understanding that correctly?
Are you also saying libhashkit_md5_signature
is the only routine used by gearmand? And the memcached plugin doesn't use it either? If so, you make a convincing case.
@p-alik: Looking through the code, it appears to me that
libhashkit_md5_signature
is the C++ interface andmd5_signature
is the C interface. Am I understanding that correctly?
libhashkit_md5_signature
andmd5_signature
are mostly equal.
Yeah, I saw that, but one is in an extern "C"
block and the other one isn't. I suspect one is the public (external) interface and the other is the private (internal) implementation of the public interface. In other words, I do not think anyone is supposed to use md5_signature
and only libhashkit_md5_signature
is supposed to be used. (I don't actually know this. I'm just inferring.)
Are you also saying
libhashkit_md5_signature
is the only routine used by gearmand? And the memcached plugin doesn't use it either?It seems there is very limited demand for
libhashkit
at all. But I'll check it accurately.
I see it's used by libgearman. If you eliminate it, that will change the symbols in libgearman.so
, I think? And that will require bumping version numbers on libgearman.so
, right?
Can you please confirm whether or not master builds for you on Alpine now?
Can you please confirm whether or not master builds for you on Alpine now?
My Docker image of the master branch builds and tests fine:
FROM alpine
MAINTAINER gearmand
# Install packages
RUN apk add --no-cache \
musl-dev gcc g++ autoconf automake m4 git libtool make bash file \
py3-sphinx util-linux-dev libuuid libevent-dev gperf boost-dev \
openssl-dev
# Switch to non-root user
RUN adduser --disabled-password --shell /bin/bash gearman
USER gearman
ARG GEARMAN_REPO=https://github.com/gearman/gearmand
RUN cd /tmp && git clone --depth 1 --branch master ${GEARMAN_REPO}.git
WORKDIR /tmp/gearmand
RUN ./bootstrap.sh -a
RUN ./configure --enable-ssl 2>&1 | tee ./configure.log
RUN make 2>&1 | tee ./build.log
RUN make test 2>&1 | tee ./test.log
============================================================================
Testsuite summary for gearmand 67407a4
============================================================================
# TOTAL: 35
# PASS: 26
# SKIP: 7
# XFAIL: 2
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================
Cool, I can build Docker Alpine image of the master branch successfully now. Thanks! @SpamapS @p-alik @esabol
Hi!
I got some problem when I tried to build gearmand in Docker-Alpine(gcc v9.3.0).
As you know, when build gearmand with version 1.1.91.1 and below, there has a bug which was fixed in #289.
error: 'environ' was declared 'extern' and later 'static' [-fpermissive]
So I try to build master.
There are two bugs for now:
git clone https://github.com/gearman/gearmand && cd gearmand && ./bootstrap.sh -a
,got an error:
./bootstrap.sh:317: An attempt was made to set an invalid VENDOR=alpine
You may need to fix this bug. But I can do these things using CentOS and then clone the codes into Docker-Alpine, so I can make it in Alpine../configure
-- done!make
- Bug occurred:Can you please help to fix these bugs? Thanks!