Commit Graph

10 Commits

Author SHA1 Message Date
Chad Austin
7e4835f677 rename eden.thrift Python module to eden.thrift.legacy
Summary:
The Python 2-and-3 Thrift API is sort of deprecated and does not
handle binary data in `binary` fields. In advance of migrating to the
modern Python 3 API, remane eden.thrift to eden.thrift.legacy.

Reviewed By: fanzeyi

Differential Revision: D21889697

fbshipit-source-id: a745ee8977999acbfb383a4edebe81d8deb1734e
2020-06-10 19:29:42 -07:00
Chad Austin
11d569b04d refactor EdenClient construction
Summary:
I am planning to start migrating Eden's CLI to the new Python 3 Thrift
implementation. In preparation, slightly clean up the interface and
implementation of our Python 2 Thrift wrapper.

Reviewed By: genevievehelsel

Differential Revision: D21854539

fbshipit-source-id: d398dd3f324c12288871cf0c9db41e64ed4cf7ed
2020-06-10 19:29:23 -07:00
Adam Simpkins
2e0f442a24 work around slightly broken AF_UNIX connect() behavior on Windows
Summary:
On Windows calling `connect()` on an AF_UNIX socket path that does not exist
creates a file at that location.  This is problematic as it now prevents
servers from binding to that path.  Even if the server attempts to remove the
file in order to bind, clients attempting to call `connect()` can race with it
and make binding fail.

This updates our client connection code check to see if the file exists before
attempting to call `connect()`.  This can still race with a server that is
trying to remove an old socket and re-bind, but it at least makes the race
less likely to happen.

Reviewed By: genevievehelsel

Differential Revision: D21410571

fbshipit-source-id: 3df63b19b40b25be98108246186a48a379cdab28
2020-05-05 15:03:57 -07:00
Sergey Firsov
14ed2e817d Add new workloads to fiosynth
Summary:
add new 2 workloads
fixed unit tests

Reviewed By: darryleg

Differential Revision: D21333448

fbshipit-source-id: 2673dc3a62cdf227559f33e5301fab9293c3eb01
2020-04-30 21:50:17 -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
104ae880db fix issues when checking EdenFS status on windows
Summary:
- Catch the Windows-specific exceptions types thrown when attempting to open
  the socket if EdenFS is not running, and convert this to an EdenNotRunning
  exception.
- Update EdenFS to write its pid to a separate file, in addition to the normal
  lock file, and have `edenfsctl` read this file instead of the lock file on
  Windows.  Other processes cannot read the lock file while EdenFS is running
  and holding the lock, so it is nice to have the pid written in an alternate
  location.

Reviewed By: pkaush

Differential Revision: D20854615

fbshipit-source-id: 1c8e8f402eb17dd012d03e11fbb662f493d9362d
2020-04-15 15:46:24 -07:00
Adam Simpkins
17a3c9124d update Python platform checks to use sys.platform
Summary:
Update out platform checks to use `sys.platform` instead of `os.name`

Python type checkers (mypy and Pyre) currently understand checks against
`sys.platform`, and know that code guarded by these checks is platform
specific.  They don't understand the `os.name` checks.

This code should behave the same, but allows type checkers to do a better job
checking this code.

Note that there is also `platform.system()`, but this has drawbacks that it
apparently does runtime-checks to determine the platform, whereas `sys.platform`
is baked-in at compile time.  Additionally, the typecheckers do not appear to
support checking based on `platform.system()` for now.  There is an open
feature request for this for mypy, but it is not implemented yet.

One caveat for `sys.platform` is that the results on Linux are not consistent
across Python versions: older versions of Python used to report `linux2` while
new versions report simply `linux`.

Reviewed By: chadaustin

Differential Revision: D20830149

fbshipit-source-id: d173e41f1ae84951a84b87e2dc05787fe8b01407
2020-04-03 16:52:32 -07:00
Wez Furlong
bd8fb5a926 eden: fix thrift client on windows
Summary:
addresses this error:

```
File "eden\thrift\windows_thrift.py", line 119, in <module>
AttributeError: 'module' object has no attribute 'LPDWORD'
```

Reviewed By: simpkins

Differential Revision: D20749286

fbshipit-source-id: 3e2409cf93e29d8a297998c59a833fae46d6d27b
2020-03-30 15:25:45 -07:00
Wez Furlong
e815ec7e6d eden: windows: fixup python unix domain thrift socket
Summary:
Fix a problem with the handling of short reads
which would result in returning trailing garbage.

Implement setting timeouts.
Implement sendall (not strictly needly, but added here
for symmetry with the pywatchman equivalent code.

Reviewed By: chadaustin

Differential Revision: D20584508

fbshipit-source-id: a27a7392b3335458c5e56a91376220ab045ad30b
2020-03-26 11:58:25 -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