Patchwork D6135: packaging: don't bundle DLLs in py2exe library.zip for x86 builds

login
register
mail settings
Submitter phabricator
Date March 15, 2019, 1:39 a.m.
Message ID <differential-rev-PHID-DREV-ulojeealj57y2znl3ugx-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/39255/
State Superseded
Headers show

Comments

phabricator - March 15, 2019, 1:39 a.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I had ported the x86/x64 behavior difference from the Inno
  Setup installer files. Why things were this way, I'm not sure.
  
  The WiX configuration files are expecting to have standalone
  DLL files for both configurations. And the 32-bit WiX installers
  were broken due to missing DLLs.
  
  Let's standardize on standalone DLL files on all configurations
  for consistency. I /think/ this will be faster, as I /think/
  py2exe binaries would have to extract the DLL to a temporary file
  in order to load it. But I'm not 100% sure about that.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/packaging/hgpackaging/py2exe.py
  contrib/packaging/inno/mercurial.iss
  setup.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel
phabricator - March 16, 2019, 5:39 p.m.
indygreg added a comment.


  According to a private email, things were inconsistent because py2exe didn't (doesn't?) support bundling DLLs in the zip several years ago, so things *had* to be a certain way.
  
  I haven't tested things today, but py2exe does have code to load DLLs from a memory location. So it /might/ be loading from the zip without filesystem I/O. If it does, we may want to change this to level 2 by default.
  
  It's not a big deal though and can be done as a follow-up.

REPOSITORY
  rHG Mercurial

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

To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1364,6 +1364,7 @@ 
       distclass=hgdist,
       options={
           'py2exe': {
+              'bundle_files': 3,
               'dll_excludes': py2exedllexcludes,
               'excludes': py2exeexcludes,
               'packages': py2exepackages,
diff --git a/contrib/packaging/inno/mercurial.iss b/contrib/packaging/inno/mercurial.iss
--- a/contrib/packaging/inno/mercurial.iss
+++ b/contrib/packaging/inno/mercurial.iss
@@ -71,10 +71,8 @@ 
 Source: contrib\win32\ReadMe.html; DestDir: {app}; Flags: isreadme
 Source: contrib\win32\postinstall.txt; DestDir: {app}; DestName: ReleaseNotes.txt
 Source: dist\hg.exe; DestDir: {app}; AfterInstall: Touch('{app}\hg.exe.local')
-#if ARCH == "x64"
 Source: dist\lib\*.dll; Destdir: {app}\lib
 Source: dist\lib\*.pyd; Destdir: {app}\lib
-#endif
 Source: dist\python*.dll; Destdir: {app}; Flags: skipifsourcedoesntexist
 Source: dist\msvc*.dll; DestDir: {app}; Flags: skipifsourcedoesntexist
 Source: dist\Microsoft.VC*.CRT.manifest; DestDir: {app}; Flags: skipifsourcedoesntexist
diff --git a/contrib/packaging/hgpackaging/py2exe.py b/contrib/packaging/hgpackaging/py2exe.py
--- a/contrib/packaging/hgpackaging/py2exe.py
+++ b/contrib/packaging/hgpackaging/py2exe.py
@@ -128,7 +128,7 @@ 
     print('building Mercurial')
     subprocess.run(
         [str(venv_python), 'setup.py',
-         'py2exe', '-b', '3' if vc_x64 else '2',
+         'py2exe',
          'build_doc', '--html'],
         cwd=str(source_dir),
         env=env,