Commit Graph

14 Commits

Author SHA1 Message Date
Alex Hornby
b7bd10a392 stub out fboss fbcode dependencies
Summary:
Add some stubs to replace fbcode dependencies that were breaking OSS build, plus list some necessary .cpp and libs that were missing in the CMake config

Includes small change to QsfpUtilTx.cpp to fix a -Wsequence-error that cmake flags promoted to error

Reviewed By: shri-khare

Differential Revision: D33708895

fbshipit-source-id: a4f4d557f4155d88d4c59767cd74bec95f63f312
2022-01-26 15:25:00 -08:00
Shashank Chaudhry
2470aca668 Enable CLANGFORMAT
Reviewed By: zertosh

Differential Revision: D31877653

fbshipit-source-id: 91f2e6c8b83dc7da1eb8a071b84fb0b03ec4ac54
2021-10-24 20:46:16 -07:00
Jasmeet Bagga
da821dcc9c Opt fboss into auto thrift format
Summary:
We are already enrolled in clang-autoformat, but not in
thrift auto format. Enable that now, so we can let linters worry about
formatting our code.

Reviewed By: phshaikh

Differential Revision: D30905313

fbshipit-source-id: bb4724cc11c455b23305e120ddcf22a3df0125b8
2021-09-14 09:16:13 -07:00
Adam Simpkins
1cdee770a5 update copyright headers in some of the common/ stub headers
Summary: Update copyright messages to match the patterns expected by our open source linters.

Reviewed By: chadaustin

Differential Revision: D15105843

fbshipit-source-id: 6c66b4e3a552f9d71e6b43f9a5e6fcda48fd00d9
2019-04-26 14:38:28 -07:00
Wez Furlong
cd5b4b6d92 watchman: pull in thrift in the oss build for eden support
Summary:
This diff enables building the eden watcher by linking in thrift and
its various dependencies.

To support building in-fbsource and in the github repo, a `maybe_shipit_dir`
function is used to setup a symlink to the `eden` and `fboss/common` dirs (this
mirrors the shipit configuration for this project: we cannot simply run shipit
because we have to build on mac and windows and shipit requires Hack, and that
does not support those platforms).

I tried to persuade cmake to let me build this without the use of a symlink but
found it too difficult to teach everything about the path mapping.  The
symlinks aren't terrible, but are the reason why this diff also updates some
`.gitinore` files that are seemingly unrelated to this diff.

This diff changes a couple of build/link options: without them the end product
fails to link either due to implicit/unilateral enablement of UBSAN in some of
the deps, or because warning->error promotion is turned on.

This diff includes a copy of the `ThriftCppLibrary.cmake` file from the fboss
repo.  This should get centralized and shipit'ed out into the places that
consume it.  That can be done when someone gets around to doing the same for
the `FindGlog.cmake` file and doesn't need to hold up this diff.

Reviewed By: simpkins

Differential Revision: D13486486

fbshipit-source-id: 3bb5b011771b2a87618147ca019b4e50a8e0aaf2
2019-02-04 21:37:47 -08:00
Wez Furlong
c219906817 add getPid to fb303
Summary: Eden uses getPid() heavily for health/status validation.

Reviewed By: chadaustin

Differential Revision: D13478522

fbshipit-source-id: c1ce95671f4039cdabdd6015fdffdec738306fed
2018-12-17 15:53:15 -08:00
Adam Simpkins
a5ede43ea8 add FacebookBase2::exportThriftFuncHist() to the fb303 stubs
Summary:
We call this function in Eden, so make it available in the fb303 stubs that
we include in the github repository.

Differential Revision: D12813738

fbshipit-source-id: 1432e751ce676410e9d2e589274c7c1dc2c45321
2018-10-30 13:06:14 -07:00
Adam Simpkins
21d2b6c46d Remove TARGETS files
Summary:
This removes the TARGETS files from the eden github repository.  The
open source buck build has been failing for several months, since buck
removed support for the thrift_library() rule.

