From 72acfa071a8fb60402dcdfc001581374191ed24f Mon Sep 17 00:00:00 2001 From: Ray Kraesig Date: Thu, 13 Jul 2023 13:29:57 +0000 Subject: [PATCH] Bug 1842918 - normalize away spaces in `$(PYTHON3)` r=firefox-build-system-reviewers,glandium As of bug 1838763, Python virtualenvs are now located in a subdirectory of `$MOZBUILD_STATE_PATH`. This, in turn, defaults to a subdirectory of the home directory, which on Windows often contains spaces. The Windows build instructions were updated to add a requirement that `MOZBUILD_STATE_PATH` not contain spaces, under the assumption that this was merely a clarification of an existing restriction; but this is indeed a new requirement and breaks existing setups. Instead, allow makefiles to safely invoke `$(PYTHON3)` without quoting it everywhere (as they do) by ensuring that its value contains no spaces, by using the DOS-style (8.3) short path to the Python executable. Additionally, clarify in the documentation exactly which paths are required not to contain spaces. Differential Revision: https://phabricator.services.mozilla.com/D183305 --- build/moz.configure/init.configure | 2 +- docs/setup/windows_build.rst | 18 +++++------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure index fbd626bc73bd..f462adf840b5 100644 --- a/build/moz.configure/init.configure +++ b/build/moz.configure/init.configure @@ -172,7 +172,7 @@ def virtualenv_python3(): return namespace( # sys.executable is currently not updated for in-process activations. However, # sys.prefix is, so we can calculate the python executable's path from there. - path=normsep(PythonVirtualenv(realpath(sys.prefix)).python_path), + path=normalize_path(PythonVirtualenv(realpath(sys.prefix)).python_path), str_version=".".join(str(i) for i in sys.version_info[0:3]), ) diff --git a/docs/setup/windows_build.rst b/docs/setup/windows_build.rst index 2be2ecda0ec3..b489c8cad23e 100644 --- a/docs/setup/windows_build.rst +++ b/docs/setup/windows_build.rst @@ -151,19 +151,11 @@ they may be resolved by `upgrading your MozillaBuild