Commit Graph

24 Commits

Author SHA1 Message Date
Jun Wu
2aa85dc4d7 version: a Rust crate providing version information
Summary: Otherwise the version information is only available in Python.

Reviewed By: DurhamG

Differential Revision: D19803762

fbshipit-source-id: 044c5da86efc8c657d0c422a2b1947086444895e
2020-05-18 09:00:40 -07:00
Jun Wu
ff7a6b43d3 pyre2: use Rust regex backend
Summary: Switch from re2 to the Rust regex engine.

Reviewed By: DurhamG

Differential Revision: D20973178

fbshipit-source-id: 2707bfb2120ceb3758a81c01a5a6f4f8c61758bc
2020-05-12 16:32:51 -07:00
Mark Thomas
26f6dc8fb3 setup.py: add converter.py to fbsource-thrift blacklist
Reviewed By: farnz

Differential Revision: D21500308

fbshipit-source-id: 663f3d9457a153945f23b8e8bccd16f9c052b2cb
2020-05-11 09:12:07 -07:00
Mark Thomas
052e7c3877 check-code: convert to Python 3
Summary:
Update `contrib/check-code.py` to Python 3.

Mostly it was already compatible, however stricter regular expression parsing
revealed a case where one of our tests wasn't working, and as a result lots of
instances of `open(file).read()` existed that this test should have caught.

I have fixed up most of the instances in the code, although there are many
in the test suite that I have ignored for now.

Reviewed By: quark-zju

Differential Revision: D21427212

fbshipit-source-id: 7461a7c391e0ade947f779a2b476ca937fd24a8d
2020-05-07 09:07:50 -07:00
Durham Goode
3ac2be361a configs: move fbrules to a Facebook only part of the crate
Summary:
We'll be adding a bunch of Facebook specific configuration and values
here. Let's move it to someplace not open source.

Reviewed By: quark-zju

Differential Revision: D21241038

fbshipit-source-id: 2ac9cdce40b1b46f15f171d9d1f6b6692dcd29bf
2020-05-01 13:17:21 -07:00
Jun Wu
514f0141f8 patch: use diffhelpers from Rust bindings
Summary:
Drop other diffhelpers implementations.
The Rust implementation does a better job on type checks and won't segfault.

Reviewed By: xavierd

Differential Revision: D20935367

fbshipit-source-id: f59240f3a661efe1ca6e451922bcb3ca6ee6ae22
2020-04-09 18:25:53 -07:00
Xavier Deguillard
08984182b9 setup: write the pyc before the py during packaging
Summary:
I'm not exactly sure why, but my guess is that by writing the py files first,
the pyc might be copied and not generated, causing Python to not read the pyc
at import time, leading to slow startup time.

Reviewed By: quark-zju

Differential Revision: D20829130

fbshipit-source-id: e838ff18b9fbf65d1a9437e0a8ef58d57803d2fa
2020-04-03 11:35:29 -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
Jun Wu
a7dedfdfd6 fsinfo: remove old getfstype implementation
Summary: Remove the old Python, C implementation of getfstype.

Reviewed By: xavierd

Differential Revision: D20313385

fbshipit-source-id: 475c73343aae2fa2f5ad898c7b0879bfa2c80e93
2020-03-11 17:35:41 -07:00
Xavier Deguillard
ffced54dff packaging: add edenscm/hgext/convert/repo
Summary: The python files were missing in the package, let's add them.

Reviewed By: quark-zju

Differential Revision: D20163637

fbshipit-source-id: 0a7870a21c42d9b92a8b78b51e4954db0d96c593
2020-02-28 12:15:10 -08:00
Adam Simpkins
6f824649ff use absolute includes to the third-party xdiff code
Summary:
Update includes to the third-party xdiff.h file to use absolute includes
from the repository root.  This allows many parts of our internal build
tooling to work better, including automatic dependency processing.

Reviewed By: xavierd

Differential Revision: D19958228

fbshipit-source-id: 341dd8c94f1138cf4a387b92e1817b2a286d6aa1
2020-02-19 13:05:06 -08:00
Adam Simpkins
5ffa268af2 use absolute includes for the native cext modules
Summary:
Update the C files under edenscm/mercurial/cext to use absolute includes from
the repository root.  Also update a few of the libraries in edenscm/mercurial
that the cext code depends on.

This makes these files easier to build with Buck in fbsource, and reduces the
number of places where we have to use deprecated Buck functionality to help
find these headers.  This also allows autodeps to work with the build targets
for these rules.

Reviewed By: xavierd

Differential Revision: D19958221

fbshipit-source-id: e6e471583a795ba5773bae5f16ed582c9c5fd57e
2020-02-19 13:05:06 -08:00
Xavier Deguillard
3c41bd2a92 build: use vendored crate from third-party
Summary:
Now that the source of truth for third-party crates is in fbsource, let's use
it in our cargo build system. This removes the need to fetch a tarball and
untar it, which should have the benefit of speeding up the build.

A small caveat is the first build on EdenFS will be slightly slower, due to
crates needing to be individually fetched, subsequent builds will be faster.

Reviewed By: jsgf

Differential Revision: D19726217

fbshipit-source-id: 24f484d1e3118a76e052f07ff3eea0c66cccce96
2020-02-05 17:49:06 -08:00
Jun Wu
1bcfec407d py3: remove pycompat3
Summary:
Use `abc.ABC` from Python 3 stdlib directly. The definition matches
`pycompat3.py`:

  class ABC(metaclass=ABCMeta):
      pass

The following changes are reverted since they're no longer necessary:

  D19732319 "[hg] py3: fix windows build"
  D19703778 "[hg] py3: exclude mercurial/pycompat3.py from Python 2 builds"
  D19703779 "[hg] py3: exclude pycompat3.py from Buck-based Python 2 builds"

Reviewed By: simpkins, singhsrb

Differential Revision: D19739075

fbshipit-source-id: 8c1e3727e8a88ff5f7232270d528d690523b1824
2020-02-04 22:15:16 -08:00
Durham Goode
fd47fd9202 py3: fix windows build
Summary:
We added pycompat3.py which only parses in Python 3. We need to
exclude it from the Windows build as well.

Unfortunately, the Windows build users PyZipFile.writepy which writes an entire
directory. Let's copy in the implementation from Python 3 which allows us to
filter out certain files.

Reviewed By: xavierd

Differential Revision: D19732319

fbshipit-source-id: 4cebb434d052c51d9ae0dccdec5eadd1f412f9e5
2020-02-04 15:40:35 -08:00
Adam Simpkins
bb9599d1ba py3: exclude mercurial/pycompat3.py from Python 2 builds
Summary:
Update setup.py to exclude `edenscm/mercurial/pycompat3.py` when building
for Python 2.

Reviewed By: quark-zju

Differential Revision: D19703778

fbshipit-source-id: 269f1d4e746eb5112a9e577f43c040f2946b07d1
2020-02-03 15:13:09 -08:00
Jun Wu
8703970cea py3: update Cargo.toml to make py3 buildable
Summary:
This makes `make hg3` work. It requires cleaning up the `build` directory when
switching between py2 and py3 build, which will be fixed later.

Reviewed By: DurhamG

Differential Revision: D19604824

fbshipit-source-id: 060ff313420126a5dba935c4451b45dc9af45f13
2020-01-28 13:39:38 -08:00
Stefan Filip
2dc14cf9a6 manifest: use Rust Tree Manifest by default
Summary:
The Rust Manifest is deployed practically everywhere.
Removing the C++ code from being compiled in Mercurial along with all of the cstore extension.

Reviewed By: quark-zju

Differential Revision: D19543248

