Commit Graph

18 Commits

Author SHA1 Message Date
Igor Sugak
ad6811a301 use googletest instead of gtest with gmock
Summary:
This updates all of the references to gtest and gmock with googletest.

The change is mechanilcal, generated with the following one-liner:
```lang=bash
hg grep -lwE '(gtest|gmock)' 'glob:**/TARGETS' | grep -v '^third-party-buck' | xargs perl -pi -e '
$gt=qr!(["'"'"'])gtest\g1!;
(
  s!$gt(\s*,\s*(.any.|None))(\s*,\s*)?\),?!\1googletest\1\2, \1gtest\1\),!g or
  s!$gt((\s*,\s*(.any.|None)[^\)]+))\),?!\1googletest\1\2\),!g or
  s!\(\s*$gt,?\s*\),?!\(\1googletest\1, None, \1gtest\1\),!g or
  s!$gt,?!\(\1googletest\1, None, \1gtest\1\),!g
) unless /(name|type) *=/;

$gm=qr!(["'"'"'])gmock\g1!;
(
  s!$gm(\s*,\s*(.any.|None))(\s*,\s*)?\),?!\1googletest\1\2, \1gmock\1\),!g or
  s!$gm((\s*,\s*(.any.|None)[^\)]+))\),?!\1googletest\1\2\),!g or
  s!\(\s*$gm,?\s*\),?!\(\1googletest\1, None, \1gmock\1\),!g or
  s!$gm,?!\(\1googletest\1, None, \1gmock\1\),!g
) unless /(name|type) *=/;
'
```

Reviewed By: meyering

Differential Revision: D4643237

fbshipit-source-id: fda7f41760c7e44254231df87634631c343e6355
2017-04-01 09:21:54 -07:00
Adam Simpkins
ec85eb7ec7 fix warnings triggered with -Wshadow-compatible-local
Summary:
Make sure the eden coded compiles cleanly with -Wshadow-compatible-local

Pretty much all of the warnings were issues with lambdas shadowing names from
their parent context (even though they didn't ask to capture those names from
the parent).

Reviewed By: wez

Differential Revision: D4644849

fbshipit-source-id: 66629cd98b5af4760f3fbb256e44c0bc47e52316
2017-03-02 13:32:51 -08:00
Adam Simpkins
09006d0e4a Drop AutoHeaders.RECURSIVE_GLOB from TARGETS files
Summary:
Remove AutoHeaders.RECURSIVE_GLOB from all of our TARGETS files.  This is a
Facebook-internal directive that was added as part of a codemod.  The vanilla
open source buck does not know about this directive, and can't parse TARGETS
files that contain it.

All of the affected rules are cpp_unittest() and cpp_binary() rules that don't
actually have any header files, so these parameters didn't actually have any
effect.

Reviewed By: andrewjcg

Differential Revision: D4633748

fbshipit-source-id: 6227fe9b7f2ea838a0c72408ca195685bcae9f5a
2017-02-28 21:46:39 -08:00
Wez Furlong
4829dfe319 change systemConfigDir to etcEdenDir
Summary:
While testing with the fb-eden rpm installed, I hit some integration
test failures.  These were caused by the integration tests picking up the
default post-clone hook configuration.

This diff changes our existing `systemConfigDir` option (which defaults to
`/etc/eden/config.d`) to `etcEdenDir` (which defaults to `/etc/eden`) and
adjusts the code that consumed `systemConfigDir` to construct the effective
value by computing `etcEdenDir + "config.d"`.

Doing this allows us to also default the `repoHooks` path to be
`etcEdenDir + "hooks"` rather than just hard coding `/etc/eden/hooks`.

The result of this is that our integration tests will now pass when `fb-eden`
is installed, because they override the `etcEdenDir` option and isolate their
`edenfs` processes from the globally installed configuration.

Reviewed By: bolinfest

Differential Revision: D4446321

fbshipit-source-id: 524fdb2f386fdf16dce42dce7661d07e13c0f0e7
2017-01-23 23:54:38 -08:00
Wez Furlong
7117c836d1 add InterpolatedPropertyTree class
Summary:
I don't know that I'm happy with the name; it started out as
just a helper wrapper to apply interpolation, but grew a bit to better
encapsulate how we access the config from the eden server.

This is a utility class that I'd like to use in place of the raw boost
property tree in our ClientConfig code.

It encapsulates the underlying property tree and provides a couple of simple
methods; one for loading data from a config file and one for looking up
a configuration value.

The configuration value lookup will replace tokens of the form `${KEY}`
with the value of `KEY` from its internal replacements dictionary.

This mirrors the interpolation handling that we do in the equivalent python
code for the eden client.

Reviewed By: bolinfest

Differential Revision: D4444075

fbshipit-source-id: 5d46d63f87caad4f409fbb981aa83165fcd6596d
2017-01-23 23:54:38 -08:00
Adam Simpkins
251da81f36 update all copyright statements to "2016-present"
Summary:
Update copyright statements to "2016-present".  This makes our updated lint
rules happy and complies with the recommended license header statement.

Reviewed By: wez, bolinfest

Differential Revision: D4433594

fbshipit-source-id: e9ecb1c1fc66e4ec49c1f046c6a98d425b13bc27
2017-01-20 22:03:02 -08:00
Andrew Gallagher
bd862c50e5 codemod: fixup more build targets in TARGETS
Summary:
Ran script from:
differential/diff/21475830/

Reviewed By: Gownta

Differential Revision: D4419263

fbshipit-source-id: 7631ea2c2cb3b6e27756ecc9da9e492b2a3b2dab
2017-01-14 01:44:01 -08:00
Michael Bolin
3f2f22d8fa Normalize build targets to always start with //.
Summary:
We can use `//` exclusively because we always build Eden with Buck and never
fbbuild, our legacy build system for fbcode.

This revision was initially created by running:

```
find eden -name TARGETS | xargs sed -i -e 's#@/#//#g'
```

And then manually updating the `DEFS` file now that we no longer need
some normalization code for an outdated pattern.

But then I got annoyed by other inconsistencies, so I went through and
alpha-sorted some lists, replaced all double quotes with single quotes,
and fixed indents to be two spaces.

Reviewed By: simpkins

Differential Revision: D4356724

fbshipit-source-id: ab07a48f12fa937c257213d12331efdf09e42da6
2016-12-21 16:28:02 -08:00
Andrew Gallagher
a0ad9681a2 codemod: add explicit headers parameter for C/C++ rules under
Summary:
This codemods `TARGETS` under `[a-d]*` directories in fbcode to make
the `headers` parameter explicitly refer to `AutoHeaders.RECURSIVE_GLOB`.

Reviewed By: yfeldblum

Differential Revision: D3801845

fbshipit-source-id: 715c753b6d4ca3a9779db1ff0a0e6632c56c0655
2016-09-01 10:26:38 -07:00
Caren Thomas
9c1fd2f3e5 Fix ClientConfigTest build failure
Summary: Remove incorrect usage of 'using' directive

Reviewed By: simpkins

Differential Revision: D3678707

fbshipit-source-id: 9204a9da9fdedd990b83aa9beae9b4fe6d7ab713
2016-08-05 16:50:21 -07:00
Caren Thomas
bed0de5a95 load config data on start-up
Summary:
Load the config data when eden server is started so that it doesn't need to be re-loaded every time a mount is done. The normal use case for eden will not see that many changes to the config data (users adding repositories themselves is expected to be minimal) so this new logic will be more efficient overall.

Currently, the config data IS reloaded before use every time but this is because there is currently no way to reload the config data if any files are modified on disk. I am looking into how to do this now, and this feature will soon be updated to this diff so configData_ does not need to be constantly reloaded.

Reviewed By: simpkins

Differential Revision: D3580777

fbshipit-source-id: 5e23f51e4aab815e9812750617446dcb7e5483cb
2016-08-05 12:50:31 -07:00
Caren Thomas
670297fa88 add ClientConfig method that compiles repository data
Summary: Restructure the current logic used for loading the config data into a ClientConfig object. Rather than having loadFromClientDirectory iterate through all the config files and parse them to find the necessary information, abstract that logic out into a new method that compiles all of the relevant data so that all loadFromClientDirectory has to do is pull out the needed information. Since this change separates the two steps, this will make it easier to move the first step of compiling config information outside of ClientConfig - the goal here is to have the eden server load all of the config data at start up and cache it in memory so that it doesn't need to be done every time a ClientConfig object is created, and this change is an intermediate step.

Reviewed By: simpkins

Differential Revision: D3580757

fbshipit-source-id: c340a0fe715856066a554238249574f8177bc4d7
2016-08-05 12:50:29 -07:00
Caren Thomas
90cfd27c37 add configPath_ field to EdenServer
Summary:
Include a configPath_ field for EdenServer that holds the path of the user ~/.edenrc config file. The server needs the data from this user config file in order to perform mounts and currently, the path to the home directory is passed via the CLI to the mount command as a field inside the MountInfo struct in order to get the file. As per discussion in D3498567, including the home directory inside the MountInfo struct is logically a bit disjointed, and this change would no longer require the home directory to be passed to the server via MountInfo.

This restructuring also sets up eden for a future change - having the server remount existing mount points on start-up is now possible from the inside. Before this change, mounting anything had to be done via the CLI since the home directory had to be passed in from the outside. This meant that remounting the existing mount points on start up could only be done if Eden was run in the background - running in the foreground would require manual remounting of all existing mount points. Now that the server has access to the config file's path, remounting can be done without any prompting from the CLI in both cases.

Reviewed By: simpkins

Differential Revision: D3580737

fbshipit-source-id: 46667ccd130b470a3a8a9e9aa08e5ec8e8b90336
2016-07-26 10:16:16 -07:00
Caren Thomas
96a63ff972 restructure eden directory
Summary:
These changes restructure the eden directory so that 'client' directories are created during the `eden clone` command and are associated with a single mount path.
The new eden directory looks as follows:
  ~/.eden
      config.json
      clients/
          abcd08d/
              edenrc
              SNAPSHOT
              overlay/
          efgh19i/
              edenrc
              SNAPSHOT
              overlay/
              ...

Where the config.json file holds the mapping of mount paths to their respective client directory which is a hash, and the edenrc files in each client directory is an INI file which holds the name of repository associated with the mount path. This INI file follows the current format:
    [repository]
    name = fbsource

This restructuring required a couple other changes:
- unmount command now cleans up the client directory and removes the mapping of its mount path from config.json
- eden list command now lists all of the mount paths rather than the client names

Reviewed By: bolinfest

Differential Revision: D3506119

fbshipit-source-id: dc07a8baf1052be731ff335d9cf74a07ab8e661a
2016-07-06 16:15:50 -07:00
Caren Thomas
ad7f71f0b4 update ClientConfig class to parse INI file
Summary: Change the ClientConfig class to parse client data via INI config file rather than json file. This class uses boost::property_tree::ini_parser and the ptree data structure to hold the parsed INI file contents. This change makes it possible for eden to no longer rely on json files for getting client data, and the json files will be completely taken out in a separate diff.

Reviewed By: bolinfest

Differential Revision: D3498567

fbshipit-source-id: 3298047a014beda0c250475c0809a7a1ebd95b2b
2016-07-06 16:15:50 -07:00
Michael Bolin
3feb4c5c9a Change ClientConfig.getSnapshotID() to return a Hash instead of a string.
Reviewed By: wez

Differential Revision: D3296485

fbshipit-source-id: aef7abea6e4931c2129239dbfd44443b1141d549
2016-05-13 15:10:22 -07:00
Facebook Github Bot 8
83f42a9fa6 Include build files that were inadvertently excluded from the initial export.
fbshipit-source-id: 2c76f0d5e55d84859ad9f4841cbe6994a62446f8
2016-05-12 16:08:34 -07:00
Facebook Github Bot 5
2eeea32117 Initial commit
fbshipit-source-id: 2bcefbd0cd127cc5ea982e074ea6819d7aac3d7a
2016-05-12 14:09:13 -07:00