-
Notifications
You must be signed in to change notification settings - Fork 13
Support big-endian builds #2
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
Bryan Chan on dev@couchdb.apache.org replies: Hello CouchDB developers, I am new to the list; please be gentle. :-) I created a pull request on GitHub yesterday (see below) for a relative= FWIW I have also sent a pull request for the same change to the upstrea= Thanks, BryanBryan Chan bryanpkc git@git.apache.org wrote on 2015-02-17 01:22:02 PM: |
@bryanpkc nice one! Is there a way to add a test case for this? |
Jan Lehnardt on dev@couchdb.apache.org replies: thanks for your contribution! :) You already followed the regular process! The one thing that=E2=80=99s = Best Janrelatively |
rebar.config.script
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't the search of port_env
be replaced by lists:keyfind(port_env, 1, CONFIG)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kxepal I am fairly new to Erlang so I probably wasn't writing the smartest code. I have rewritten the script to use lists:keyfind and avoid the fun. Does it look better now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better and, what's important, more friendly for reading by humans (:
@kxepal yeah I imagine, and we probably don’t want to re-shuffle the code so you can inject endianness from the tests. Maybe we can have a test that only runs on BE hosts? I just feel bad accepting code without any tests :) |
@janl me too, especially such that we cannot test even manually during regular build process. I believe @bryanpkc made these changes because he is able to test it IRL, If he would help us with testing (and even packaging) for big endian hosts that would be awesome. This situation is the same as our Windows support where there are no actual tests, but group of people who cares about compatibility with that system. And that's still extremely helpful. So, @bryanpkc how do you feel about such sort of help? (: |
@bryanpkc ongoing: whenever we make a release, run Ideally we’d have a big endian CI box. I haven’t looked at this at all, but would it be possible to emulate a big endian system on a little endian host using some sort of virtualisation? If not, would a Raspberry Pi do? We could hook one into our Jenkins :) |
@janl with qemu it's possible to emulate different endian. Raspberry PI IIRC is a bi-endian, but little one is preferred. |
@janl OK, that doesn't sound too bad. I could certainly help with testing that way for now. I am checking if we could help with CI on our hardware, but I cannot promise anything at the moment. @kxepal, I haven't tried it but I read that the Raspberry Pi is bi-endian, like a few other ARM processors that I have used. The question is whether there is a big-endian OS image for it. Maybe qemu on the Raspberry Pi is the way to go. |
@bryanpkc quick googling showed me this one: https://people.debian.org/~aurel32/qemu/ || http://www.aurel32.net/info/debian_mips_qemu.php Much likely there are the others in the wild. |
we have some CI hardware, would qemu running there would help? |
theoretically...yes, need to try. |
rebar.config.script
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can actually avoid temp variable P
by using list:keyfiend
expression directly in case.
just a note that I think the CI test discussion here is not blocking merging this in |
All good. At least it doesn't breaks anything (: @bryanpkc please squash all your commits, remove trailing space from there:
and let's wait for a while to see what others think about. |
All commits squashed, trailing space removed. Thanks for the review. |
@janl I have briefly looked at Travis CI; it seems to support only Ubuntu as a build environment. Will it work with Debian? There isn't a Ubuntu build for s390x yet, AFAIK. |
@bryanpkc I don’t think Travis is gonna help with running anything but their stock environment, but we have a Jenkins setup that we can use. |
merged! |
Google snappy's configure script defines WORDS_BIGENDIAN in config.h if it detects that the build machine is big-endian. rebar should do the same when building the C++ code for this NIF. This patch allows CouchDB to be built and run on big-endian Linux systems, e.g. ppc64, s390x, etc.