Patchwork D8479: packaging: add -python2 to Windows installer filenames

login
register
mail settings
Submitter phabricator
Date April 24, 2020, 3:29 a.m.
Message ID <differential-rev-PHID-DREV-3h56amxmyu2cdcfubsqd-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46230/
State Superseded
Headers show

Comments

phabricator - April 24, 2020, 3:29 a.m.
indygreg created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  We just taught the Windows installers to produce Python 3 variants
  built with PyOxidizer.
  
  Our plan is to publish both Python 2 and Python 3 versions of the
  installers for Mercurial 5.4.
  
  This commit teaches the Inno and WiX installers to add an optional
  string suffix to the installer name. On Python 2, that suffix is
  "-python2." We reserve the existing name for the Python 3 installers,
  which we want to make the default.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  contrib/automation/hgautomation/windows.py
  contrib/packaging/hgpackaging/inno.py
  contrib/packaging/hgpackaging/wix.py
  contrib/packaging/inno/mercurial.iss

CHANGE DETAILS




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

Patch

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
@@ -9,14 +9,13 @@ 
 AppCopyright=Copyright 2005-2020 Matt Mackall and others
 AppName=Mercurial
 AppVersion={#VERSION}
+OutputBaseFilename=Mercurial-{#VERSION}{#SUFFIX}
 #if ARCH == "x64"
 AppVerName=Mercurial {#VERSION} (64-bit)
-OutputBaseFilename=Mercurial-{#VERSION}-x64
 ArchitecturesAllowed=x64
 ArchitecturesInstallIn64BitMode=x64
 #else
 AppVerName=Mercurial {#VERSION}
-OutputBaseFilename=Mercurial-{#VERSION}
 #endif
 InfoAfterFile=../postinstall.txt
 LicenseFile=Copying.txt
diff --git a/contrib/packaging/hgpackaging/wix.py b/contrib/packaging/hgpackaging/wix.py
--- a/contrib/packaging/hgpackaging/wix.py
+++ b/contrib/packaging/hgpackaging/wix.py
@@ -358,6 +358,7 @@ 
         version=version,
         python2=True,
         msi_name=msi_name,
+        suffix="-python2",
         extra_wxs=extra_wxs,
         extra_features=extra_features,
         signing_info=signing_info,
@@ -415,6 +416,7 @@ 
     version: str,
     python2: bool,
     msi_name: typing.Optional[str] = "mercurial",
+    suffix: str = "",
     extra_wxs: typing.Optional[typing.Dict[str, str]] = None,
     extra_features: typing.Optional[typing.List[str]] = None,
     signing_info: typing.Optional[typing.Dict[str, str]] = None,
@@ -489,7 +491,9 @@ 
     run_candle(wix_path, build_dir, source, source_build_rel, defines=defines)
 
     msi_path = (
-        source_dir / 'dist' / ('%s-%s-%s.msi' % (msi_name, orig_version, arch))
+        source_dir
+        / 'dist'
+        / ('%s-%s-%s%s.msi' % (msi_name, orig_version, arch, suffix))
     )
 
     args = [
diff --git a/contrib/packaging/hgpackaging/inno.py b/contrib/packaging/hgpackaging/inno.py
--- a/contrib/packaging/hgpackaging/inno.py
+++ b/contrib/packaging/hgpackaging/inno.py
@@ -111,6 +111,7 @@ 
         iscc_exe,
         version,
         arch="x64" if vc_x64 else None,
+        suffix="-python2",
     )
 
 
@@ -150,6 +151,7 @@ 
     iscc_exe: pathlib.Path,
     version,
     arch=None,
+    suffix="",
 ):
     """Build an Inno installer from staged Mercurial files.
 
@@ -214,6 +216,9 @@ 
 
     if arch:
         args.append('/dARCH=%s' % arch)
+        args.append('/dSUFFIX=-%s%s' % (arch, suffix))
+    else:
+        args.append('/dSUFFIX=-x86%s' % suffix)
 
     if not version:
         version = read_version_py(source_dir)
diff --git a/contrib/automation/hgautomation/windows.py b/contrib/automation/hgautomation/windows.py
--- a/contrib/automation/hgautomation/windows.py
+++ b/contrib/automation/hgautomation/windows.py
@@ -108,10 +108,10 @@ 
 WHEEL_FILENAME_PYTHON38_X86 = 'mercurial-{version}-cp38-cp38-win32.whl'
 WHEEL_FILENAME_PYTHON38_X64 = 'mercurial-{version}-cp38-cp38-win_amd64.whl'
 
-X86_EXE_FILENAME = 'Mercurial-{version}.exe'
-X64_EXE_FILENAME = 'Mercurial-{version}-x64.exe'
-X86_MSI_FILENAME = 'mercurial-{version}-x86.msi'
-X64_MSI_FILENAME = 'mercurial-{version}-x64.msi'
+X86_EXE_FILENAME = 'Mercurial-{version}-x86-python2.exe'
+X64_EXE_FILENAME = 'Mercurial-{version}-x64-python2.exe'
+X86_MSI_FILENAME = 'mercurial-{version}-x86-python2.msi'
+X64_MSI_FILENAME = 'mercurial-{version}-x64-python2.msi'
 
 MERCURIAL_SCM_BASE_URL = 'https://mercurial-scm.org/release/windows'