[Commented On] D8937: rust: enable on macOS

Alphare (Raphaël Gomès) phabricator at mercurial-scm.org
Tue Aug 25 07:55:57 UTC 2020


Alphare added a comment.


  In D8937#133743 <https://phab.mercurial-scm.org/D8937#133743>, @danchr wrote:
  
  > I'd like to investigate further, but I'm not sure how to debug the Rust code. The error I get is this:
  >
  >   --- .../tests/test-casefolding.t
  >   +++ .../tests/test-casefolding.t.err
  >   @@ -34,13 +34,226 @@
  >      $ hg mv a A
  >      $ hg mv A a
  >   +  ** unknown exception encountered, please report by visiting
  >   +  ** https://mercurial-scm.org/wiki/BugTracker
  >   +  ** Python 3.8.5 (default, Jul 21 2020, 18:31:18) [Clang 11.0.3 (clang-1103.0.32.62)]
  >   +  ** Mercurial Distributed SCM (version 5.4.1+168-120ca13cb67c+20200821)
  >   +  ** Extensions loaded: 
  >   +  Traceback (most recent call last):
  >   [snip]
  >   +    File ".../mercurial/dirstate.py", line 602, in normalize
  >   +      return self._normalize(path, isknown, ignoremissing)
  >   +    File ".../mercurial/dirstate.py", line 569, in _normalize
  >   +      folded = self._map.filefoldmap.get(normed, None)
  >   +    File ".../mercurial/util.py", line 1744, in __get__
  >   +      result = self.func(obj)
  >   +    File ".../mercurial/dirstate.py", line 1888, in filefoldmap
  >   +      return self._rustmap.filefoldmapasdict()
  >   +  TypeError: unhashable type: 'list'
  >   +  [1]
  >
  > Could you perhaps offer some pointers on how I might investigate what's going wrong?
  
  Some of the code infrastructure needed to support case-insensitive filesystems such as the `filefoldmap` is in place, but only because it mean little to no effort on my part or because some Python code expected the attribute to be there. Having never run the tests on a case-insensitive FS (or really ever been logged in to a machine with one in the last 10 years), I cannot say whether the current code works, it's more of a best effort. It's not that much code: I did not write the normalization routines for example.
  
  The error you're having looks like should be fixed by the change you've proposed. I have no simple way of testing that, though. There is a util in `rust/hg-cpython/src/utils.py` called `print_python_trace` that could help you figure out where the Rust code is being called from that I've used from time to time. Other than that I've mostly looked at the Python/C code to replicate/adapt what was being done and looked at the test output for failures.
  
  To recap: there is quite a bit of code that is missing in order to make the code work on case-insensitive filesystems. You should grep for "TODO" in Rust code, I tried to add one any time I skipped some logic.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8937/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8937

To: danchr, #hg-reviewers, Alphare
Cc: Alphare, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200825/9a9c6ea9/attachment-0002.html>


More information about the Mercurial-patches mailing list