# HG changeset patch
# User Gregory Szorc <gregory.sz...@gmail.com>
# Date 1658280760 25200
#      Tue Jul 19 18:32:40 2022 -0700
# Branch stable
# Node ID 654f25ff5ee8d658a53c93641d3101b52e2f9130
# Parent  22c29f91a3a0eadf7ef4bbe2960e25378a106340
automation: set PATH when building on Windows

Sometime in the 6.2 release cycle the Windows building automation
broke. Building the wheel and even PyOxidizer based installers now fails
with:

```
Exception: PowerShell execution failed:   error: subprocess-exited-with-error
Getting requirements to build wheel did not run successfully.
exit code: 1
[1 lines of output]
Unable to find a working hg binary to extract the version from the repository 
tags
[end of output]
note: This error originates from a subprocess, and is likely not a problem with 
pip.
```

I have a hunch this is a regression from upgrading pip in 1c00777702da,
but I haven't verified this. It may not be, as PyOxidizer has its own
bundled Python/pip. So maybe it is something in `setup.py`.

diff --git a/contrib/automation/hgautomation/windows.py 
b/contrib/automation/hgautomation/windows.py
--- a/contrib/automation/hgautomation/windows.py
+++ b/contrib/automation/hgautomation/windows.py
@@ -45,6 +45,7 @@ Write-Output "updated Mercurial working 
 '''.lstrip()
 
 BUILD_INNO_PYTHON3 = r'''
+$Env:PATH = "C:\hgdev\venv-bootstrap\Scripts;$Env:PATH"
 $Env:RUSTUP_HOME = "C:\hgdev\rustup"
 $Env:CARGO_HOME = "C:\hgdev\cargo"
 Set-Location C:\hgdev\src
@@ -56,6 +57,7 @@ if ($LASTEXITCODE -ne 0) {{
 
 
 BUILD_WHEEL = r'''
+$Env:PATH = "C:\hgdev\venv-bootstrap\Scripts;$Env:PATH"
 Set-Location C:\hgdev\src
 C:\hgdev\python{python_version}-{arch}\python.exe -m pip wheel --wheel-dir 
dist .
 if ($LASTEXITCODE -ne 0) {{
@@ -64,6 +66,7 @@ if ($LASTEXITCODE -ne 0) {{
 '''
 
 BUILD_WIX_PYTHON3 = r'''
+$Env:PATH = "C:\hgdev\venv-bootstrap\Scripts;$Env:PATH"
 $Env:RUSTUP_HOME = "C:\hgdev\rustup"
 $Env:CARGO_HOME = "C:\hgdev\cargo"
 Set-Location C:\hgdev\src

_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@lists.mercurial-scm.org
https://lists.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to