Patchwork D9289: pyoxidizer: default to one-file binary on non-Windows platforms

login
register
mail settings
Submitter phabricator
Date Nov. 10, 2020, 6:17 p.m.
Message ID <differential-rev-PHID-DREV-jluzfkgemb5qwdtqtwnl-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47564/
State Superseded
Headers show

Comments

phabricator - Nov. 10, 2020, 6:17 p.m.
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Windows has some extra constraints that require a multi-file install,
  but we expect folks to use an MSI or similar installer there so it's
  less of a big deal.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/hgcli/pyoxidizer.bzl

CHANGE DETAILS




To: durin42, #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
@@ -14,6 +14,9 @@ 
     return default_python_distribution(flavor = "standalone_dynamic")
 
 def resource_callback(policy, resource):
+    if not IS_WINDOWS:
+        resource.add_location = "in-memory"
+        return
     # We use a custom resource routing policy to influence where things are loaded
     # from.
     #
@@ -40,7 +43,8 @@ 
     # extensions.
     packaging_policy.extension_module_filter = "all"
     packaging_policy.resources_location = "in-memory"
-    packaging_policy.resources_location_fallback = "filesystem-relative:lib"
+    if IS_WINDOWS:
+        packaging_policy.resources_location_fallback = "filesystem-relative:lib"
     packaging_policy.register_resource_callback(resource_callback)
 
     config = dist.make_python_interpreter_config()