-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fixes for porting to FreeBSD #688
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
Conversation
|
This is awesome! Does it build and run on FreeBSD? I'm going to try it out today. |
|
@hungte, could you please fill out our contributor agreement form (www.rethinkdb.com/community/cla/)-- you only have to do it once. Thanks for the pull request! |
|
atnnn> Yes it does. See my comment in commit 2cd2c77 - verified with 1.4.3 on FreeBSD 9, with pre-compiled web. mglukhovsky> I'm a little concerned about the Travis build failure above - not sure if I've broken anything for Linux, or if it's temporary failure not related to my patches. Maybe I should get a Linux box and have a try... |
|
The Travis failure seems not related to this patch since other people are seeing same failure. Updated some build env changes so that LIBRARY_PATHS and -I/usr/local/include -D__STDC_LIMIT_MACROS are no longer required. Step to test updated in commit 1539e00 description. Note there is no freebsd "ports" yet, so you still need to manually install all dependency stuff, or using precompiled web assets (which is a lot easier) |
|
I got it to work. Thanks for your efforts :D It's nice to see all your commits, you seem to know what you are doing very well. Here are the dependencies I had to install on FreeBSD 9.1: I tried with gcc48, but there seemed to be a lot of #include's missing, so I stuck with clang. I had a few troubles getting the test suite to run, I put a few changes in 6fe0a1a. I only saw four unit tests fail: ClusteringBranch.Backfill: RPCDirectoryTest and RPCMailboxTest: And the SnapshotsTest took too long, so I killed it. |
|
I've changed "Fix stack_t.ss_sp type difference for FreeBSD." to a better implementation by typeof. |
|
@AtnNn Of course - we should pass unit tests to make sure nothing is broken -- although maybe some failures are already in current master branch... |
|
To run the tests in debug mode, I had to patch gtest to get the tests to build: 6fe0a1a |
|
The failures in our next branch on travis are due to the python driver tests. All the unit tests currently pass. |
|
@hungte -- wow, this rocks! Thank you for the contribution! @AtnNn, @al3xandru -- if this makes it into 1.5, we should * definitely* add docs for it, and point it out in the changelog and announcement. I'm slating it for 1.5 for now, feel free to take out if it doesn't make it (but pretty please, could it make it? :-D) |
|
@AtnNn -- our tests are now fixed (at least the errors that showed up here). Could we retest and merge? |
|
@coffeemug the tests need to pass on both Travis and FreeBSD before we can safely merge this. On Wednesday our sprint will be over and I'll take a closer look at why they are failing. |
|
Hey @hungte, just wanted to let you know that we're super-excited about getting FreeBSD support in, but we're also in the midst of shipping 1.5. We're working to figure out what needs to be done to get tests pass. Thanks for your patience! |
|
Hey @hungte, thanks for the great work here. I'm not sure whether this issue is FreeBSD specific or not but it fails for me due to a missing directory (drivers/javascript/build). Creating it manually first solves the issue and I have it compiling successfully on 9.1. Edit: Actually, just building again for a local Vagrant box and remembered some additional steps I needed, I had to symlink /usr/local/bin/bash to /bin/bash and use |
This is fine unless we do clone(2) with CLONE_THREAD flag.
|
Hi @kudos, Added a commit to fix drivers/javascript/build ( c9606b3 ). For /bin/bash, applying atnnn's patch may help (or after you rebase). Do you remember where you failed without --lib-path /usr/local/lib? I added /usr/local/lib in one mk file but maybe there's somewhere else (ex, some drivers or modules that I didn't build) to be modified... |
|
After rebasing to latest "next" branch, I keep seeing "no std::move' error that is probably caused by c++11 related stuff, or libc++. It's fixed on MacOSX, but I haven't found a good solution for FreeBSD yet. So I revised the commits to work with gcc48 and made it built successfully again :) |
|
The error I get on ./configure without using --lib-path looks like: I'll try building from your latest commit later today. |
|
@coffeemug Yes it is (not searching /usr/local/lib by default). |
|
What are we planning to do once we merge this in to make sure we don't break FreeBSD compilation? Can we get an automated test going for it? |
Yes, good idea |
Protoc-js does not always create folder for given output path. We need to create it explicitly in build procedure.
When using clang3.1/-std=c++0x, the casting of NULL will cause error: reinterpret_cast from 'nullptr_t' to 'memcached_value_t *' is not allowed. For c++11, NULL (nullptr) is defined as nullptr_t and should not be re-casted to other pointer types.
install(1) on FreeBSD does not allow reading file content from /dev/stdin, so we must create a real file in build directory before calling install.
Required by boost library.
The C++ ABI v1 on FreeBSD 9.x clang is different with GCC 4.x ABI v1.
Requires FreeBSD 9.1 (clang 3.1+) and the libc++ from /usr/src/lib/libc++.
For systems using ldconfig with different syntax (ex, FreeBSD or MacOSX), we need to fallback LD path to defaults.
Tested on FreeBSD 9.1 with following steps: # For dependency pkg_add -r wget protobuf protobuf-c v8 openjdk7 boost-all gmake pkg_add -r bash node npm py-yaml gcc48 npm install -g less coffee-script handlebars # To build with GCC48: CXX=gcc48 ./configure --ccache # Edit config.mk to add "ALLOW_WARNINGS := 1" # To build with system clang 3.1: CXX=clang ./configure --ccache # You have to install system libc++ by: # cd /usr/src/lib/libc++; sudo make install # Then edit config.mk to add "ALLOW_WARNINGS := 1" # To build gmake
|
Added some fixes so clang3.1/c++11 (need the libc++ in FreeBSD 9.1 source tree) won't fail to build. |
|
@hungte I have a freebsd VM open, I'll try to help you with this branch today. |
|
I rebased this onto next and added a few patches in the It builds with ./configure CXX=g++47 --static none --without-tcmalloc --ccache CXXFLAGS='-std=c++11'
gmakeBut fails to run |
|
With DEBUG=1, the server runs and the web ui works. Simple operations like insert fail. Here are all the failing unit tests: https://gist.github.com/atnnn/dcbccf0bc39349d1820f |
|
Someone who is more familiar with the code failing in these tests should take a look at this. |
|
Unless some part of the networking isn't working properly, from what I can see these failure might just have to do with timing issues (heartbeat timeouts) in the tests, and the unit tests not being prepared for those. |
|
I merged next into @AtnNn's freebsd branch. If I compile in release mode, there now is a problem with hostname lookup. This is probably because a lot of that code has changed, and needs to be adapted to FreeBSD. |
|
None of us use FreeBSD and we don't have the resources to keep this branch up-to-date. @hungte hopefully we can resurrect it some day. |
A few commits to allow compiling on FreeBSD, verified on FreeBSD 9 with clang.