fbshipit-source-id: d632e171175e6866563c1aa0808a099b67bd937d
2020-01-23 16:06:51 -08:00
Jun Wu
755a238a5d osutil: remove usage of ApplicationServices
Summary:
We recently saw a high rate of build failures on MacOS.
They all fail with compiler errors like:

    In file included from edenscm/mercurial/cext/osutil.c:1326:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk//System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:23:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk//System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:39:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk//System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LaunchServices.h:23:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk//System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/IconsCore.h:23:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk//System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/OSServices.h:29:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk//System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentity.h:43:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk//System/Library/Frameworks/Security.framework/Headers/Security.h:38:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk//System/Library/Frameworks/Security.framework/Headers/SecProtocolOptions.h:28:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk//System/Library/Frameworks/Security.framework/Headers/SecProtocolTypes.h:158:19: error: missing ',' between enumerators
        kTLSProtocol12 CF_ENUM_DEPRECATED(10_2, 10_15, 5_0, 13_0) = 8,
                      ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk//System/Library/Frameworks/Security.framework/Headers/SecProtocolTypes.h:158:20: error: redefinition of enumerator '__AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_15'
        kTLSProtocol12 CF_ENUM_DEPRECATED(10_2, 10_15, 5_0, 13_0) = 8,
                   ^

It's unclear whether this is a compiler configuration issue, or the Apple SDK
being buggy.

The only user of ApplicationServices is `isgui()` when `$SSH_CONNECTION` is not
set on MacOS.

It seems to me that if we just replace `isgui()` to `True`, very few if nobody
will notice the difference. Therefore let's remove the problematic
ApplicationServices as an attempt to stabilize the build.

FWIW Git does not seem to have any sort of GUI detection. It seems to solely
rely on (static) user configuration.

This reverts part of https://www.mercurial-scm.org/repo/hg/rev/16118b4859a1.

Reviewed By: singhsrb

Differential Revision: D19441351

fbshipit-source-id: f1bfbaf0d015e8d577a83112b5ea0a4be6367156
2020-01-17 07:25:37 -08:00
Jun Wu
138ad4961f setup: include pdb and py files on Windows package
Summary: Add hg.pdb and pure Python source code on Windows for easier debugging.

Reviewed By: markbt

Differential Revision: D19351559

fbshipit-source-id: 8515a84dc58df7c44fd324cc69b7b142fd063b8f
2020-01-13 09:43:57 -08:00
Jun Wu
56b1f098dd bindings: move indexes and threading to bindings
Summary:
For some reason, our linker flag `-uinitthreading` no longer works in buck opt
build. This affects the `indexes` and `threading` Python extensions. Move them
to `bindings` to solve the problem.

Reviewed By: fanzeyi

Differential Revision: D19340538

fbshipit-source-id: 0c82b472f2916229d3c5e481954b69415b5b0dc2
2020-01-09 20:02:00 -08:00
Xavier Deguillard
82082bfaf8 policy: simplify it
Summary:
We only support the "C" policy, therefore let's inline it and simplify the code
significantly.

Reviewed By: quark-zju

Differential Revision: D18819680

fbshipit-source-id: 0bc0a12b85ddc42af007d3a20c0f4e8497bedb21
2019-12-09 13:13:27 -08:00
Genevieve Helsel
1d6749828e update build eden thrift dependencys and update setup.py to know about new thrift structs
Summary: fix the `build-eden-thrift-deps.py` to generate a new zip file, upload it to lfs, and point setup.py to use this new generated thrift code

Reviewed By: quark-zju

Differential Revision: D18836545

fbshipit-source-id: 52c58c50319c878f2f6f708b952f0aa158d2ef4e
2019-12-05 15:16:33 -08:00
Adam Simpkins
ab3a7cb21f Move fb-mercurial sources into an eden/scm subdirectory.
Summary:
In preparation for merging fb-mercurial sources to the Eden repository,
move everything from the top-level directory into an `eden/scm`
subdirectory.
2019-11-13 16:04:48 -08:00