pyoxidizer: simplify targets
authorGregory Szorc <gregory.szorc@gmail.com>
Thu, 06 May 2021 15:58:37 -0700
changeset 47203 9438e9b7321a
parent 47202 0de5eefbe4b2
child 47204 3380848c6e04
pyoxidizer: simplify targets 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. Differential Revision: https://phab.mercurial-scm.org/D10681
rust/hgcli/pyoxidizer.bzl
--- a/rust/hgcli/pyoxidizer.bzl	Thu May 06 15:56:04 2021 -0700
+++ b/rust/hgcli/pyoxidizer.bzl	Thu May 06 15:58:37 2021 -0700
@@ -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()