Patchwork D8937: rust: enable on macOS

login
register
mail settings
Submitter phabricator
Date Aug. 19, 2020, 3:52 p.m.
Message ID <differential-rev-PHID-DREV-ezlhyjxuczqqhrdjbvfd-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47037/
State New
Headers show

Comments

phabricator - Aug. 19, 2020, 3:52 p.m.
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




To: danchr, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

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 {