Issue #293: Bootstrap on Alpine#296
Merged
SpamapS merged 1 commit intogearman:masterfrom Aug 27, 2020
Merged
Conversation
Member
Author
|
Dockerfile I used for testing: FROM alpine:latest
# Install packages
RUN apk add --no-cache \
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/esabol/gearmand
RUN cd /tmp && git clone --depth 1 --branch issue-293-bootstrap-on-alpine-redux ${GEARMAN_REPO}.git
WORKDIR /tmp/gearmand
RUN git reset --hard 6fe74214a68367f95467df970038237c5e44b5d7
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.logIt bootstraps and builds fine. All tests pass. |
SpamapS
approved these changes
Aug 27, 2020
Member
SpamapS
left a comment
There was a problem hiding this comment.
I do wish we had some CI for Alpine, to lock this in.
Member
Author
It’s on my to-do list, along with macOS. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses issue #293 and adds support for bootstrapping on Alpine Linux.
I did some additional research into
__WORDSIZE, and what I saw was a confusing mess, as usual whenever I seem to look into C preprocessor macros. I saw a lot of recommendations to use__BITS_PER_LONGorBITS_PER_LONGorLONG_BITSinstead. Plus a whole host of other methods. I eventually came across this Alpine patch for libmemcached:https://git.alpinelinux.org/aports/plain/main/libmemcached/musl-fixes.patch
That at least gave me confidence to add some checks for
LONG_BITS. Should I add__BITS_PER_LONGorBITS_PER_LONGtoo? Am I overcomplicating this? Probably!And I think you need to
#include <limits.h>. I didn't see an#includefor that, but maybe I missed it somewhere. Anyway, I added it, mainly because the above Alpine patch also had it. What do you think?References:
https://www.linuxquestions.org/questions/programming-9/c-preprocessor-define-for-32-vs-64-bit-long-int-4175658579/
https://www.google.com/search?q=c+preprocessor+detect+%22wordsize%22+site:stackoverflow.com