You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
basetool_tiano_python_path_env.yaml needs to be removed as it causes relative module import conflicts between in-tree basetools and pip basetools under the following situation:
you are in a virtual environment where the folder is located (alphebetically) before Basetools/*
edk2-basetools pip module is installed
You are building using the In-Tree base tools.
Stuart recursively searches through the entire workspace searching for *_path_env.yaml files. Once the workspace has been searched, it does a reverse-order insertion of all paths into the PYTHONPATH. This results in any relative imports (which occur frequently in the in-tree basetools) searching, and incorrectly linking against the code inside the pypi-basetools. This is unexpected behavior when building with the in-tree basetools.
Note: This is not true in the reverse scenario because pypi-basetools does not use relative imports, all imports are edk2basetools.<something>
Basetools should link against the expected code. That is to say, in-tree basetools should link against in-tree basetools source. and pypi basetools should link against pypi basetools source.
Execution Environment
you are in a virtual environment where the folder is located (alphebetically) before Basetools/*
edk2-basetools pip module is installed
You are building using the In-Tree base tools.
Pip packages
No response
Additional context
The solution is to simply remove the file basetool_tiano_python_path_env.yaml from this repository. It does not serve a purpose here and only causes this conflict.
The text was updated successfully, but these errors were encountered:
Contact Details
[email protected]
Describe the Bug
basetool_tiano_python_path_env.yaml needs to be removed as it causes relative module import conflicts between in-tree basetools and pip basetools under the following situation:
Stuart recursively searches through the entire workspace searching for
*_path_env.yaml
files. Once the workspace has been searched, it does a reverse-order insertion of all paths into thePYTHONPATH
. This results in any relative imports (which occur frequently in the in-tree basetools) searching, and incorrectly linking against the code inside the pypi-basetools. This is unexpected behavior when building with the in-tree basetools.Note: This is not true in the reverse scenario because pypi-basetools does not use relative imports, all imports are
edk2basetools.<something>
This issue can be seen in the mailing list here
Reproduction steps
From the root of the repository (edk2)
python -m venv .venv
(NOTE: The virtual environment being named.venv
is criticalpip install --upgrade -r pip-requirements.txt
stuart_setup -c .pytool/CISettings.py
stuart_update -c .pytool/CISettings.py
stuart_ci_build -c .pytool/CISettings.py -no_piptools <any other flags>
You will see the same error as reported here
Expected behavior
Basetools should link against the expected code. That is to say, in-tree basetools should link against in-tree basetools source. and pypi basetools should link against pypi basetools source.
Execution Environment
Pip packages
No response
Additional context
The solution is to simply remove the file basetool_tiano_python_path_env.yaml from this repository. It does not serve a purpose here and only causes this conflict.
The text was updated successfully, but these errors were encountered: