diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -667,16 +667,51 @@ class buildhgextindex(Command):
class buildhgexe(build_ext):
description = 'compile hg.exe from mercurial/exewrapper.c'
- LONG_PATHS_MANIFEST = """
-
-
-
-
- true
-
-
- """
+ LONG_PATHS_MANIFEST = """\
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+"""
def initialize_options(self):
build_ext.initialize_options(self)
@@ -776,21 +811,18 @@ class buildhgexe(build_ext):
exefname = self.compiler.executable_filename(self.hgtarget)
fdauto, manfname = tempfile.mkstemp(suffix='.hg.exe.manifest')
os.close(fdauto)
- with open(manfname, 'w') as f:
+ with open(manfname, 'w', encoding="UTF-8") as f:
f.write(self.LONG_PATHS_MANIFEST)
log.info("long paths manifest is written to '%s'" % manfname)
- inputresource = '-inputresource:%s;#1' % exefname
outputresource = '-outputresource:%s;#1' % exefname
log.info("running mt.exe to update hg.exe's manifest in-place")
- # supplying both -manifest and -inputresource to mt.exe makes
- # it merge the embedded and supplied manifests in the -outputresource
+
self.spawn(
[
self.compiler.mt,
'-nologo',
'-manifest',
manfname,
- inputresource,
outputresource,
]
)