Patchwork [11,of,12,RFC] policy: relax the default for in-place build

login
register
mail settings
Submitter Yuya Nishihara
Date May 7, 2017, 1:45 a.m.
Message ID <89045bec86dcb51ac064.1494121552@mimosa>
Download mbox | patch
Permalink /patch/20509/
State Accepted
Headers show

Comments

Yuya Nishihara - May 7, 2017, 1:45 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1493215363 -32400
#      Wed Apr 26 23:02:43 2017 +0900
# Node ID 89045bec86dcb51ac0641e06abd59e82d3c22172
# Parent  75ce28f234b4e0d0f0ad65f5657d12a76bba0d8e
policy: relax the default for in-place build

We're going to make the 'c' policy more strict, where no missing attribute
will be allowed. Since we want to run 'hg bisect' without rebuilding the C
extension modules, we'll need a looser policy for development environment.

The default for system installation isn't changed.

Note that the current 'c' policy is practically 'allow'-ish as we have lots
of adhoc fallbacks to pure functions.
Augie Fackler - May 13, 2017, 2:15 a.m.
On Sun, May 07, 2017 at 10:45:52AM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1493215363 -32400
> #      Wed Apr 26 23:02:43 2017 +0900
> # Node ID 89045bec86dcb51ac0641e06abd59e82d3c22172
> # Parent  75ce28f234b4e0d0f0ad65f5657d12a76bba0d8e
> policy: relax the default for in-place build

queued, thanks (per junw's request a few days back)

What's the status of patch 12 and junw's related-looking series? I'm a
little lost on the state there.
Yuya Nishihara - May 13, 2017, 9:55 a.m.
On Fri, 12 May 2017 22:15:12 -0400, Augie Fackler wrote:
> On Sun, May 07, 2017 at 10:45:52AM +0900, Yuya Nishihara wrote:
> > # HG changeset patch
> > # User Yuya Nishihara <yuya@tcha.org>
> > # Date 1493215363 -32400
> > #      Wed Apr 26 23:02:43 2017 +0900
> > # Node ID 89045bec86dcb51ac0641e06abd59e82d3c22172
> > # Parent  75ce28f234b4e0d0f0ad65f5657d12a76bba0d8e
> > policy: relax the default for in-place build
> 
> queued, thanks (per junw's request a few days back)
> 
> What's the status of patch 12 and junw's related-looking series? I'm a
> little lost on the state there.

Maybe I need to review Jun's series. Things to be done:

 1. queue Jun's patches that add version constants
 2. send new version of the patch 12 and remainder
 3. add real version comparison (new version of Jun's previous series)

Patch

diff --git a/mercurial/policy.py b/mercurial/policy.py
--- a/mercurial/policy.py
+++ b/mercurial/policy.py
@@ -18,8 +18,10 @@  import sys
 #    cffi-allow - allow pure Python implementation if cffi version is missing
 #    py - only load pure Python modules
 #
-# By default, require the C extensions for performance reasons.
-policy = b'c'
+# By default, fall back to the pure modules so the in-place build can
+# run without recompiling the C extensions. This will be overridden by
+# __modulepolicy__ generated by setup.py.
+policy = b'allow'
 policynoc = (b'cffi', b'cffi-allow', b'py')
 policynocffi = (b'c', b'py')
 
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -372,6 +372,9 @@  class hgbuildpy(build_py):
     def run(self):
         if self.distribution.pure:
             modulepolicy = 'py'
+        elif self.build_lib == '.':
+            # in-place build should run without rebuilding C extensions
+            modulepolicy = 'allow'
         else:
             modulepolicy = 'c'
         with open("mercurial/__modulepolicy__.py", "w") as f: