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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpinelinux package #4437

Closed
yvann opened this issue Jun 22, 2015 · 34 comments
Closed

Alpinelinux package #4437

yvann opened this issue Jun 22, 2015 · 34 comments
Assignees
Milestone

Comments

@yvann
Copy link

yvann commented Jun 22, 2015

Hello everybody,

I'd like to know if someone's working on an Alpinelinux package ? I've started a topic on their forum : http://forum.alpinelinux.org/forum/general-discussion/rethinkdb-package

Alpinelinux is a very lightweight linux distribution used a lot in the docker ecosytem. https://www.alpinelinux.org/

Thanks for your help

@AtnNn
Copy link
Member

AtnNn commented Jun 22, 2015

From that thread:

./src/containers/buffer_group.hpp:13:9: error: 'ssize_t' does not name a type

That error might be fixed by adding #include <unistd.h>

If you really want it to be running on alpine, it's better to ask the developers to make it compatible with musl and recent gcc

The latest version of RethinkDB (2.0.3) should build with GCC 5.1 (#4264).

I've never tried building it with musl.

@AtnNn AtnNn added this to the backlog milestone Jun 22, 2015
@AtnNn
Copy link
Member

AtnNn commented Jun 22, 2015

I just tried building on Alpine Linux. These are the dependencies that are needed:

apk add g++ bash protobuf-dev protobuf-c python nodejs \
        icu-dev openssl-dev make wget curl-dev boost-dev \
        jemalloc-dev linux-headers

Building RethinkDB with

./configure --allow-fetch
make -k

Generates many errors. Most of them seem minor, such as missing isinf, isnan, int32_t and ssize_t.

Some of the errors are in code guarded by #ifdef _GNU_SOURCE. Replacing it with #if defined(_GNU_SOURCE) && !defined(__MUSL__) seems to work, but is inelegant. I wonder what the correct guard is.

The other class of errors I can see is caused by the lack execinfo.h.

@yvann
Copy link
Author

yvann commented Jun 25, 2015

Yes, it's not as easy as it looks like.

@AtnNn
Copy link
Member

AtnNn commented Jun 29, 2015

The android ndk also uses a different libc that has many of the same issues.

@clandmeter
Copy link

Musl libc does not have a MUSL macro:

http://wiki.musl-libc.org/wiki/FAQ#Q:_why_is_there_no_MUSL_macro_.3F

I'm bumping into this:

http://sprunge.us/iaeL

@AtnNn
Copy link
Member

AtnNn commented Jul 2, 2015

@clandmeter Replacing isinf with std::isinf might help.

@clandmeter
Copy link

im using this patch http://sprunge.us/IKRL

but still get the above errors.

@AtnNn
Copy link
Member

AtnNn commented Jul 3, 2015

@clandmeter Those errors are expected, and I don't know how to solve them. You might try changing #include <math.h> to #include <cmath>, you might need to upgrade musl, libstdc++ or gcc or you might need to define isinf yourself.

@AtnNn
Copy link
Member

AtnNn commented Jul 4, 2015

With this patch, dbc7e8b, I was able to compile and run RethinkDB in an Alpine Linux 3.2.0 schroot.

I had to install libexecinfo 1.1 from http://nl.alpinelinux.org/alpine/edge/testing/x86_64/ and do:

$ apk add g++ bash protobuf-dev protobuf-c python nodejs \
          icu-dev openssl-dev make wget curl-dev boost-dev \
          jemalloc-dev linux-headers findutils coreutils \
          grep tar gzip
$ ./configure --allow-fetch LDFLAGS=-lexecinfo
$ make
$ build/release/rethinkdb

@clandmeter
Copy link

OK, ive made it compile and added it to our testing repo. I had to disable it because our buildservers are running grsec kernels. I will have to build it local with grsec enabled to check which bins i need to paxmark.

http://git.alpinelinux.org/cgit/aports/tree/testing/rethinkdb

Would be nice if the patch can be integrated into rethinkdb? Maybe it needs some cleanup or defs.

Also errors.cc gives me:

src/errors.cc: In function 'const char* errno_string_maybe_using_buffer(int, char_, size_t)':
src/errors.cc:91:22: error: invalid conversion from 'int' to 'const char_' [-fpermissive]
return strerror_r(errsv, buf, buflen);
^
src/build.mk:396: recipe for target 'build/release_system/obj/errors.o' failed

@AtnNn AtnNn self-assigned this Jul 4, 2015
@AtnNn AtnNn modified the milestones: 2.1, backlog Jul 4, 2015
@AtnNn
Copy link
Member

AtnNn commented Jul 4, 2015

Are you still unable to compile src/errors.cc after replacing #ifdef _GNU_SOURCE with #ifdef __GLIBC__ ?

@clandmeter
Copy link

Yes is am, i just didnt know this was the right way to fix it.
Package is now in testing: http://nl.alpinelinux.org/alpine/edge/testing/x86_64/rethinkdb-2.0.3-r0.apk

btw, it isnt possible to use more external libs? I tried to let is use re2 but it keeps using the provided one.

@AtnNn
Copy link
Member

AtnNn commented Jul 5, 2015

It's great to see an Alpine Linux package. I'll try to get your patches merged for RethinkDB 2.1.

I would recommend using the system's version of all libraries except for v8 and re2, partly because their functionality is directly exposed through the query language. Using a different version could change the semantics of some queries. Also, both libraries use rolling releases which are hard to track.

@danielmewes danielmewes modified the milestones: 2.1-polish, 2.1 Jul 15, 2015
@yvann
Copy link
Author

yvann commented Aug 11, 2015

Any news about the merge :) ?

