Mercurial > public > mercurial-scm > hg
diff setup.py @ 44466:79ac59d3f73d
setup-rust: remove the legacy 'direct-ffi' variant
This variant have been abandoned for a while. Keeping it around just get people
confused.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 06 Mar 2020 16:49:46 +0100 |
parents | 9d2b2df2c2ba |
children | ad718271a9eb |
line wrap: on
line diff
--- a/setup.py Tue Feb 18 18:32:31 2020 +0100 +++ b/setup.py Fri Mar 06 16:49:46 2020 +0100 @@ -3,6 +3,7 @@ # # 'python setup.py install', or # 'python setup.py --help' for more options +from __future__ import print_function import os @@ -141,7 +142,9 @@ # TODO record it for proper rebuild upon changes # (see mercurial/__modulepolicy__.py) if hgrustext != 'cpython' and hgrustext is not None: - hgrustext = 'direct-ffi' + if hgrustext: + print('unkown HGWITHRUSTEXT value: %s' % hgrustext, file=sys.stderr) + hgrustext = None import ctypes import errno @@ -543,7 +546,7 @@ # Build Rust standalon extensions if it'll be used # and its build is not explictely disabled (for external build # as Linux distributions would do) - if self.distribution.rust and self.rust and hgrustext != 'direct-ffi': + if self.distribution.rust and self.rust: for rustext in ruststandalones: rustext.build('' if self.inplace else self.build_lib) @@ -1391,29 +1394,6 @@ ) -class RustEnhancedExtension(RustExtension): - """A C Extension, conditionally enhanced with Rust code. - - If the HGWITHRUSTEXT environment variable is set to something else - than 'cpython', the Rust sources get compiled and linked within - the C target shared library object. - """ - - def __init__(self, mpath, sources, rustlibname, subcrate, **kw): - RustExtension.__init__( - self, mpath, sources, rustlibname, subcrate, **kw - ) - if hgrustext != 'direct-ffi': - return - self.extra_compile_args.append('-DWITH_RUST') - self.libraries.append(rustlibname) - self.library_dirs.append(self.rusttargetdir) - - def rustbuild(self): - if hgrustext == 'direct-ffi': - RustExtension.rustbuild(self) - - class RustStandaloneExtension(RustExtension): def __init__(self, pydottedname, rustcrate, dylibname, **kw): RustExtension.__init__( @@ -1453,7 +1433,7 @@ include_dirs=common_include_dirs, depends=common_depends, ), - RustEnhancedExtension( + Extension( 'mercurial.cext.parsers', [ 'mercurial/cext/charencode.c', @@ -1463,16 +1443,9 @@ 'mercurial/cext/pathencode.c', 'mercurial/cext/revlog.c', ], - 'hgdirectffi', - 'hg-direct-ffi', include_dirs=common_include_dirs, depends=common_depends - + [ - 'mercurial/cext/charencode.h', - 'mercurial/cext/revlog.h', - 'rust/hg-core/src/ancestors.rs', - 'rust/hg-core/src/lib.rs', - ], + + ['mercurial/cext/charencode.h', 'mercurial/cext/revlog.h',], ), Extension( 'mercurial.cext.osutil',