Hi Marvin, Thanks for the info. I can reproduce it. You are correct. The below block is long ago 's logic, we can remove it now since for the ActivePlatform we already make sure it is absolute path. I have a patch to remove this block. thanks. If you have time, please help to review/test it. thanks. Patch: [edk2] [Patch] BaseTools/GenFds: remove the old logic since ActivePlatform is abs. path
Best Regards, Zhu Yonghong From: Marvin Häuser [mailto:marvin.haeu...@outlook.com] Sent: Saturday, April 16, 2016 5:08 AM To: edk2-devel@lists.01.org Cc: Zhu, Yonghong <yonghong....@intel.com>; Gao, Liming <liming....@intel.com> Subject: RE: [edk2] GenFds fails with MWS. PS: I think it might work on Windows because GenFds checks the first character of \ or /. Though Windows paths start with the drive letter. :) Von: Marvin Häuser<mailto:marvin.haeu...@outlook.com> Gesendet: Freitag, 15. April 2016 22:51 An: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org> Cc: liming....@intel.com<mailto:liming....@intel.com> Betreff: Re: [edk2] GenFds fails with MWS. Hey Yonghong, I have investigated the issue a little more. For some reason, it works fine on Windows, though is broken in WSL. After outputing some of the steps done to the ActivePlatform path, I figured out it was this block that causes the issue: if os.path.normcase (ActivePlatform).find(Workspace) == 0: ActivePlatform = mws.relpath(ActivePlatform, Workspace) if len(ActivePlatform) > 0 : if ActivePlatform[0] == '\\' or ActivePlatform[0] == '/': ActivePlatform = ActivePlatform[1:] This block strips the leading slash (making it an absolute path) off and then appends it to the Workspace path later on. I assume the intention is to 1) make it relative to WORKSPACE and then 2) append it to it (why?). Could this be solved by only running that code when the path is not already absolute? Why would one need to make the abs. path relatve? I wish I could tell you why it works fine on Windows and not in the Subsystem, but I have no idea. The steps to reproduce are quite easy - just build a package with a fdf, while that package is not in WORKSPACE. I cannot test it in a Virtual Machine right now, but will try as soon as possible. Kind regards, Marvin. ________________________________ Von: Zhu, Yonghong <yonghong....@intel.com<mailto:yonghong....@intel.com>> Gesendet: Freitag, 15. April 2016 08:34 An: marvin.haeu...@outlook.com<mailto:marvin.haeu...@outlook.com> Cc: Gao, Liming; Zhu, Yonghong Betreff: RE: GenFds fails with MWS. Hi Marvin, I failed to reproduce this bug, Do you have any reproduce steps ? thanks in advance. Best Regards, Zhu Yonghong From: Zhu, Yonghong Sent: Friday, April 15, 2016 8:38 AM To: 'Marvin Häuser' <marvin.haeu...@outlook.com<mailto:marvin.haeu...@outlook.com>>; edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org> Cc: Gao, Liming <liming....@intel.com<mailto:liming....@intel.com>>; Zhu, Yonghong <yonghong....@intel.com<mailto:yonghong....@intel.com>> Subject: RE: GenFds fails with MWS. Hi Marvin, Thanks for report it. I will first to reproduce and investigate. Best Regards, Zhu Yonghong From: Marvin Häuser [mailto:marvin.haeu...@outlook.com] Sent: Friday, April 15, 2016 2:05 AM To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org%3cmailto:edk2-devel@lists.01.org>> Cc: Gao, Liming <liming....@intel.com<mailto:liming....@intel.com<mailto:liming....@intel.com%3cmailto:liming....@intel.com>>>; Zhu, Yonghong <yonghong....@intel.com<mailto:yonghong....@intel.com<mailto:yonghong....@intel.com%3cmailto:yonghong....@intel.com>>> Subject: GenFds fails with MWS. Hello dear TianoCore developers, Liming, Yonghong, Today I wanted to try out the changes intoduced with the 'BaseTools: fix PLATFORM_DIR variable value for multiple workspace' commit. After having fixed the 'brace-mismatched' I sent as a patch earlier today, the build process works fine until GenFds is invoked. For some reason, the correct file path is appended to the WORKSPACE path, which of course leads to an error. You can find the macro definitions and error log below. I am sorry to bug you again about BaseTools, though, after having looked at the call stack for at least half an hour, I still don't understand the control flow as Python is giving me headaches. Thank you in advance for your time! Regards, Marvin. root@localhost:/home/EdkWorkspace/edk2# build -a X64 -b RELEASE -t GCC49 -p AnyPkg/AnyPkg.dsc Build environment: Linux-3.4.0+-x86_64-with-Ubuntu-14.04-trusty Build start time: 17:56:48, Apr.14 2016 WORKSPACE = /home/EdkWorkspace/edk2 PACKAGES_PATH = /home/EdkWorkspace/PackagesPath ECP_SOURCE = /home/EdkWorkspace/edk2/EdkCompatibilityPkg EDK_SOURCE = /home/EdkWorkspace/edk2/EdkCompatibilityPkg EFI_SOURCE = /home/EdkWorkspace/edk2/EdkCompatibilityPkg EDK_TOOLS_PATH = /home/EdkWorkspace/edk2/BaseTools Architecture(s) = X64 Build target = RELEASE Toolchain = GCC49 Active Platform = /home/EdkWorkspace/PackagesPath/AnyPkg/AnyPkg.dsc Flash Image Definition = /home/EdkWorkspace/PackagesPath/AnyPkg/AnyPkg.fdf [...] GenFds.py... : error C0DE: Tools code failure Please send email to edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org%3cmailto:edk2-devel@lists.01.org>> for help, attaching following call stack trace! Traceback (most recent call last): File "/home/EdkWorkspace/edk2/BaseTools/BinWrappers/PosixLike/../../Source/Python/GenFds/GenFds.py", line 219, in main TargetArchList = set(BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'COMMON', Options.BuildTarget, Options.ToolChain].SupArchList) & set(ArchList) File "/home/EdkWorkspace/edk2/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py", line 2811, in __getitem__ MetaFileStorage(self.WorkspaceDb.Cur, FilePath, FileType) File "/home/EdkWorkspace/edk2/BaseTools/Source/Python/Workspace/MetaFileTable.py", line 388, in __new__ return Class._FILE_TABLE_[FileType](*Args) File "/home/EdkWorkspace/edk2/BaseTools/Source/Python/Workspace/MetaFileTable.py", line 287, in __init__ MetaFileTable.__init__(self, Cursor, MetaFile, MODEL_FILE_DSC, Temporary) File "/home/EdkWorkspace/edk2/BaseTools/Source/Python/Workspace/MetaFileTable.py", line 41, in __init__ FileId = self._FileIndexTable.InsertFile(MetaFile, FileType) File "/home/EdkWorkspace/edk2/BaseTools/Source/Python/Workspace/MetaDataTable.py", line 215, in InsertFile File.TimeStamp File "/home/EdkWorkspace/edk2/BaseTools/Source/Python/Common/Misc.py", line 1828, in _GetTimeStamp return os.stat(self.Path)[8] File "/home/EdkWorkspace/edk2/BaseTools/Source/Python/Common/LongFilePathOs.py", line 49, in stat return os.stat(LongFilePath(path)) OSError: [Errno 2] No such file or directory: '/home/EdkWorkspace/edk2/home/EdkWorkspace/PackagesPath/AnyPkg/AnyPkg.dsc' build.py... : error 7000: Failed to execute command GenFds -f /home/EdkWorkspace/PackagesPath/AnyPkg/AnyPkg.fdf --conf=/home/EdkWorkspace/edk2/Conf -o /home/EdkWorkspace/edk2/Build/OpenCoreX64/RELEASE_GCC49 -t GCC49 -b RELEASE -p /home/EdkWorkspace/PackagesPath/AnyPkg/AnyPkg.dsc -a X64 -D "EFI_SOURCE=/home/EdkWorkspace/edk2/EdkCompatibilityPkg" -D "EDK_SOURCE=/home/EdkWorkspace/edk2/EdkCompatibilityPkg" -D "TOOL_CHAIN_TAG=GCC49" -D "TOOLCHAIN=GCC49" -D "TARGET=RELEASE" -D "WORKSPACE=/home/EdkWorkspace/edk2" -D "EDK_TOOLS_PATH=/home/EdkWorkspace/edk2/BaseTools" -D "ARCH=X64" -D "ECP_SOURCE=/home/EdkWorkspace/edk2/EdkCompatibilityPkg" [/home/EdkWorkspace/edk2] _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org> https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel