public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/6] edksetup.bat, BaseTools: Improve Windows environment setup and BaseTools C compilation
@ 2023-04-25 17:15 Rebecca Cran
  2023-04-25 17:15 ` [PATCH 1/6] BaseTools: Remove Python2/Python3 detection from toolset.bat Rebecca Cran
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Rebecca Cran @ 2023-04-25 17:15 UTC (permalink / raw)
  To: devel, Andrew Fish, Leif Lindholm, Michael D Kinney, Liming Gao,
	Bob Feng, Yuwei Chen
  Cc: Rebecca Cran

There are remnants of Python 2 support in BaseTools/toolsetup.bat that it's
probably time to remove since we only support Python 3.9 and newer these days.
So, remove the variables that enable Python3 support and simplify the batch
script. I've also seen errors where after running edksetup.bat the build
command isn't available because PYTHONPATH wasn't being set, so fix that
when the Pip BaseTools are being used.

At the same time, let's add a check that we meet the minimum version
requirement so we don't end up failing with an obscure error.

Building BaseTools causes a warning about threading.currentThread being
deprecated, so update code in NmakeSubdirs.py to switch to
threading.current_thread.

There needs to be further work, because if PYTHON_COMMAND isn't specified then
it defaults to "py -3", where py is C:\Windows\py.exe, which doesn't work if
you're using a virtualenv since it installs python.exe and pythonw.exe in
venv\Scripts. toolsetup.bat therefore fails to detect the Pip BaseTools and
uses the in-source Basetools.

GitHub PR: https://github.com/tianocore/edk2/pull/4302
GitHub branch: https://github.com/bcran/edk2/tree/py3

Rebecca Cran (6):
  BaseTools: Remove Python2/Python3 detection from toolset.bat
  BaseTools: use threading.current_thread in NmakeSubdirs.py
  edksetup.bat: if toolsetup.bat fails, just exit
  BaseTools: Update toolsetup.bat and Tests/PythonTest.py to check ver
  BaseTools: Update toolsetup.bat to not use BASETOOLS_PYTHON_SOURCE
  BaseTools: only print the environment once in toolsetup.bat

 BaseTools/Source/C/Makefiles/NmakeSubdirs.py |   2 +-
 BaseTools/Tests/PythonTest.py                |  21 ++-
 BaseTools/toolsetup.bat                      | 157 ++++++++------------
 edksetup.bat                                 |   1 +
 4 files changed, 85 insertions(+), 96 deletions(-)

-- 
2.40.0.windows.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-04-27  3:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-25 17:15 [PATCH 0/6] edksetup.bat, BaseTools: Improve Windows environment setup and BaseTools C compilation Rebecca Cran
2023-04-25 17:15 ` [PATCH 1/6] BaseTools: Remove Python2/Python3 detection from toolset.bat Rebecca Cran
2023-04-25 17:15 ` [PATCH 2/6] BaseTools: use threading.current_thread in NmakeSubdirs.py Rebecca Cran
2023-04-25 17:15 ` [PATCH 3/6] edksetup.bat: if toolsetup.bat fails, just exit Rebecca Cran
2023-04-25 17:15 ` [PATCH 4/6] BaseTools: Update toolsetup.bat and Tests/PythonTest.py to check ver Rebecca Cran
2023-04-27  3:11   ` 回复: [edk2-devel] " gaoliming
2023-04-25 17:15 ` [PATCH 5/6] BaseTools: Update toolsetup.bat to not use BASETOOLS_PYTHON_SOURCE Rebecca Cran
2023-04-25 17:15 ` [PATCH 6/6] BaseTools: only print the environment once in toolsetup.bat Rebecca Cran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox