Commit Graph

38 Commits

Author SHA1 Message Date
Michael Cuevas
7cf6348777 add FilteredHg mixin type to EdenRepoTest
Summary:
Since FilteredFS uses an entirely separate `eden clone` command, none of the existing Hg tests run using a FilteredBackingStore-backed repo. To ensure we have proper test coverage for FilteredFS, we should add a FilteredFS mixin type that runs all existing tests with the new FilteredBackingStore setup.

Introducing these mixins revealed a number of broken tests (some legit issues with FilteredFS, others are just incompatibilities with new FilteredBackingStore Root/Object Ids). We will disable all of these broken tests and incrementally fix them in the next diffs in this stack.

Note: A small number of tests are already broken/flakey for non-FilteredFS tests. They are "ignored" on other diff signals since they are marked flakey/broken in TestX, but the FilteredHg counterpart won't be marked accordingly (due to no run history). I'm not planning to fix those existing flakey/broken tests just yet.

Reviewed By: kmancini

Differential Revision: D51287692

fbshipit-source-id: 8135cb9e5e9dba08be48a4814dfc3405122127b8
2023-12-19 22:20:08 -08:00
Chad Austin
122dc189b3 fix getdeps build on Windows
Reviewed By: xavierd

Differential Revision: D47744145

fbshipit-source-id: a95266f2178192dedb0ecef6a34eaad458784527
2023-07-25 15:24:16 -07:00
Chad Austin
5915548f7e cmake: disallow circular dependencies
Summary:
I ended up in a crazy situation where the CMake build was failing to
link because `target_link_libraries` had a cycle. Fix that by
preventing cycles in the first place. CMake is the gift that keeps on
giving.

Reviewed By: xavierd

Differential Revision: D45927359

fbshipit-source-id: 6a378f7935195e42b3446249091898370d6e2ee5
2023-05-16 20:14:36 -07:00
Xavier Deguillard
a29d465ee8 fs: fix license header
Summary:
With Facebook having been renamed Meta Platforms, we need to change the license
headers.

Reviewed By: fanzeyi

Differential Revision: D33407812

fbshipit-source-id: b11bfbbf13a48873f0cea75f212cc7b07a68fb2e
2022-01-04 15:00:07 -08:00
Katie Mancini
8e1a30a2a9 nfs: run most integration tests on edenfs
Summary:
Currently we have limited test coverage of the NFS code. Let's start running
our integration tests on NFS mounts. We already duplicate tests to run them on
both Git and Hg repos using a python decorator. We can update this decorator to
run a copy of tests on an nfs mount.

This covers most of the tests, but a few tests do not use this decorator. See next
change.

Note some tests are currently broken, so I am using the same skip list functionality
we use for windows so we use a uniform framework.

Reviewed By: xavierd

Differential Revision: D27874662

fbshipit-source-id: c7d425830b691e395b5228d0e0f797f67987b4ec
2021-04-23 13:30:17 -07:00
Xavier Deguillard
205eb80a76 oss: compile with -Wno-nullability-completeness
Summary:
On macOS, the compiler shows tons of warnings due to our use of pointers where
nullability attributes aren't set, and the compiler complains about it. This
makes finding legitimate warnings/errors almost impossible, thus for now let's
disable these.

Reviewed By: fanzeyi

Differential Revision: D27862116

fbshipit-source-id: 8ea2c27a0cfd6cbd484fca6be5f15c772d9f4589
2021-04-19 15:08:22 -07:00
Xavier Deguillard
77f3f239a2 store: replace use of ctreemanifest with small manifest parser
Summary:
The code still took a dependency on Mercurial's old manifest code to parse
manifests. It turns out the manifests have a very simple format that we could
parse directly.

This avoids various copies, conversions, std::list, removes ~1k lines of code,
at the expense of adding ~100 lines of code (some of them being C++
boilerplate).

Reviewed By: fanzeyi

Differential Revision: D25385018

fbshipit-source-id: 90d4cda2b7797584bc48c086d5592a7ecaa05dfc
2020-12-09 08:40:38 -08:00
Xavier Deguillard
2b79b77cf4 extlib: remove libmpatch dependency from datapack target
Summary: The code doesn't use anything from libmpatch, we don't need to depend on it.

Reviewed By: DurhamG

Differential Revision: D24055084

fbshipit-source-id: 0f7bac73f1b711da4395e25619577a0a2e0ca959
2020-10-02 10:47:23 -07:00
Xavier Deguillard
93ad242d60 packaging: use scheduled tasks
Summary:
In order to start EdenFS automatically at boot, a template service was used
previously, but due to several issues, we decided to move away from it.
Thankfully microsoft supports several other ways of starting tasks at startup,
one of which is the "Task Scheduler" itself.

One of the weird part of the task scheduler is that there isn't a good way
to tell it to not show a console for a non-graphical application, and thus
plainly executing edenfsctl start in it would create a cmd window, which
would then disappear a couple of seconds later. To avoid this, a "graphical"
version of Python is used (pythonw.exe) to start edenfsctl.

Reviewed By: fanzeyi

Differential Revision: D21732281

fbshipit-source-id: 87ef3a2d5569302392bd30a4b9e7fc48807ee316
2020-06-10 19:29:15 -07:00
Xavier Deguillard
6cdc2782b3 cli: add a startservice.ps1 script
Summary:
This script deals with obtaining the right privilege to start the EdenFS
service. This effectively enables `edenfsctl start`.

Reviewed By: wez

Differential Revision: D21585739

fbshipit-source-id: 7b835434d865fa4c4c8473e13665ae669fd86108
2020-05-19 13:00:54 -07:00
Xavier Deguillard
a4af481237 getdeps: silence inherits via dominance warnings
Summary:
Previously, the Windows build was litered with warnings of the form (typo included):

  warning C4250: 'C1': inherits 'C2::C2::method' via dominance
  note: see declaration of 'C2::method'

Microsoft doesn't offer any recommendation, and the internet suggest that the
right `using` should silence it. That's unfortunately not the case, adding:
  using C2::method
In `C1` doesn't do anything, and the compiler still complains :(.

Since the warning appears to be non-actionable, and looks more like a
"notice" than a warning, let's just silence it.

Reviewed By: wez

Differential Revision: D21395095

fbshipit-source-id: ae661b3ed61303e6361b8a15d9e7c6b9627ea8c1
2020-05-08 21:46:06 -07:00
Adam Simpkins
c07261c5ca update build configuration information for Python and C++
Summary:
This updates the top-level CMakeLists.txt file to compute package version
information, and expose this to C++ code in `eden-config.h`, and to Python
code in a new `eden/config.py` module.

Previously we exposed an `EDEN_VERSION` macro for the C++ code in
`eden-config.h`, but this was not initialized or used anywhere.  Now the
top-level CMakeLists.txt file computes appropriate version information and
exposes the package name, version, release, commit ID, and build time in these
configuration files.

The version selection logic in CMakeLists.txt based largely on the code that
wez wrote for watchman in D20636833.

Reviewed By: wez

Differential Revision: D21000164

fbshipit-source-id: db1a1035f1eefec058bbad558d35e113005e454e
2020-04-22 12:48:47 -07:00
Adam Simpkins
353e248dd4 on Windows, also emit a path containing runtime library dirs
Summary:
Update the CMake build to emit a LIBRARY_DEP_DIRS.txt file in the build output
directory.  This file should contain additional directories that may contain
runtime library dependencies for the generated build artifacts, one directory
per line.  This file will be parsed by getdeps.py so that it can set `$PATH`
properly when running tests in order to find all of the necessary library
dependencies.

At the moment the runtime location of the Python DLL is the main thing that
needs to be stored in this directory.  CMake can find the Python location from the
registry, even if that location is not in the user's `$PATH`.  On its own
getdeps.py won't be able to find the location of the Python DLL unless we
explicitly give it this information through this file.

Reviewed By: wez

Differential Revision: D20688289

fbshipit-source-id: 078d07d860de8604c97bf6adede464c0d95fc079
2020-03-31 11:34:55 -07:00
Ratnadeep Joshi
6447950e1a Move cli/ directory from eden/ to eden/fs (Without changing namespace)
Summary:
[edenfs] Move cli/ directory from eden/ to eden/fs (Without changing
namespace)

Reviewed By: simpkins

Differential Revision: D20505093

fbshipit-source-id: 1975afac2ca1cd70ca407dde485c97254f4cc1e9
2020-03-25 11:18:30 -07:00
Ratnadeep Joshi
17fd33424d Move py/ directory from eden/ to eden/fs
Summary: [edenfs] Move py/ directory from eden/ to eden/fs

Reviewed By: simpkins

Differential Revision: D20479925

fbshipit-source-id: 36abf7fe208c283f01c9bf415e2fcb1a8f4bdbae
2020-03-24 11:45:37 -07:00
Wez Furlong
30d0a77d53 eden: add helper command for working with apfs
Summary:
We've had a small proportion of our users run into problems
with hdiutil and diskimages-helper, where those components get into
an unhappy state and effectively block operating on the redirections.

This diff introduces a new utility that is intended to replace the
use of disk image files with APFS volumes that we mount in the
appropriate places.

The intention is that we will teach `eden redirect` to use this tool
when available, rather than disk images.

macOS's security model is weird: it is perfectly valid for a non-privileged
user to create and delete APFS volumes in the APFS storage container,
but root privs are required to mount it into the VFS.

The intent is that we deploy this utility setuid root to minimize
the fan out--this way we won't need to teach the priv helper about
this kind of redirection.

There are a couple of subcommands demonstrated in the test plan.

Reviewed By: chadaustin

Differential Revision: D19323850

fbshipit-source-id: 35556f841e49e5c4b77679b756af9093222f4500
2020-02-03 16:59:17 -08:00
Adam Simpkins
6666995b37 add an option to also install the Python DLL on Windows
Summary:
Add an option to CMakeLists.txt so that when building on Windows the Python
DLL will also be installed into Eden's `bin/` directory.  On Windows our
Python-based tools are compiled into `.exe` files that require this DLL.
Installing the Python DLL along side our binaries is an easy way to ensure
that these executables can always find the correct library.

It would perhaps be nicer if we could simply link against Python statically.
Unfortunately the `FindPython3.cmake` file that ships with CMake silently
ignores requests to link statically on Windows.  (They provide a
`Python3_USE_STATIC_LIBS` option, but it is explicitly ignored on Windows.)
In the long run it might be nicer to attempt to fix that.

Reviewed By: pkaush

Differential Revision: D19060632

fbshipit-source-id: 6995fe6b81b820cf8e0713687751c1a811e97f88
2020-01-13 16:10:57 -08:00
Adam Simpkins
2442b46ee8 cmake: always build support for the EdenSCM backing store
Summary:
Now that the fb-mercurial sources are available in the Eden repository, update
our CMake build files to always build them.  This moves the build logic from
the centralized `FBMercurialFeatures.cmake` file into `CMakeLists.txt` files
in the appropriate subdirectories.

Reviewed By: chadaustin

Differential Revision: D18588011

fbshipit-source-id: ded9decde5c2ec766aae0bb0f4f5b021d1044a98
2019-11-22 13:00:07 -08:00
Adam Simpkins
f71bfaacad getdeps: remove the fb-mercurial-rust target
Summary:
Remove the standalone fb-mercurial-rust target that was an internal-only
dependency for the Eden build.  This build step is now done entirely in the
Eden build.

Reviewed By: fanzeyi

Differential Revision: D18623943

fbshipit-source-id: c62a1155ddd1c0a6b2270c472176ba25194c6145
2019-11-22 13:00:06 -08:00
Adam Simpkins
aef2dbce95 cmake: unconditionally build the Rust datapack library code
Summary:
Update the CMake build to always build the Rust datapack libraries, even on
Windows.  This allows us to completely eliminate the `EDEN_HAVE_RUST_DATAPACK`
checks.

Note that I did leave the `EDEN_HAVE_RUST_DATAPACK` macro in place, as we
still do not build the Rust datapack code on Mac when building with Buck.

Reviewed By: fanzeyi

Differential Revision: D18588008

fbshipit-source-id: 1a4c9ceec5372d0e6a7313d2eb87edabd1e60a96
2019-11-22 13:00:06 -08:00
Adam Simpkins
cd9a1e0e88 cmake: directly build the rust datapack libraries
Summary:
Update Eden's top-level CMakeLists.txt file to build the Rust datapack
libraries.  Previously these were built by invoking CMake separately inside th
`eden/scm` subdirectory.  Now that the code has been combined into a single
location we can use a single CMake invocation to drive the build of both these
components.

The old code did not build the Rust datapack code on Windows, and this diff
does not change that behavior.  I'm not aware of any reason to skip building
this on Windows, so I plan to enable building this code on Windows in a
subsequent diff.

Reviewed By: pkaush

Differential Revision: D18588006

fbshipit-source-id: 20f4f0ea9fef8595a9dd35a21115952b2808c824
2019-11-22 13:00:06 -08:00
Adam Simpkins
8ce111ef53 support building the integration tests with CMake
Summary:
Add initial support for building and running some of the integration tests
with CMake.  For now this just runs the tests from basic_test.py, just to
confirm that most of the framework code works in CMake-based builds.

Many of the other tests should also work as well, but a few of them we may
want to disable for CMake-based builds.  e.g., a couple of the tests depend on
hypothesis, and we would need to include hypothesis as a dependency.  Some of
the tests that use systemd might also require a little more work to get
working.

Reviewed By: fanzeyi

Differential Revision: D17659026

fbshipit-source-id: 67420fda9e1021a0cddee2d385fd21e34fb2fd70
2019-10-04 08:56:38 -07:00
Adam Simpkins
7ee2610c78 make support for Eden SCM optional
Summary:
Add a CMake option to control whether or not we should build support for
fb-mercurial (aka Eden SCM).  If this is disabled we avoid building anything
under eden/fs/store/hg and drop support for the "hg" backing store.

Reviewed By: wez

Differential Revision: D15980320

fbshipit-source-id: 23a49d3e5cf89199666ff4a0bf46626502c12171
2019-09-26 20:26:43 -07:00
Adam Simpkins
69e28322d3 make support for Git optional
Summary:
Add a CMake option to control whether or not we should build support for
Git.  If this is disabled we avoid building anything under eden/fs/store/git
and drop support for the "git" backing store.

Reviewed By: wez

Differential Revision: D15980321

fbshipit-source-id: 434364d81b44935ce86fdf4d66697ee21ff2992f
2019-09-20 18:22:04 -07:00
Adam Simpkins
92f06c1dba increase required CMake version to 3.8
Summary:
The `add_fbthrift_library()` functions require CMake 3.8+ for the
`COMMAND_EXPAND_LISTS` support in `add_custom_command()`

Reviewed By: fanzeyi

Differential Revision: D17512088

fbshipit-source-id: 1b60976f3097b11d0ad2912ee8068f40520dd9c1
2019-09-20 18:22:04 -07:00
Adam Simpkins
4e38a7c74f build edenfsctl with CMake
Summary:
Update the CMakeLists.txt to also build the Python-based `edenfsctl` command
line tool.

This requires switching most of the thrift rules to generate both C++ and
Python sources.

Note that one missing feature at this point is that this does not package
external dependencies into the binary.  Currently `edenfsctl` depends on both
`six` and `toml` as external dependencies.  For now these must be available in
your `PYTHONPATH` in order to run the generated `edenfsctl` binary.

Reviewed By: chadaustin

Differential Revision: D17127615

fbshipit-source-id: fc138ab39e75c6a5bbd39e3f527d4e9f7f420e46
2019-09-11 13:20:43 -07:00
Adam Simpkins
6b5f79c0d2 fbcode_builder: rename add_thrift_cpp2_library() to add_fbthrift_cpp_library()
Summary:
Rename the `ThriftCppLibrary.cmake` file to `FBThriftCppLibrary.cmake`, and
also rename `add_thrift_cpp2_library()` to `add_fbthrift_cpp_library()`.

Explicitly calling this `fbthrift` helps clearly distinguish that this is
intended for use with fbthrift (https://github.com/facebook/fbthrift/), as
opposed to Apache thrift.

Reviewed By: wez

Differential Revision: D16738440

fbshipit-source-id: 9b255e06b71c98ad74a34989f564a211958dcdd5
2019-08-29 16:45:12 -07:00
Chad Austin
fe64ec3874 use fb303 repo in open source build
Summary: Add a dependency from the eden open source build to the fb303 open source build and switch EdenServiceHandler to BaseService.

Reviewed By: simpkins

Differential Revision: D15528156

fbshipit-source-id: 2ca5c31dd9fcc9bac43fd399b27f33b6f2c5ebfc
2019-07-24 21:07:04 -07:00
Adam Simpkins
4bc8682391 update license headers in CMake files
Summary:
Update the copyright & license headers in CMake files to reflect the
relicensing to GPLv2

Reviewed By: wez

Differential Revision: D15487079

fbshipit-source-id: 715e559464c19a0070d6e55a095b3fc7d61ad2f8
2019-06-19 17:02:46 -07:00
Puneet Kaushik
9b8dac57e5 Remove CompilerSettingsUnix from Windows builds
Summary: CompilerSettingsUnix adds /Wextra and other compiler flags which will error when building with Visual studio.

Reviewed By: chadaustin

Differential Revision: D15536742

fbshipit-source-id: af842f6ad50833f29fbfb602cdf793d0c4de11a9
2019-05-31 16:16:23 -07:00
Wez Furlong
d0c7e1ccb9 eden: cmake: initial support for running unit tests
Summary:
beholdunittests

This enables some plumbing for running some of the
tests using the gtest/gmock machinery in cmake.

Part of this diff is removing the FindGMock.cmake file from the
eden repo; we now pull this in from the shared cmake library
that is populated by shipit.

Reviewed By: simpkins

Differential Revision: D14993344

fbshipit-source-id: 51caf9518c7f3a083a3b90cda10324c3a8170359
2019-05-03 15:59:45 -07:00
Wez Furlong
fc2e7feec8 eden: cmake: probe for osxfuse headers
Summary:
the new getdeps script places the osxfuse/common dir into
its own install prefix, rather than dropping them into `external/osxfuse`.
This configures cmake to check in the installation prefixes known
to cmake.

Reviewed By: strager

Differential Revision: D14683956

fbshipit-source-id: 6e8a73341f8ddc21fef4b40b1f18a4a5128810e3
2019-03-29 15:02:04 -07:00
Zeyi Fan
d69b72c90c fix folly logging in cmake
Summary: This diff fixes Folly's xlog when building with CMake.

Reviewed By: strager

Differential Revision: D14155982

fbshipit-source-id: cb88500ca1fa9f5f748129e1d11471cecd71ce22
2019-02-22 12:14:54 -08:00
Wez Furlong
a545acbbd4 eden: add C datapack/treemanifest to cmake build
Summary:
This requires our mercurial repo to be available during
the build; I symlink it in alongside `common` in the `oss` dir,
and point it up to `scm/hg`.

This has partial support for mononoke too, but will need to add
logic to getdeps to pull down the proxygen repo and build that.

Reviewed By: simpkins

Differential Revision: D13480146

fbshipit-source-id: 54874245015af83a259f56944d2e5f87615baee7
2019-01-17 18:52:53 -08:00
Wez Furlong
0774b2c457 eden: pull in osxfuse kernel headers
Summary:
There's nothing nice about this; the full set of kernel headers are
not installed with the binary distribution, and since the kernel distribution
has to be signed to be loaded on osx, there's no benefit to us building it
for ourselves.

This diff adds a nop builder and tweaks the cmake to point into the osxfuse
repo.

The osxfuse repo aggregates a couple of related repos using the git
submodule feature, so trigger that from getdeps.py too.

Reviewed By: strager

Differential Revision: D13480148

fbshipit-source-id: 84e09a86f6a83f83ffd1e3fe113dc7b15b3ea208
2018-12-17 20:16:19 -08:00
Adam Simpkins
5d369296e8 cmake: compile with -std=gnu++1z
Summary:
Tell the compiler that we want to enable C++17 features.
This is required in order to use `std::is_default_constructible_v`, and it
prevents the compiler from warning about structured binding declarations.

Reviewed By: chadaustin, strager

Differential Revision: D10503904

fbshipit-source-id: 8fc521abdb261c787eabb3908bf7d4c2c8e46f2b
2018-10-23 13:42:12 -07:00
Jun Wu
fae2056037 do not require SELinux in GitHub build
Summary:
I tried to build eden using GitHub version and ran into SELinux issues.
This patch fixed related issues, namely:

- `set(X Y)` sets X to string literal Y. Change it to `set(X ${Y})`.
- `SELINUX_INCLUDE_DIR` could be undefined. Check before use it.
- `./eden/fs/eden-config.h` and `./build/eden/fs/eden-config.h` both exist and
  the former is used. Set include dirs so the latter gets used.

Reviewed By: bolinfest

Differential Revision: D9029272

fbshipit-source-id: 0c94bbe2f9e3fa90973802ddde16ad4d9ddfc0e8
2018-07-27 13:22:57 -07:00
Adam Simpkins
dea514bbef add CMake build files
Summary: Add CMakeFiles to build Eden.

Reviewed By: wez

Differential Revision: D7479587

fbshipit-source-id: 7e0b4a756005dadc3af5c13c36ce22d1dcc15071
2018-04-30 14:37:46 -07:00