-
Notifications
You must be signed in to change notification settings - Fork 139
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
Build in Alpine #293
Comments
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! |
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 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 --- /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?
Removing
Wouldn't replacement of |
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. |
@dormando, @BrianAker, could you share your knowledge regarding
I'm of the opposite opinion because:
|
@p-alik: Looking through the code, it appears to me that Are you also saying |
Yeah, I saw that, but one is in an
I see it's used by libgearman. If you eliminate it, that will change the symbols in |
Can you please confirm whether or not master builds for you on Alpine now? |
#295 provided successful build on Alpine |
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
|
Remove libhashkit subdirectory and use instead officially by libmemcached provided hashkit http://docs.libmemcached.org/hashkit_functions.html See discussion in issue gearman#293 (comment)
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!
The text was updated successfully, but these errors were encountered: