Patchwork D9852: rust: lower compile error on non-linux platforms to a warning

login
register
mail settings
Submitter phabricator
Date Jan. 22, 2021, 10:15 a.m.
Message ID <differential-rev-PHID-DREV-emaahb6wroyrpeqkacbd-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48163/
State Superseded
Headers show

Comments

phabricator - Jan. 22, 2021, 10:15 a.m.
danchr created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/hg-core/src/lib.rs
  setup.py

CHANGE DETAILS




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

Patch

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -609,6 +609,12 @@ 
         # and its build is not explictely disabled (for external build
         # as Linux distributions would do)
         if self.distribution.rust and self.rust:
+            if not sys.platform.startswith('linux'):
+                self.warn(
+                    "rust extensions have only been tested on Linux "
+                    "and may not behave correctly on other platforms; "
+                )
+
             for rustext in ruststandalones:
                 rustext.build('' if self.inplace else self.build_lib)
 
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
@@ -30,14 +30,6 @@ 
 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"))]
-compile_error!(
-    "`hg-core` has only been tested on Linux and will most \
-     likely not behave correctly on other platforms."
-);
-
 use crate::utils::hg_path::{HgPathBuf, HgPathError};
 pub use filepatterns::{
     parse_pattern_syntax, read_pattern_file, IgnorePattern,