]> git.proxmox.com Git - mirror_edk2.git/commit
BaseTools: Fix GenMake multi-workspace failure
authorKubacki, Michael A <michael.a.kubacki@intel.com>
Tue, 1 Oct 2019 22:57:56 +0000 (06:57 +0800)
committerFeng, Bob C <bob.c.feng@intel.com>
Fri, 4 Oct 2019 03:13:37 +0000 (11:13 +0800)
commit61af5f249495b18f45ca164376c871081448c0e4
tree3306c1da3e18a45c2d55f69aa338b3d236c97cf3
parent5be5439a5a4e45382abdba2a4339db4bb8e4bbcb
BaseTools: Fix GenMake multi-workspace failure

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2232

Commit 0075ab2cec introduced an issue that causes an exception
when multiple workspace packages paths are specified. For example,
if edk2-platforms is used, the root directory will contain an edk
and edk2-platforms directory representing the respective
repositories.

In GenMake, the path to the package DEC file for a module is
discovered by getting the relative path of the INF to the
workspace root directory. Each directory in the relative path
is incrementally joined to the WORKSPACE directory. The file
list in the joined path is searched for a DEC file.

As an example, if the build command is used on a package outside
the edk2 repository, the INF file path is relative to the
edk2-platforms directory not edk2. This causes directory paths
to be built that do not exist. Commit 0075ab2cec replaced the
os.path.exists() call with a try except block that always fails
when os.listdir() is invoked to enumerate the list of files in
the built directory path on packages outside edk2.

This commit restores the original conditional statement which
avoids calling os.listdir() with an invalid directory path.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
BaseTools/Source/Python/AutoGen/GenMake.py