Skip to content
Snippets Groups Projects
  1. Sep 06, 2020
  2. May 29, 2020
    • Raphaël Gomès's avatar
      rust: remove support for `re2` · 9f96beb9
      Raphaël Gomès authored
      With the performance issues with `regex` figured out and fixed in previous
      patches and `regex` newly gaining support for empty alternations, there is no
      reason to keep `re2` around anymore. It's only *marginally* faster at creating
      the regex which saves at most a couple of ms, but gets beaten by `regex` in
      every other aspect.
      
      This removes the Rust/C/C++ bridge (hooray!), the `with-re2` feature, the
      conditional code that goes with it, the documentation and relevant part of the
      debug/module output.
      
      Differential Revision: https://phab.mercurial-scm.org/D8594
      9f96beb9
  3. Mar 23, 2020
    • Raphaël Gomès's avatar
      rust: update all dependencies · d31d1c06
      Raphaël Gomès authored
      We do this periodically to say up to date.
      
      No major versions were crossed this time per se, but the `rand` is still in v0,
      and their 0.7x series broke three things:
          - Some distribution-related elements were moved to a separate crate,
            flashing a deprecation warning
          - The `LogNormal::new` associated function now returns a `Result`
          - Certain RNGs were updated to sample a `u32` instead of `usize` when their
            upper-bound is less than `u32::MAX` for better portability, which changed
            the output for 2 tests.
      
      Moreover, the recent use of the `regex` crate for ignore mechanisms prompted
      some benchmarking that revealed that `regex` was slower at compiling big regex
      than `Re2`. The author of `regex` was very quick to discover an optimization
      that yielded a 30% improvement. It's still slower than `Re2` in that regard, but
      less so in the 1.3.6 release.
      
      Differential Revision: https://phab.mercurial-scm.org/D8320
      d31d1c06
  4. Mar 18, 2020
  5. Mar 06, 2020
    • Raphaël Gomès's avatar
      rust: add logging utils · 82f51ab7
      Raphaël Gomès authored
      This change adds the `log` crate, the community-approved logging facade backed
      by Rust core developers as well as the logging-consumer crate `simple_logger`
      to build a foundation for logging from Rust.
      
      Using this setup allows us to choose how to log depending on the way `hg-core`
      is used: if it's within the context of `hg-cpython`, we might not want to use
      it the same way as with a direct cli for example.
      
      Differential Revision: https://phab.mercurial-scm.org/D8252
      82f51ab7
  6. Jan 16, 2020
    • Raphaël Gomès's avatar
      rust-re2: add wrapper for calling Re2 from Rust · d8d4fa9a
      Raphaël Gomès authored
      This assumes that Re2 is installed following Google's guide. I am not sure
      how we want to integrate it in the project, but I think a follow-up patch would
      be more appropriate for such work.
      As it stands, *not* having Re2 installed results in a compilation error, which
      is a problem as it breaks install compatibility. Hence, this is gated behind
      a non-default `with-re2` compilation feature.
      
      Differential Revision: https://phab.mercurial-scm.org/D7910
      d8d4fa9a
  7. Jan 30, 2020
  8. Oct 14, 2019
    • Yuya Nishihara's avatar
      rust-cpython: prepare for writing tests that require libpython · 8d432d3a
      Yuya Nishihara authored
      What I wanted is to disable the "cpython/extension-module<ver>" feature
      while building tests executable, but that seems not doable. Instead,
      this patch adds new features dedicated for tests.
      
      The make rule is extracted so that we can easily run cargo tests.
      
      Added a minimal test of ref-sharing as an example. More tests will follow.
      8d432d3a
  9. Oct 13, 2019
  10. Jul 02, 2019
    • Raphaël Gomès's avatar
      rust: switch hg-core and hg-cpython to rust 2018 edition · 326fdce2
      Raphaël Gomès authored
      Many interesting changes have happened in Rust since the Oxidation Plan was
      introduced, like the 2018 edition and procedural macros:
      
          - Opting in to the 2018 edition is a clear benefit in terms of future
            proofing, new (nice to have) syntactical sugar notwithstanding. It
            also has a new non-lexical, non-AST based borrow checker that has
            fewer bugs(!) and allows us to write correct code that in some cases
            would have been rejected by the old one.
          - Procedural macros allow us to use the PyO3 crate which maintainers have
            expressed the clear goal of compiling on stable, which would help in
            code maintainability compared to rust-cpython.
      
      In this patch are the following changes:
          - Removing most `extern crate` uses
          - Updating `use` clauses (`crate` keyword, nested `use`)
          - Removing `mod.rs` in favor of an aptly named module file
      
      Like discussed in the mailing list (
      https://www.mercurial-scm.org/pipermail/mercurial-devel/2019-July/132316.html
      ), until Rust integration in Mercurial is considered to be out of the
      experimental phase, the maximum version of Rust allowed is whatever the latest
      version Debian packages.
      
      Differential Revision: https://phab.mercurial-scm.org/D6597
      326fdce2
  11. Dec 17, 2018
  12. Dec 03, 2018
    • Georges Racinet's avatar
      rust-cpython: start cpython crate bindings · 5532823e
      Georges Racinet authored
      This changeset introduces the hg-cpython crate,
      that compiles as a shared library holding a whole
      Python package (mercurial.rustext), with only the empty
      'ancestor' submodule for now.
      
      Such bindings will be easier and safer to develop and maintain
      that those of `hg-direct-ffi`.
      They don't involve C code, only unsafe Rust that's mostly isolated
      within the cpython crate.
      
      The long-term goal would be to import the provided modules, such
      as rustext.ancestor with mercurial.policy.importmod, same as
      we already do with cext modules.
      
      Differential Revision: https://phab.mercurial-scm.org/D5434
      5532823e
Loading