Skip to content

Commit

Permalink
Fix OSS build
Browse files Browse the repository at this point in the history
Summary:
There are two separate changes here.

### Use `find_package`

The old setup of "let's manually enumerate and order the libraries that Bistro depends on" worked fine, except:
 - it was a bit brittle (requiring occasional patches as deps changed), and
 - it garnered a lot of feedback to the effect of "your build is weird, so it's probably broken because of that."

Now I expect to have fewer breaks and more plausible deniability :)

 More importantly, this should make it much easier to migrate to `getdeps.py`.

## Statically link `fmt`

After `fmt` was added as a `folly` dependency, and linked into Folly code used by Bistro, its tests would fail to run with this error: `test_sqlite_task_store: error while loading shared libraries: libfmt.so.6: cannot open shared object file: No such file or directory`.

Something was getting messed up in the dynamic linking, and it wasn't clear to me what -- the way that Bistro is linking its dependencies certainly seems sensible. Most likely one of the dependencies is incompatible with dynamic linking in a subtle way. I suspect Proxygen.

The `fmt.py` change in this diff addresses this problem by forcing static linking on the offending library.

Reviewed By: yfeldblum

Differential Revision: D24604309

fbshipit-source-id: 35ecbbb277b25907ecaee493e8b0081d9f20b865
  • Loading branch information
snarkmaster authored and facebook-github-bot committed Nov 5, 2020
1 parent 09b4035 commit 1a7d0b0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions build/fbcode_builder/specs/fmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@

def fbcode_builder_spec(builder):
builder.add_option('fmtlib/fmt:git_hash', '6.2.1')
builder.add_option(
'fmtlib/fmt:cmake_defines',
{
# Avoids a bizarred failure to run tests in Bistro:
# test_crontab_selector: error while loading shared libraries:
# libfmt.so.6: cannot open shared object file:
# No such file or directory
'BUILD_SHARED_LIBS': 'OFF',
}
)
return {
'steps': [
builder.github_project_workdir('fmtlib/fmt', 'build'),
Expand Down
3 changes: 3 additions & 0 deletions build/fbcode_builder/specs/folly.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
from __future__ import print_function
from __future__ import unicode_literals

import specs.fmt as fmt


def fbcode_builder_spec(builder):
return {
"depends_on": [fmt],
'steps': [
# on macOS the filesystem is typically case insensitive.
# We need to ensure that the CWD is not the folly source
Expand Down

0 comments on commit 1a7d0b0

Please sign in to comment.