[edk2-devel] [PATCH v2 0/7] edksetup.bat, BaseTools: Improve Windows environment setup and BaseTools C compilation

Rebecca Cran posted 7 patches 11 months, 4 weeks ago
Failed in applying to current master (apply log)
There is a newer version of this series
BaseTools/Source/C/Makefiles/NmakeSubdirs.py                           |   2 +-
BaseTools/Tests/PythonTest.py                                          |  22 +++-
BaseTools/toolsetup.bat                                                | 119 ++++++++------------
MdePkg/Library/BaseSynchronizationLib/LoongArch64/AsmSynchronization.S |  30 ++---
MdePkg/Library/BaseSynchronizationLib/LoongArch64/Synchronization.c    |   2 +-
OvmfPkg/AmdSev/AmdSevX64.fdf                                           |   4 +-
OvmfPkg/CloudHv/CloudHvX64.fdf                                         |   4 +-
OvmfPkg/{ => Include/Fdf}/OvmfTpmDxe.fdf.inc                           |   0
OvmfPkg/{ => Include/Fdf}/OvmfTpmPei.fdf.inc                           |   0
OvmfPkg/OvmfPkgIa32.fdf                                                |   4 +-
OvmfPkg/OvmfPkgIa32X64.fdf                                             |   4 +-
OvmfPkg/OvmfPkgX64.fdf                                                 |   4 +-
edksetup.bat                                                           |   1 +
13 files changed, 92 insertions(+), 104 deletions(-)
rename OvmfPkg/{ => Include/Fdf}/OvmfTpmDxe.fdf.inc (100%)
rename OvmfPkg/{ => Include/Fdf}/OvmfTpmPei.fdf.inc (100%)
[edk2-devel] [PATCH v2 0/7] edksetup.bat, BaseTools: Improve Windows environment setup and BaseTools C compilation
Posted by Rebecca Cran 11 months, 4 weeks ago
There are remnants of Python 2 support in BaseTools/toolsetup.bat that it's
probably time to remove since we only support Python 3.6 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

Changes between v1 and v2
=========================

- Require Python 3.6 or newer: 3.6 was when PEP 526 was added, which we use.
- Fix Tests/RunTests.py on Windows.

Dongyan Qian (1):
  BaseSynchronizationLib: Fix LoongArch64 synchronization functions

Gerd Hoffmann (2):
  OvmfPkg: move OvmfTpmPei.fdf.inc to Include/Fdf
  OvmfPkg: move OvmfTpmDxe.fdf.inc to Include/Fdf

Rebecca Cran (4):
  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/Source/C/Makefiles/NmakeSubdirs.py                           |   2 +-
 BaseTools/Tests/PythonTest.py                                          |  22 +++-
 BaseTools/toolsetup.bat                                                | 119 ++++++++------------
 MdePkg/Library/BaseSynchronizationLib/LoongArch64/AsmSynchronization.S |  30 ++---
 MdePkg/Library/BaseSynchronizationLib/LoongArch64/Synchronization.c    |   2 +-
 OvmfPkg/AmdSev/AmdSevX64.fdf                                           |   4 +-
 OvmfPkg/CloudHv/CloudHvX64.fdf                                         |   4 +-
 OvmfPkg/{ => Include/Fdf}/OvmfTpmDxe.fdf.inc                           |   0
 OvmfPkg/{ => Include/Fdf}/OvmfTpmPei.fdf.inc                           |   0
 OvmfPkg/OvmfPkgIa32.fdf                                                |   4 +-
 OvmfPkg/OvmfPkgIa32X64.fdf                                             |   4 +-
 OvmfPkg/OvmfPkgX64.fdf                                                 |   4 +-
 edksetup.bat                                                           |   1 +
 13 files changed, 92 insertions(+), 104 deletions(-)
 rename OvmfPkg/{ => Include/Fdf}/OvmfTpmDxe.fdf.inc (100%)
 rename OvmfPkg/{ => Include/Fdf}/OvmfTpmPei.fdf.inc (100%)

-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104191): https://edk2.groups.io/g/devel/message/104191
Mute This Topic: https://groups.io/mt/98728623/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2 0/7] edksetup.bat, BaseTools: Improve Windows environment setup and BaseTools C compilation
Posted by Pedro Falcato 11 months, 4 weeks ago
On Sat, May 6, 2023 at 6:24 PM Rebecca Cran <rebecca@bsdio.com> wrote:
>
> There are remnants of Python 2 support in BaseTools/toolsetup.bat that it's
> probably time to remove since we only support Python 3.6 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
>
> Changes between v1 and v2
> =========================
>
> - Require Python 3.6 or newer: 3.6 was when PEP 526 was added, which we use.
> - Fix Tests/RunTests.py on Windows.
>
> Dongyan Qian (1):
>   BaseSynchronizationLib: Fix LoongArch64 synchronization functions
>
> Gerd Hoffmann (2):
>   OvmfPkg: move OvmfTpmPei.fdf.inc to Include/Fdf
>   OvmfPkg: move OvmfTpmDxe.fdf.inc to Include/Fdf

Why did you pick these up? Accident?

-- 
Pedro


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104203): https://edk2.groups.io/g/devel/message/104203
Mute This Topic: https://groups.io/mt/98728623/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2 0/7] edksetup.bat, BaseTools: Improve Windows environment setup and BaseTools C compilation
Posted by Rebecca Cran 11 months, 4 weeks ago
On 5/6/23 13:16, Pedro Falcato wrote:
> Why did you pick these up? Accident?

Ugh sorry, I'm rushing to try and get as many patches submitted as 
possible before the freeze and included too many patches.

I've just sent out a v3 with just the 4 commits I meant to include.


-- 

Rebecca Cran



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104209): https://edk2.groups.io/g/devel/message/104209
Mute This Topic: https://groups.io/mt/98728623/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-