Expensify / Bedrock

Rock solid distributed database specializing in active/active automatic failover and WAN replication

Home Page:https://bedrockdb.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Won't compile on MacOSX

quinthar opened this issue · comments

Problem:

Ideally you could use the instructions outlined here: https://github.com/Expensify/Bedrock/blob/dbarrett_osxCompile/docs/index.md

# Clone out this repo:
git clone https://github.com/Expensify/Bedrock.git

# Install some dependencies with Brew (see: https://brew.sh/)
brew update
brew install gcc@6
brew install pcre

# Build it
cd Bedrock
make

# Create an empty database (See: https://github.com/Expensify/Bedrock/issues/489)
touch bedrock.db

# Run it (press Ctrl^C to quit, or use -fork to make it run in the backgroud)
./bedrock

# Connect to it in a different terminal using netcat
nc localhost 8888

# Type "Status" and then enter twice to verify it's working
# See here to use the default DB plugin: http://bedrockdb.com/db.html

However it breaks in at least two ways:

  • make doesn't clone the subrepo for some reason
  • make fails with PCRE:
    Undefined symbols for architecture x86_64:
      "pcrecpp::RE::Init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, pcrecpp::RE_Options const*)", referenced from:
          pcrecpp::RE::RE(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libstuff.a(libstuff.o)
          pcrecpp::RE::RE(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libbedrock.a(Jobs.o)
          pcrecpp::RE::RE(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, pcrecpp::RE_Options const&) in libbedrock.a(MySQL.o)
    ld: symbol(s) not found for architecture x86_64
    

Solution:

To fix:

  1. Check out a fresh copy of dbarrett_osxCompile
  2. Follow the instructions
  3. If something breaks, fix, goto 1
  4. If the instructions need to be updated, do so in the branch
  5. Submit a PR

FYI, anyone who wants to take this issue, there's some money in it for you! https://www.upwork.com/jobs/~01e7ad7e026a20a5e1

@quinthar to fix the PCRE thing, in the past brew install pcre fixed it. Is that still the case or not?

I can resolve this issue, my suggestion is move your build system into CMake after that your life will be more easy.

It will be solve a lot of issues in future.