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

Compiling for non-standard platforms #1705

Closed
Bob-The-Marauder opened this issue Aug 7, 2019 · 7 comments
Closed

Compiling for non-standard platforms #1705

Bob-The-Marauder opened this issue Aug 7, 2019 · 7 comments

Comments

@Bob-The-Marauder
Copy link

32 Bit Compilation

Riak will not build as is for a 32 bit platform. This comes down to an issue with perf_count.cc which can be found in the utils directory of leveldb. Strangely, there is a fix for this in commit basho/leveldb@b925432 that dates from 2017 but has not been implemented in the version chosen for the current build of KV. Fixing this will involve some tagging and referencing:

  1. The latest version of "Develop" https://github.com/basho/leveldb/blob/develop/util/perf_count.cc actually has this commit included, I would suggest that we either start with "Develop" and tag that as is or at least start with the current tagged version of leveldb https://github.com/basho/leveldb/blob/2.0.35/util/perf_count.cc , include the above commit in it and re-tag accordingly.
  2. Both https://github.com/basho/eleveldb/blob/develop-2.9/c_src/build_deps.sh and https://github.com/basho/eleveldb/blob/develop-3.0/c_src/build_deps.sh currently point to LEVELDB_VSN="2.0.35" on line 11. This would need to be updated to point at the new version of leveldb created in 1 and tagged accordingly.
  3. As eleveldb is referenced by rebar.config.lock, we'll have to update this as well to point to the right version of eleveldb that we created in 2. https://github.com/basho/riak/blob/develop-2.9/rebar.config.lock#L67-L69 and https://github.com/basho/riak/blob/develop-3.0/rebar.lock#L31-L33 accordingly.

ARM Compilation

Riak will not compile for ARM for the simple reason that nsprpub in erlang_js is ancient. The currently used v4.8 is about a decade old and does not support ARM. If we switch to a newer version as in basho/erlang_js#71 then we gain ARM support and can now compile successfully.

Amazon Compilation

For whatever reason, Amazon decided that they would change the name of the file in /etc from redhat-release to system-release and node_package is unable to handle this, thus preventing packages from being built for Amazon Linux without some manual adjustment. basho/node_package#220 can potentially fix this if applied.

@martincox
Copy link
Contributor

Before LevelDB is updated, there needs to be some due diligence in terms of understanding the delta between the current and proposed version.

@martincox
Copy link
Contributor

Also, pretty sure that node_package and erlang_js were earmarked for removing in 3.0.

@martinsumner
Copy link
Contributor

@martincox they are removed in 3.0, but will still be with us for 2.9.1.

Currently for the leveldb change I have cherry picked just the one commit (to do the 32-bit perf counters) on top of what was there already. That commit had been merged into develop, but I don't have the C++ skills to vouch for it - basho/leveldb@14c57fe.

I've added this leveldb commit into the private pre-release of 2.9.1, but I'm keeping it out of 2.9.0 patches at present.

@martinsumner
Copy link
Contributor

@Bob-The-Marauder

There is a pre-release tag to test to see if this builds OK for you - https://github.com/martinsumner/riak/tree/riak-2.9.1-pre3

@martinsumner
Copy link
Contributor

@martincox

As a general rule, I don't feel comfortable making changes to leveldb. I'd looked at removing it before (basho/riak#961), and I do think it might be worth investing some time in this soon.

@martincox
Copy link
Contributor

@martinsumner Same. I was making that comment for that very reason. We've run into issues in recent times and it's very difficult to debug leveldb without that knowledge.

@Bob-The-Marauder
Copy link
Author

I didn't realise this was still open. 32bit compilation has been confirmed on Raspbian Buster on 2.9.x and 3.0.x. Thank you for your help.

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

No branches or pull requests

3 participants