Building FoundationDB on macOS with Homebrew

In case you need to build FoundationDB on macOS without the upstream-provided Docker build container, here’s how to do it!

Note: These instructions assume that you have Homebrew installed under the default /usr/local path. Make sure to update the paths below if you’ve installed somewhere else.

# Install dependencies.
$ brew update && brew install python mono ninja boost openssl@1.1

# fdbuild will hold all of the ninja/cmake intermediate artifacts.
$ mkdir fdbuild && cd fdbuild

# Tip: You may want to checkout a release branch.
$ git clone git@github.com:apple/foundationdb.git

# This will generate the ninja/cmake configs your build.
# Tip: Make sure to check for errors/warnings!
$ Boost_INCLUDE_DIR=/usr/local/Cellar/boost/1.72.0_3/include \
  OPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1 \
  cmake \
    -DPython3_EXECUTABLE=/usr/local/Cellar/python/3.7.7/bin/python3.7 \
    -G Ninja \
    foundationdb/
# Build!
$ ninja

As per the Compiling from Source section of the FoundationDB README, this build is memory hungry! You may need to “ninja -j1” to reduce the overhead, at the expense of compile time.

Mountain Lion observations so far

As some of the software I use on my Macbook Pro now requires at least10.7, I had to retire my trusty Snow Leopard a few weeks ago. After a few weeks of using Mountain Lion, I’ve got things mostly straightened out to where I’m productive again. A few random observations:

The Good

  • I appreciate being able to download the 10.8 upgrade digitally, and open it directly on the desktop like any other application. This is easy enough for most people to figure out quite easily.
  • Things do seem a little more snappy on my mid-2010 MBP. Nothing drastic, but less beachball-of-despair.
  • After getting spoiled by Ubuntu’s Unity notifications, it’s really nice to see Apple implement something similar. Gave me an excuse to uninstall Growl.
  • Being able to grab the XCode suite from the App store is more convenient than having to mess around with Apple’s funky developer site.

The Bad

  • The reversal of the default scroll direction upgrading an existing 10.6 install, was very abrupt and unnecessary. For upgrades, they should probably preserve the old settings when possible. Sometimes software companies do stuff just to be different for the hell of it. I get the sense that this was one such example of this behavior. It doesn’t make life better or easier. This got set back to the original behavior.
  • The auto-hiding of scrollbars was similarly unecessary. Vertical space is at a premium with these laptop monitors, but there is loads of horizontal space. I really like being able to see how far into something I am without doing any goofy finger tapping, so this ended up getting set back to “Scrollbars always visible.” Here’s how to make them stay visible.
  • The “overscroll” bouncing when scrolling past a page’s top or bottom limits is strangely disconcerting on a desktop OS for me. I’m not sure why I dislike it so much, but I find it jarring. Maybe if it bounced less. Here’s how to disable it.

The Ugly

  • The 10.8 install completely flips its shit when encountering Linux partitions, to the point where you can’t proceed with installation. There are various ways to attempt to fix this, but I eventually ended up sacrificing the Linux partitions temporarily. Bummer. Some people have figured out how to correct the various errors you get here, but this wasn’t quite worked around on day 1 when I upgraded.

Snow Leopard 10.6.0 client DNS problems

It would appear that Snow Leopard 10.6.0 has an issue with client-sideDNS resolution. Symptoms include erratic resolution of domain names from local network DNS servers for any command or application using gethostbyname(). However, using the host or nslookup commands resolve things correctly.

The current best resource for this issue is a thread on the Apple support forums. There are all kinds of suggestions as to what the problem is and all kinds of voodoo fixes, though none have been found to work for most (or all). I’d hold off on attempting these untill 10.6.1 rolls out, which will be in the near future.

In the meantime, i’d suggest using your /etc/hosts file for must-have names. Keeping an eye on that thread may shed further light on the situation as the problem is investigated in greater detail.

EVE Online on Snow Leopard

After a few hours of play, it seems like EVE on Snow Leopard brings anoticeable improvement on several fronts. First and foremost, there is a definite increase in framerate and performance with multiple clients open. I can not quantify this scientifically (or am too lazy to do so).

One of the other things that I’m really hyped about is that this brand new Macbook Pro runs a lot cooler with two EVE clients opened with a dual-head setup. I have always had to run SMCFancontrol to maintain a reasonable CPU temp, and still have to do so. However, instead of getting up over 70C and having the aluminum case heat up above and below the GPU/CPU, it now runs below 60C and stays reasonable cool on the outside. Big win here if not just for peace of mind.

I did see one crash while running two clients, but this can be expected periodically. I’m not sure if it’s Snow Leopard related or just EVE funkage. All in all, EVE runs just fine on Snow Leopard.

Fun with MDSChannelPeerCreate errors on Mac OS X Server

We started experiencing AFP problems and general instability on one ofour Mac OS X servers today. AFP locked up and sucked a lot of resources, caused some bogus error messages in the logs. Kept getting this in particular:

AppleFileServer[4806] MDSChannelPeerCreate: (os/kern) invalid argument

It looks like this may be due to a permissions problem on one of the root drives our AFP server is making available to clients. Looking at the files within the .fseventsd directory on the drive’s mount point, I noticed that everything beneath .fseventsd was owned by root:unknown. Recursively chown’ing this to root:staff and setting permissions to 770 seems to have stopped the errors and returned stability after restarting AFP.

This was one of those problems that Googling didn’t yield a good answer to initially. I really had to dig and though I’d post this up for others to see. Make sure you post a comment if this helped you.