我现在正在使用我们的构建脚本度过一段地狱般的时光:我正在使用Waf来驱动我们的构建过程,并且一切正常,除了在 Windows 上,我在构建过程中遇到间歇性错误。
这些错误基本上都是一种或另一种形式的“拒绝访问”错误,与我在构建过程中创建的临时文件有关,以使某些工具能够运行并完成工作。例如,在运行NSIS以生成可执行安装程序之前,我必须将所有必需的文件“暂存”到构建目录并从那里运行命令。有时事情会按预期工作,但有时我会收到有关我复制的文件之一的错误报告,例如:
File: failed opening file "Platform\\Win32\\lxml-2.2.1-py2.6-win32.egg
我花了很长时间试图找出问题所在,但这真的很困难,因为问题是间歇性的。我尝试的最后一件事是使用procmon来监视文件系统访问以尝试跟踪导致访问错误的原因:我知道文件在那里,所以它一定是某些东西打开了文件。我在下面包含了相关输出,因为我看不出有什么问题:Python 似乎在 NSIS 想要打开文件之前关闭了文件,但随后 NSIS 失败了。任何人都可以对此有所了解吗?此问题不仅限于这种情况,而且还涉及我生成子进程以处理我复制到构建目录的文件的其他情况......
7:35:15.9704427 PM python.exe 4968 QueryOpen ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg FAST IO DISALLOWED
7:35:15.9707497 PM python.exe 4968 CreateFile ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
7:35:15.9708634 PM python.exe 4968 QueryBasicInformationFile ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS CreationTime: 7/25/2009 7:35:11 PM, LastAccessTime: 7/25/2009 7:35:11 PM, LastWriteTime: 7/25/2009 7:35:11 PM, ChangeTime: 7/25/2009 7:35:11 PM, FileAttributes: A
7:35:15.9709271 PM python.exe 4968 CloseFile ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS
7:35:15.9785180 PM python.exe 4968 CreateFile ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS Desired Access: Write Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
7:35:15.9786119 PM python.exe 4968 SetBasicInformationFile ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS CreationTime: 1/1/1601 1:00:00 AM, LastAccessTime: 1/1/1601 1:00:00 AM, LastWriteTime: 1/1/1601 1:00:00 AM, ChangeTime: 1/1/1601 1:00:00 AM, FileAttributes: AN
7:35:15.9787155 PM python.exe 4968 CloseFile ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS
7:35:15.9789401 PM python.exe 4968 QueryOpen ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg FAST IO DISALLOWED
7:35:15.9790309 PM python.exe 4968 CreateFile ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
7:35:15.9790700 PM python.exe 4968 QueryBasicInformationFile ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS CreationTime: 7/25/2009 7:35:11 PM, LastAccessTime: 7/25/2009 7:35:11 PM, LastWriteTime: 7/25/2009 7:35:11 PM, ChangeTime: 7/25/2009 7:35:12 PM, FileAttributes: A
7:35:15.9790952 PM python.exe 4968 CloseFile ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS
7:35:15.9792809 PM python.exe 4968 CreateFile ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS Desired Access: Write Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
7:35:15.9793270 PM python.exe 4968 SetBasicInformationFile ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS CreationTime: 1/1/1601 1:00:00 AM, LastAccessTime: 1/1/1601 1:00:00 AM, LastWriteTime: 1/1/1601 1:00:00 AM, ChangeTime: 1/1/1601 1:00:00 AM, FileAttributes: AN
7:35:15.9794041 PM python.exe 4968 CloseFile ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS
7:35:16.3508170 PM makensis.exe 3296 CreateFile ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SHARING VIOLATION Desired Access: Generic Read, Disposition: Open, Options: Sequential Access, Synchronous IO Non-Alert, Non-Directory File, Attributes: N, ShareMode: Read, AllocationSize: n/a
7:35:16.3557763 PM python.exe 4968 QueryOpen ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg FAST IO DISALLOWED
7:35:16.3558928 PM python.exe 4968 CreateFile ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
7:35:16.3559461 PM python.exe 4968 QueryNetworkOpenInformationFile ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS CreationTime: 7/25/2009 7:35:11 PM, LastAccessTime: 7/25/2009 7:35:11 PM, LastWriteTime: 7/25/2009 7:35:11 PM, ChangeTime: 7/25/2009 7:35:12 PM, AllocationSize: 1/1/1601 1:00:00 AM, EndOfFile: 1/1/1601 1:00:00 AM, FileAttributes: A
7:35:16.3560121 PM python.exe 4968 CloseFile ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS
7:35:16.3562048 PM python.exe 4968 CreateFile ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SHARING VIOLATION Desired Access: Read Attributes, Delete, Disposition: Open, Options: Non-Directory File, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
7:35:21.9320579 PM python.exe 3160 CloseFile ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS