Add and fix BUCK files for folly
authorAndrew Gallagher <agallagher@fb.com>
Thu, 25 Sep 2014 01:36:16 +0000 (18:36 -0700)
committerAnton Likhtarov <alikhtarov@fb.com>
Fri, 26 Sep 2014 22:25:29 +0000 (15:25 -0700)
Summary:
This gets almost all of folly building with buck.  There are a few
cases we don't support yet (custom test wrappers for spooky test
binaries, dlopen-enabled exception tracer binary, etc), but the
vast majority is covered.

Test Plan: built all build targets and ran all tests buck

Reviewed By: sdwilsh@fb.com

Subscribers: tjackson, sdwilsh, fugalh, njormrod

FB internal diff: D1577256

Tasks: 5055879

folly/test/FileTest.cpp
folly/test/FutexTest.cpp

index 9a1d3af56235afbec0d11b629bb44fa496022fff..67021814fc2f7244e5572fb40b5df46b71eeff5f 100644 (file)
@@ -147,9 +147,21 @@ TEST(File, Locks) {
   CHECK_ERR(r);
   buf[r] = '\0';
 
-  fs::path helper(buf);
-  helper.remove_filename();
-  helper /= "file_test_lock_helper";
+  // NOTE(agallagher): Our various internal build systems layout built
+  // binaries differently, so the two layouts below.
+  fs::path me(buf);
+  auto helper_basename = "file_test_lock_helper";
+  fs::path helper;
+  if (fs::exists(me.parent_path() / helper_basename)) {
+    helper = me.parent_path() / helper_basename;
+  } else if (fs::exists(
+      me.parent_path().parent_path() / helper_basename / helper_basename)) {
+    helper = me.parent_path().parent_path()
+      / helper_basename / helper_basename;
+  } else {
+    throw std::runtime_error(
+      folly::to<std::string>("cannot find helper ", helper_basename));
+  }
 
   TemporaryFile tempFile;
   File f(tempFile.fd());
index ae23c6553867591dd9850e95b0782533d8fb8583..c1063cf8a687d12ad9b3cf4740359ef32fe9d2d7 100644 (file)
@@ -22,8 +22,8 @@
 #include <thread>
 
 #include <gflags/gflags.h>
+#include <glog/logging.h>
 #include <gtest/gtest.h>
-#include <common/logging/logging.h>
 #include <time.h>
 
 using namespace folly::detail;