Patchwork D10681: pyoxidizer: simplify targets

login
register
mail settings
Submitter phabricator
Date May 7, 2021, 12:01 a.m.
Message ID <differential-rev-PHID-DREV-5p7eqvh2yemp6vcxrspu-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49000/
State Superseded
Headers show

Comments

phabricator - May 7, 2021, 12:01 a.m.
indygreg created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The split targets existed to enable the use of a non-default
  distribution flavor on Windows. Modern versions of PyOxidizer
  use the "standalone_dynamic" distribution flavor by default.
  So our split brain workaround is no longer needed.
  
  Here, we unify the targets. We also remove an unreferenced
  target function to create a resources file.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/hgcli/pyoxidizer.bzl

CHANGE DETAILS




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

Patch

diff --git a/rust/hgcli/pyoxidizer.bzl b/rust/hgcli/pyoxidizer.bzl
--- a/rust/hgcli/pyoxidizer.bzl
+++ b/rust/hgcli/pyoxidizer.bzl
@@ -10,9 +10,6 @@ 
 def make_distribution():
     return default_python_distribution(python_version = "3.8")
 
-def make_distribution_windows():
-    return default_python_distribution(flavor = "standalone_dynamic")
-
 def resource_callback(policy, resource):
     if not IS_WINDOWS:
         resource.add_location = "in-memory"
@@ -83,26 +80,8 @@ 
 
     return m
 
-def make_embedded_resources(exe):
-    return exe.to_embedded_resources()
-
-register_target("distribution_posix", make_distribution)
-register_target("distribution_windows", make_distribution_windows)
-
-register_target("exe_posix", make_exe, depends = ["distribution_posix"])
-register_target("exe_windows", make_exe, depends = ["distribution_windows"])
-
-register_target(
-    "app_posix",
-    make_manifest,
-    depends = ["distribution_posix", "exe_posix"],
-    default = "windows" not in BUILD_TARGET_TRIPLE,
-)
-register_target(
-    "app_windows",
-    make_manifest,
-    depends = ["distribution_windows", "exe_windows"],
-    default = "windows" in BUILD_TARGET_TRIPLE,
-)
+register_target("distribution", make_distribution)
+register_target("exe", make_exe, depends = ["distribution"])
+register_target("app", make_manifest, depends = ["distribution", "exe"], default = True)
 
 resolve_targets()