##// END OF EJS Templates
rust-chg: spawn server process if not running...
rust-chg: spawn server process if not running This is the minimal reimplementation of gethgcmd(), execcmdserver(), retryconnectcmdserver(), and connectcmdserver() in chg.c. No config validation is implemented yet. And some Py3 workarounds would be missing as this is the code I wrote in 2018. Differential Revision: https://phab.mercurial-scm.org/D8360

File last commit:

r45129:bc847878 default
r45161:bb936e25 default
Show More
pyoxidizer.bzl
59 lines | 1.7 KiB | text/x-python | PythonLexer
Gregory Szorc
hgcli: customize for Mercurial...
r45129 ROOT = CWD + "/../.."
Gregory Szorc
hgcli: add stub PyOxidizer project...
r45128
Gregory Szorc
hgcli: customize for Mercurial...
r45129 def make_exe():
dist = default_python_distribution()
code = "import hgdemandimport; hgdemandimport.enable(); from mercurial import dispatch; dispatch.run()"
Gregory Szorc
hgcli: add stub PyOxidizer project...
r45128
Gregory Szorc
hgcli: customize for Mercurial...
r45129 config = PythonInterpreterConfig(
raw_allocator = "system",
run_eval = code,
# We want to let the user load extensions from the file system
filesystem_importer = True,
# We need this to make resourceutil happy, since it looks for sys.frozen.
sys_frozen = True,
legacy_windows_stdio = True,
Gregory Szorc
hgcli: add stub PyOxidizer project...
r45128 )
exe = dist.to_python_executable(
Gregory Szorc
hgcli: customize for Mercurial...
r45129 name = "hg",
resources_policy = "prefer-in-memory-fallback-filesystem-relative:lib",
config = config,
# Extension may depend on any Python functionality. Include all
# extensions.
Gregory Szorc
hgcli: add stub PyOxidizer project...
r45128 extension_module_filter = "all",
)
Gregory Szorc
hgcli: customize for Mercurial...
r45129 exe.add_python_resources(dist.pip_install([ROOT]))
Gregory Szorc
hgcli: add stub PyOxidizer project...
r45128
Gregory Szorc
hgcli: customize for Mercurial...
r45129 return exe
def make_install(exe):
m = FileManifest()
Gregory Szorc
hgcli: add stub PyOxidizer project...
r45128
Gregory Szorc
hgcli: customize for Mercurial...
r45129 # `hg` goes in root directory.
m.add_python_resource(".", exe)
Gregory Szorc
hgcli: add stub PyOxidizer project...
r45128
Gregory Szorc
hgcli: customize for Mercurial...
r45129 templates = glob(
include = [ROOT + "/mercurial/templates/**/*"],
strip_prefix = ROOT + "/mercurial/",
)
m.add_manifest(templates)
Gregory Szorc
hgcli: add stub PyOxidizer project...
r45128
Gregory Szorc
hgcli: customize for Mercurial...
r45129 return m
Gregory Szorc
hgcli: add stub PyOxidizer project...
r45128
def make_embedded_resources(exe):
return exe.to_embedded_resources()
Gregory Szorc
hgcli: customize for Mercurial...
r45129 register_target("exe", make_exe)
register_target("app", make_install, depends = ["exe"], default = True)
register_target("embedded", make_embedded_resources, depends = ["exe"], default_build_script = True)
Gregory Szorc
hgcli: add stub PyOxidizer project...
r45128 resolve_targets()
# END OF COMMON USER-ADJUSTED SETTINGS.
#
# Everything below this is typically managed by PyOxidizer and doesn't need
# to be updated by people.
PYOXIDIZER_VERSION = "0.7.0-pre"
PYOXIDIZER_COMMIT = "c772a1379c3026314eda1c8ea244b86c0658951d"