Commit Graph

24 Commits

Author SHA1 Message Date
Pyre Bot Jr
2b5216e31c suppress errors in fbcode/eden - batch 1
Differential Revision: D30514057

fbshipit-source-id: fba38e972f6dad2ad9e6f2d89a2eef06cf4e2872
2021-08-24 14:30:57 -07:00
Durham Goode
be2bd4fc95 Backout py3 only changes from windows_thrift
Summary: Mercurial still needs this to work in Python 2 for a few more weeks.

Reviewed By: quark-zju, xavierd

Differential Revision: D27943521

fbshipit-source-id: 2b5106496fbb523cdc97a3dce3ad0cbfab5c17b7
2021-04-22 10:29:49 -07:00
Pyre Bot Jr
10cf3c8a99 Add annotations to eden/fs/py/eden/thrift/windows_thrift.py
Reviewed By: xavierd

Differential Revision: D27910603

fbshipit-source-id: 6cd414e73d24f7091d58339c0db2f00eeb6e742a
2021-04-21 12:45:53 -07:00
Pyre Bot Jr
b6af8df1a3 Add annotations to eden/fs/py/eden/thrift/windows_thrift.py
Reviewed By: xavierd

Differential Revision: D27846256

fbshipit-source-id: fed9073df58bd604ffeec2de93e0dd5e96930fb0
2021-04-19 09:19:20 -07:00
Pyre Bot Jr
dc8edb9bd7 Add annotations to eden/fs/py/eden/thrift/test/client_test.py
Reviewed By: xavierd

Differential Revision: D27823522

fbshipit-source-id: 6bec6252e1c6f402528aed2ee784ba85373e6db3
2021-04-16 10:14:23 -07:00
generatedunixname89002005307016
1fbe99f5a9 Add annotations to eden/fs/py/test/dirstate_test.py
Reviewed By: xavierd

Differential Revision: D27119152

fbshipit-source-id: 42463371705f4df02445ab4c47fa3b4418c910f0
2021-03-17 14:15:25 -07:00
Genevieve Helsel
9db3bf1e25 run linter in eden/fs/py
Summary: just running the linter :)

Reviewed By: chadaustin

Differential Revision: D26000280

fbshipit-source-id: 23bc996ca361b208cd6f643e1440eb2a9aeec034
2021-01-25 16:13:55 -08:00
Chad Austin
3d16771b68 give new thrift client access to streaming APIs
Summary: Thrift-py3 supports streaming, so give the new client access to APIs from streamingeden.thrift.

Reviewed By: wez

Differential Revision: D24032144

fbshipit-source-id: 44f350b5cfa943154084b8d64f6c696e315e6b88
2020-10-07 23:36:40 -07:00
Chad Austin
62f06c645a introduce a py3 client
Summary: Introduce a py3 replacement for EdenClient.

Reviewed By: wez

Differential Revision: D22060644

fbshipit-source-id: 535a1f1addf3ac79de0471a688cef55567802d26
2020-09-15 17:37:50 -07:00
Genevieve Helsel
5157cf6f34 fix eden thrift legacy dependencies
Summary: `legacy.py` depends on other files in this directory, so lets add them all to the link tree

Reviewed By: fanzeyi

Differential Revision: D23356917

fbshipit-source-id: e4bfd82ebbd9d143a5454a43bb47e8dd55b4485f
2020-08-31 07:55:27 -07:00
Xavier Deguillard
31044a4cb2 thrift: do not test for socket before connecting to it
Summary:
In Windows 10 2004, the behavior of AF_UNIX socket changed slightly, a socket
on which a server is listening to now appears to be shown as a "reparse point"
on disk. This appears to confuse Python as `os.path.exists(socketpath)` no
longer returns `True` for a listened to socket, which means that edenfsctl
would not be able to communicate with EdenFS, even though it is up and running.

Windows still has this weird behavior where the socket is created on disk
during connect, but EdenFS knows about this and already retries several times
(D21755498 (2c5768404d)) to avoid the issue, it's therefore fine to remove this code.

Reviewed By: wez

Differential Revision: D22666081

fbshipit-source-id: e2eea3fdd7628354b8b187b76899be4e9e2fa17f
2020-07-22 15:37:14 -07:00
Stanislau Hlebik
9d18c46b1f remediation of S205607
fbshipit-source-id: 798decc90db4f13770e97cdce3c0df7d5421b2a3
2020-07-17 17:16:13 -07:00
Stanislau Hlebik
3665548bb0 remediation of S205607
fbshipit-source-id: 5113fe0c527595e4227ff827253b7414abbdf7ac
2020-07-17 17:16:13 -07:00
Xavier Deguillard
c1a6d6fd21 dirstate: paths in hg are unicode, not bytes
Summary:
This was causing `hg mv` to fail due to trying to hash a unicode path, but
Python3 refuses to hash anything but bytes.

Reviewed By: DurhamG

Differential Revision: D22235561

fbshipit-source-id: 3eb80b8e02d442a4036ab7be7ea5c139bd24ff5e
2020-06-25 15:48:00 -07:00
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