I will potentially take a stab at adding CMake build support for Eden
at some point in the future.

Reviewed By: chadaustin

Differential Revision: D6893233

fbshipit-source-id: e6023094a807cf481ac49998c6f21b213be6c288
2018-02-20 19:57:45 -08:00
Rob Sherwood
ed47573b67 Fix open source aliveSince() implementation
Summary:
aliveSince() has a misleading name and I misunderstood.
The correct implementation just returns the timestamp of when
the process started as opposed to my understanding (the number
of seconds since the process started).

Reviewed By: linhbui

Differential Revision: D6789987

fbshipit-source-id: db60bf00f6b07e31d91dfc8ed06d1c1cbe172a64
2018-01-25 10:22:07 -08:00
Rob Sherwood
0eb330520f Added aliveSince() implementation to OSS fb303 skeleton
Summary:
fb303 is not open source, but fboss depends on it.  So, the
open source version of fboss uses its own private, mostly
stubbed out version of fb303 (in fboss/common/...).

With the changes to QsfpCache.cpp, we now depend on aliveSince()
fb303 primitive and the open source started spewing errors
about it not being implemented.

This patch implements aliveSince() for the skeleton open source
fb303 but we'll have to figure out a better, longer term fix
(e.g., open source all of fb303).

Reviewed By: aeckert

Differential Revision: D6731321

fbshipit-source-id: 6acdcd68053e7bfcada2cfd62aaa3aecf3dec3e0
2018-01-17 13:02:09 -08:00
Alex Eckert
c684fed90a fix oss sandcastle job
Summary:
My recent stack of diffs introduced a handful of oss bugs :(.

1. VLOG_EVERY_MS is an internal function.
fix: added an oss stub version

2. Forgot to add QsfpCache.cpp to CMakeLists.txt
fix: add it

3. vanilla gcc5.4 has a bug where it can't handle lambdas like:
  [this]() {
    memberFn();
  }
and instead you need to write like:
  [this]() {
    this->memberFn();
  }

fix: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67274 says it should
be fixed in gcc7, but I added 'this->' in the meantime.

4. The base fb303.thrift file we have in open source does not declare
aliveSince, which we now call on qsfp_service.

fix: add it to fb303.thrift

Reviewed By: ninas

Differential Revision: D6627705

fbshipit-source-id: 2100783df1ea0e9af0fed66e4e24ef85b71fc7e9
2017-12-22 09:21:44 -08:00
Philip Jameson
f18128537f Migrate TARGETS files from @/ to //
Summary:
This is a codemod to change from using @/ to // in basic cases.
- TARGETS files with lines starting with @/ (but excluding @/third-party:
- autodeps lines in source and TARGETS files ( (dep|manual)=@/ ), excluding @/third-party
- Targets in string macros

The only thing left of the old format should be @/third-party:foo:bar

drop-conflicts

Reviewed By: ttsugriy

Differential Revision: D6605560

fbshipit-source-id: 17d3a196b91045f0db5ee2a5afad467b6344be0b
2017-12-20 18:39:22 -08:00
Andrew Gallagher
6df267fe5c codemod: format TARGETS with buildifier [3/5] (D5092623)
Reviewed By: igorsugak

fbshipit-source-id: c3036011faa009bb2b051142b1caedfdbe77b3df
2017-06-01 16:51:16 -07:00
Adam Simpkins
7f58caffe4 Add fb303 stubs in common/ to support building in the opensource repo
Summary:
This adds a common/ directory with stub files required for building
eden.  These stubs are the same ones as used in the fboss repository:
https://github.com/facebook/fboss/

Our goal is to eventually create an opensource fb303 repository with
complete implementations of these files, but for now these basic stubs
allow building eden.  (Most of the underlying stats code that supports
fb303 is already available in folly/stats/ in the folly repository.)

Test Plan:
Tested building eden on Ubuntu 16.04
2017-03-17 17:08:05 -07:00