mu icon indicating copy to clipboard operation
mu copied to clipboard

OverrideValidation.py cli doesn't work well on linux

Open spbrogan opened this issue 3 years ago • 0 comments

This logic doesn't work on linux https://github.com/microsoft/mu_basecore/blob/release/202008/BaseTools/Plugin/OverrideValidation/OverrideValidation.py#L525

    # Needs to strip os.sep is to take care of the root path case
    # For a folder, this will do nothing on a formatted abspath
    # For a drive root, this will rip off the os.sep
    if not os.path.normcase(Paths.ModulePath).startswith(os.path.normcase(Paths.WorkSpace.strip(os.sep)) + os.sep):
        raise RuntimeError("Module is not within specified Workspace.")

A better solution would be to use python os.path.commonpath.

if len(os.path.commonpath([Paths.ModulePath, Paths.WorkSpace])) != len(Paths.WorkSpace):

probably needs more testing before making the change.

spbrogan avatar Mar 12 '21 22:03 spbrogan