indygreg created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I'll be refactoring how the WiX installer creation calls into
  pyoxidizer and will need a lower level function for facilitating
  that.
  
  The new `run_pyoxidizer()` builds our execution environment
  (with gettext available) and invokes `pyoxidizer`.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  contrib/packaging/hgpackaging/pyoxidizer.py

CHANGE DETAILS

diff --git a/contrib/packaging/hgpackaging/pyoxidizer.py 
b/contrib/packaging/hgpackaging/pyoxidizer.py
--- a/contrib/packaging/hgpackaging/pyoxidizer.py
+++ b/contrib/packaging/hgpackaging/pyoxidizer.py
@@ -68,16 +68,14 @@
     )
 
 
-def create_pyoxidizer_install_layout(
-    source_dir: pathlib.Path,
-    build_dir: pathlib.Path,
-    out_dir: pathlib.Path,
-    target_triple: str,
-):
-    """Build Mercurial with PyOxidizer and copy additional files into place.
+def run_pyoxidizer(
+    source_dir: pathlib.Path, build_dir: pathlib.Path, target_triple: str,
+) -> pathlib.Path:
+    """Run `pyoxidizer` in an environment with access to build dependencies.
 
-    After successful completion, ``out_dir`` contains files constituting a
-    Mercurial install.
+    Returns the output directory that pyoxidizer would have used for build
+    artifacts. Actual build artifacts are likely in a sub-directory with the
+    name of the pyoxidizer build target that was built.
     """
     # We need to make gettext binaries available for compiling i18n files.
     gettext_pkg, gettext_entry = download_entry('gettext', build_dir)
@@ -108,6 +106,23 @@
 
     subprocess.run(args, env=env, check=True)
 
+    return source_dir / "build" / "pyoxidizer" / target_triple / "release"
+
+
+def create_pyoxidizer_install_layout(
+    source_dir: pathlib.Path,
+    build_dir: pathlib.Path,
+    out_dir: pathlib.Path,
+    target_triple: str,
+):
+    """Build Mercurial with PyOxidizer and copy additional files into place.
+
+    After successful completion, ``out_dir`` contains files constituting a
+    Mercurial install.
+    """
+
+    run_pyoxidizer(source_dir, build_dir, target_triple)
+
     if "windows" in target_triple:
         target = "app_windows"
     else:



To: indygreg, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to