[Request] [+ ] D8937: rust: enable on macOS

danchr (Dan Villiom Podlaski Christiansen) phabricator at mercurial-scm.org
Wed Aug 19 15:52:49 UTC 2020


danchr created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  AFAICT this works quite well, apart from one issue related to the
  dirstate mishandling removed files. I'm not entirely sure why, but
  disabling the code makes all the high-level tests pass.
  
  Most of the Rust tests pass as well, apart from one PathAuditor test.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/hg-core/src/dirstate/dirstate_map.rs
  rust/hg-core/src/lib.rs

CHANGE DETAILS

diff --git a/rust/hg-core/src/lib.rs b/rust/hg-core/src/lib.rs
--- a/rust/hg-core/src/lib.rs
+++ b/rust/hg-core/src/lib.rs
@@ -26,11 +26,10 @@
 pub mod operations;
 pub mod utils;
 
-// Remove this to see (potential) non-artificial compile failures. MacOS
-// *should* compile, but fail to compile tests for example as of 2020-03-06
-#[cfg(not(target_os = "linux"))]
+// Remove this to see (potential) non-artificial compile failures.
+#[cfg(not(any(target_os = "linux", target_os = "macos")))]
 compile_error!(
-    "`hg-core` has only been tested on Linux and will most \
+    "`hg-core` has only been tested on Linux and macOS and will most \
      likely not behave correctly on other platforms."
 );
 
diff --git a/rust/hg-core/src/dirstate/dirstate_map.rs b/rust/hg-core/src/dirstate/dirstate_map.rs
--- a/rust/hg-core/src/dirstate/dirstate_map.rs
+++ b/rust/hg-core/src/dirstate/dirstate_map.rs
@@ -396,6 +396,7 @@
             return file_fold_map;
         }
         let mut new_file_fold_map = FileFoldMap::default();
+        #[cfg(not(target_os="macos"))]
         for (filename, DirstateEntry { state, .. }) in self.state_map.borrow()
         {
             if *state == EntryState::Removed {



To: danchr, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200819/7692cc69/attachment.html>


More information about the Mercurial-patches mailing list