|
194 | 194 | import subprocess |
195 | 195 | import sys |
196 | 196 | import tarfile |
| 197 | +import traceback |
197 | 198 | import urllib.request |
198 | 199 | import zipfile |
199 | 200 |
|
@@ -221,21 +222,7 @@ def run(command, check=1): |
221 | 222 | if 1: |
222 | 223 | # For debugging. |
223 | 224 | log(f'### Starting.') |
224 | | - log(f'__name__: {__name__!r}') |
225 | | - log(f'platform.platform(): {platform.platform()!r}') |
226 | | - log(f'platform.python_version(): {platform.python_version()!r}') |
227 | | - log(f'sys.executable: {sys.executable!r}') |
228 | | - log(f'CPU bits: {32 if sys.maxsize == 2**31 - 1 else 64} {sys.maxsize=}') |
229 | | - log(f'__file__: {__file__!r}') |
230 | | - log(f'os.getcwd(): {os.getcwd()!r}') |
231 | | - log(f'getconf ARG_MAX: {pipcl.run("getconf ARG_MAX", capture=1, check=0, verbose=0)!r}') |
232 | | - log(f'sys.argv ({len(sys.argv)}):') |
233 | | - for i, arg in enumerate(sys.argv): |
234 | | - log(f' {i}: {arg!r}') |
235 | | - log(f'os.environ ({len(os.environ)}):') |
236 | | - for k in sorted( os.environ.keys()): |
237 | | - v = os.environ[ k] |
238 | | - log( f' {k}: {v!r}') |
| 225 | + pipcl.show_system() |
239 | 226 |
|
240 | 227 |
|
241 | 228 | PYMUPDF_SETUP_FLAVOUR = os.environ.get( 'PYMUPDF_SETUP_FLAVOUR', 'pbd') |
@@ -802,7 +789,18 @@ def build_mupdf_windows( |
802 | 789 | #log( f'Building mupdf.') |
803 | 790 | devenv = os.environ.get('PYMUPDF_SETUP_DEVENV') |
804 | 791 | if not devenv: |
805 | | - vs = pipcl.wdev.WindowsVS() |
| 792 | + try: |
| 793 | + # Prefer VS-2019 as that is what MuPDF's project/solution files are |
| 794 | + # written for. |
| 795 | + log(f'Looking for Visual Studio 2019.') |
| 796 | + vs = pipcl.wdev.WindowsVS(year=2019) |
| 797 | + except Exception as e: |
| 798 | + log(f'Failed to find VS-2019:\n' |
| 799 | + f'{textwrap.indent(traceback.format_exc(), " ")}' |
| 800 | + ) |
| 801 | + log(f'Looking for any Visual Studio.') |
| 802 | + vs = pipcl.wdev.WindowsVS() |
| 803 | + log(f'vs:\n{vs.description_ml(" ")}') |
806 | 804 | devenv = vs.devenv |
807 | 805 | if not devenv: |
808 | 806 | devenv = 'devenv.com' |
|
0 commit comments