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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore glibc specific code #1989

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

docteurklein
Copy link

@docteurklein docteurklein commented Nov 18, 2018

I got pipelinedb to compile on alpine 馃巿 馃嵏

here is the way I built it:

FROM alpine:edge as build

RUN apk add --no-cache postgresql-dev zeromq-dev curl make g++ libc-dev

#RUN curl -sL https://github.com/pipelinedb/pipelinedb/archive/1.0.0-6.tar.gz | tar xz
COPY pipelinedb-1.0.0-6 pipelinedb-1.0.0-6

RUN cd pipelinedb-1.0.0-6/ && \
    make USE_PGXS=1 && \
    make install

FROM alpine:edge

RUN apk add --no-cache postgresql zeromq-dev

COPY --from=build /usr/lib/postgresql/* /usr/lib/postgresql/
COPY --from=build /usr/share/postgresql/extension/* /usr/share/postgresql/extension/

EXPOSE 5432

ENV PGDATA=/var/lib/data/postgres
ARG LANG=en_US.utf8

RUN mkdir -p $PGDATA /run/postgresql /etc/postgres && \
    chown postgres:postgres $PGDATA /run/postgresql /etc/postgres

USER postgres

RUN pg_ctl initdb -o "--locale=$LANG"

CMD ["postgres",  "-c", "config_file=/etc/postgres.conf"]

COPY hba.conf /etc/postgres.hba
COPY postgres.conf /etc/postgres.conf

The server is booting, so i'm going to sleep now :)

Makefile Outdated
@@ -9,7 +9,7 @@ REGRESS = $(EXTENSION)

DATA = pipelinedb--1.0.0.sql
EXTRA_CLEAN = src/test/regress/expected/$(REGRESS).out src/test/regress/sql/$(REGRESS).sql
SHLIB_LINK += /usr/lib/libzmq.a -lstdc++
SHLIB_LINK += -lzmq -lstdc++ -fPIC
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

found this on #1773 (comment)
no idea what I'm doing

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this breaks the wanted static linking of libzmq in the extension, as I had to install zeromq-dev in the runtime env.

@@ -6,7 +6,9 @@
*
*-------------------------------------------------------------------------
*/
#ifdef GLIBC
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, not sure if that's even a good idea; found a similar fix in https://github.com/PowerDNS/pdns/pull/1958/files

@@ -126,6 +128,7 @@ ContQueryDatabaseMetadataSize(void)
void
debug_segfault(SIGNAL_ARGS)
{
#ifdef GLIBC
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe there is a way to find the "else" version for musl ?

Signed-off-by: Klein Florian <florian.klein@free.fr>
@docteurklein
Copy link
Author

docteurklein commented Nov 19, 2018

see #1692

@docteurklein
Copy link
Author

see #1578

@dimitar-nikovski
Copy link

Excellent, many thanks for this solution and the edits, I wish there was an alpine-ready version out of the box.

@binakot
Copy link

binakot commented Jun 15, 2019

Thanks for this work, @docteurklein!
It was really helpful for my docker image https://github.com/binakot/PostgreSQL-TimescaleDB-PipelineDB. I know that just disable backtrace is not the solution, but at least it works. This was enough https://github.com/binakot/PostgreSQL-TimescaleDB-PipelineDB/blob/master/Dockerfile#L75

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

Successfully merging this pull request may close these issues.

None yet

3 participants