Patchwork D8246: hg-core: add a compilation error if trying to compile outside of Linux

login
register
mail settings
Submitter phabricator
Date March 11, 2020, 4:34 p.m.
Message ID <faa9ff47eb857a3ef3b1fedfd716d1a6@localhost.localdomain>
Download mbox | patch
Permalink /patch/45740/
State Not Applicable
Headers show

Comments

phabricator - March 11, 2020, 4:34 p.m.
Closed by commit rHG5a50e8c39b82: hg-core: add a compilation error if trying to compile outside of Linux (authored by Alphare).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8246?vs=20542&id=20735

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

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

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

CHANGE DETAILS




To: Alphare, #hg-reviewers, pulkit
Cc: mercurial-devel
Yuya Nishihara - March 12, 2020, 12:53 p.m.
> +/// Remove this to see (potential) non-artificial compile failures. MacOS
> +/// *should* compile, but fail to compile tests for example as of 2020-03-06

Un-doccommented this to silence build warning.
phabricator - March 12, 2020, 1:02 p.m.
yuja added a comment.


  > +/// Remove this to see (potential) non-artificial compile failures. MacOS
  > +/// *should* compile, but fail to compile tests for example as of 2020-03-06
  
  Un-doccommented this to silence build warning.

REPOSITORY
  rHG Mercurial

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

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

To: Alphare, #hg-reviewers, pulkit
Cc: yuja, 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
@@ -23,6 +23,14 @@ 
 pub use revlog::*;
 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;
 pub use filepatterns::{
     build_single_regex, read_pattern_file, PatternSyntax, PatternTuple,