@danielmewes
Copy link
Member

Sorry this didn't make it into 2.1.0. @AtnNn what's the status of this?
We might be able to get it into a point release.

@danielmewes danielmewes modified the milestones: 2.1.x, 2.1-polish Aug 11, 2015
@AtnNn
Copy link
Member

AtnNn commented Aug 11, 2015

@danielmewes There is an alpine linux package. The downstream patch looks good to me, and could be merged if it doesn't break the build on other platforms, which I never got around to do. You might also want a CLA.

http://git.alpinelinux.org/cgit/aports/plain/testing/rethinkdb/musl-fixes.patch

@danielmewes
Copy link
Member

I see. I'll try this out on our build system to see if it builds on all supported platforms.

@yvann have you signed http://www.rethinkdb.com/community/cla/ ? For legal reasons, we require this CLA before we can merge patches into the main code base.

@danielmewes danielmewes assigned danielmewes and unassigned AtnNn Aug 14, 2015
@yvann
Copy link
Author

yvann commented Aug 17, 2015

@danielmewes The PR is not mine :)

@danielmewes
Copy link
Member

Sorry, I meant @clandmeter :-)

@danielmewes danielmewes modified the milestones: 2.2-polish, 2.1.x Oct 5, 2015
@danielmewes danielmewes modified the milestones: 2.3, 2.2-polish, 2.3-polish Nov 16, 2015
@lostinplace
Copy link

is there progress on this?

@danielmewes
Copy link
Member

I haven't looked into this since my last post here. The compilation issue on OS X is still present and we can't merge the patch yet.

I'll look into it now and see if there's an easy fix.

@danielmewes danielmewes modified the milestones: 2.2.x, 2.3-polish Feb 6, 2016
@danielmewes
Copy link
Member

Actually this is compiling fine on next, but not on v2.2.x. I suspect this might be because of independent changes that @AtnNn made to make RethinkDB compile on Windows.

I'll apply the patch to next, so it's going to be included in RethinkDB 2.3.0.

@danielmewes danielmewes modified the milestones: 2.3, 2.2.x Feb 6, 2016
@danielmewes
Copy link
Member

The patches are applied in branch next as of commit 84be09f.
Thanks @clandmeter !

@dalanmiller
Copy link
Contributor

@clandmeter related to this, I'd like to continue to keep RethinkDB working on Alpine Linux mostly for the official Docker image. Have you kept up to date on this?

@1ma
Copy link

1ma commented Jul 27, 2016

Hi @dalanmiller.

Since your profile states that you are a pythonista and a RethinkDB evangelizer to boot, maybe you can help me out with the issue I just referenced above :)

@dalanmiller
Copy link
Contributor

Thanks for the ping @1ma, I'll comment over there.

@pdonorio
Copy link

Hey all,
I am working on building the latest rethinkdb (2.3.5) on alpine with Docker. I managed to make it work with this dockerfile and would like to give a contribution here.

A few thoughts and questions:

  • I couldn't use the edge version of alpine for all the packages since alpine left openssl in favour of libressl, and I get conflicts. https://news.ycombinator.com/item?id=12691733
  • build is very slow and it breaks the public docker hub timeout :/ so no automatic builds
  • How do I make a package for alpine? I saw here that @AtnNn managed to do so, but I have no clue on how to help. Also if there is eventually a way to build it not in the official alpine repo.

@pdonorio
Copy link

Hi,
could anyone take a quick look a my proposal for the alpine package / docker image and leave me comment?

Thanks

@srh
Copy link
Contributor

srh commented May 13, 2017

What is your proposal?

@srh
Copy link
Contributor

srh commented May 13, 2017

I guess what I am asking is, what can we do for you?

@pdonorio
Copy link

Hi @srh thanks for replying. Basically I just wanted to help and did not receive any hint.

I had a draft of building the latest rethinkdb on alpine linux with Docker. Is almost one years old now and should be refreshed. At the time I wrote it the alpine package for rethinkdb was not updated, while if I do now I get rethinkdb-2.3.5-r7.pre-install.

A few questions maybe you may answer:

  1. Is this package the official alpine package or is it a beta/improvable version?
  2. Do you have a documentation for building rethinkdb on alpine?
  3. Could my Docker image be useful in anyway, as a docker image or as documentation for building on alpine?
  4. Could this also be useful for having an alpine package for rethinkdb? If yes, how do you do it?
  5. Am I doing things the right way? If not, could you guide me on make it better?

Thank you for any suggestion

@AtnNn
Copy link
Member

AtnNn commented May 14, 2017

This issue is closed. There is a rethinkdb package for alpine linux: https://pkgs.alpinelinux.org/package/v3.5/community/x86_64/rethinkdb

If you have any more questions, please use the mailing list or slack, or open a new issue if they seem relevant to this repo.

I don't know of any instructions or tutorial for building RethinkDB on alpine linux. We keep our documentation for building rethinkdb on different platforms here:

https://github.com/rethinkdb/docs/tree/master/0-getting-started/install

It would be useful if you could add a page for alpine linux.

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

No branches or pull requests

9 participants