-
Notifications
You must be signed in to change notification settings - Fork 3k
Add support for complete out of tree build #11757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
SEP variable is only set if PYTHON_COMMAND is undefined but referred regardless. It breaks the clean target for the following scenario: . edksetup.sh # Sets PYTHON_COMMAND make -C BaseTools make -C BaseTools clean This change fixes the use case mentioned above by settings SEP for all build configurations. Signed-off-by: Oleksandr Tymoshenko <[email protected]>
As a preparation for out-of-tree build support make sure all interim files for tests are created in tmp directory. Signed-off-by: Oleksandr Tymoshenko <[email protected]>
e1e08d5 to
a4f7bde
Compare
a4f7bde to
52c6480
Compare
|
If I understand correctly, you are fixing the BaseTools binary build issue which generates the obj/exe files under BaseTools directory. I like it very much. Can you explain a bit more about where the obj/exe files will be with your patch? |
|
The executables are placed in |
| @echo Finished building BaseTools C Tools with HOST_ARCH=$(HOST_ARCH) | ||
|
|
||
| LIBRARIES = Common | ||
| VFRAUTOGEN = VfrCompile/VfrLexer.h |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not look obviously related to the described change?
If it is general cleanup to make the end result tidier, could it be broken out into a separate commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's general cleanup, added as a separate commit.
VfrLexer.h is built as a mart of VfrCompile build and shouldn't be present at the BaseTools/Source/C level. Signed-off-by: Oleksandr Tymoshenko <[email protected]>
- Move common wrapper logic for multiple tools to GenericShellWrapper file - Drop search for BaseToolsCBinaries from the list of checked directories. This case has been broken for quite a while since the exec clause never passed command arguments to the supposed binary. - Remove a suggestion to run make in $EDK_TOOLS_PATH/Source/C and let the wrapper fail if the directory exists but no binary is present. Signed-off-by: Oleksandr Tymoshenko <[email protected]>
Main EDK2 build supports out-of-tree builds but BaseTools make process still creates tools and object files in-tree. In order to make out-of-tree build support complete move the generated tools and interim obj files to $WORKSPACE location as well. Signed-off-by: Oleksandr Tymoshenko <[email protected]>
52c6480 to
633900d
Compare
I thought usually $WORKSPACE points to the project root directory. Then your approach that places the intermediate files in $WORKSPACE might not work. Why not place these intermediate files in Build directory? |
Could you please elaborate? My understanding is WORKSPACE is where the main (non-BaseTools) build places its files, it can be |
You can open edksetup.bat. The logic there assumes the WORKSPACE points to the parent folder of "BaseTools". It's the root of the source code, not the temp directory that holds output files. |
Right, these are default values if neither WORKSPACE nor EDK_TOOLS_PATH are defined. But it's not a strict requirement, as far as I understand. They can be specified them to different locations. For instance, section 4.1.1 Development Environments sets WORKSPACE to one level up from the edk2 root and uses PACKAGES_PATH to set search path. Section "Read-only codebase builds test" in the PR's description also demonstrates that this approach works. |
|
I personally always use a workspace that is separate from the edk2/ directory, by setting I guess using |
Description
This pull requests adds support for the complet out-of-tree builds. Although the out-of-tree builds were supported by the
buildutility for some time, theBaseToolspart still created files in-tree. This patchset addresses this blocker by:BaseToolsinterim files and binaries to $WORKSPACE directoryBaseTool/Testsuse system's tmp directory for its interim filesHaving full out-of-tree builds is convenient because it allows integrating EDK2 builds in a system that enforces read-only access to the codebase to prevent cross-target build contamination.
How This Was Tested
Normal build env test
Read-only codebase builds test
Integration Instructions
N/A