【问题标题】:cl : Command line error D8022 : cannot open 'c:\users\admini~1\appdata\local\temp\tmpjbx8xe.lnk'cl : 命令行错误 D8022 : 无法打开 'c:\users\admini~1\appdata\local\temp\tmpjbx8xe.lnk'
【发布时间】:2017-01-13 22:50:06
【问题描述】:

我正在升级 Windows 构建机器以使用

  • Visual Studio 2015 更新 3
  • scons 2.5.0
  • msbuild 14.0.25420.1

来自

  • Visual Studio 2013 更新 4
  • scons 2.3.4
  • msbuild 12.0.31101

但我遇到了构建错误。在“初始”运行期间,由于

而构建失败

cl : 命令行错误 D8022 : 无法打开'c:\users\admini~1\appdata\local\temp\tmpjbx8xe.lnk'

可能有几个这样的错误。如果我尝试查找文件,我发现它们不存在。

如果我重新运行构建,它就会通过。

还有其他人遇到过这个问题吗?有解决办法吗?

仅供参考:构建在 20 台核心机器上并行运行。这可能会导致计时条件。但是对于之前的设置来说没问题。

更新:经过进一步调查,这看起来可能是 SCons 问题。 SCons 似乎创建了 .lnk 文件。它将链接命令行存储在这些文件中,并通过 cl 执行它们

cl @c:\users\admini~1\appdata\local\temp\tmpjbx8xe.lnk

【问题讨论】:

  • 您在用户邮件列表中询问过相同的项目。不太可能是 SCons 问题。请检查防病毒和/或搜索索引器。
  • 发布到 StackOverflow 后,我了解了更多有关该问题的信息。当我发现 .lnk 文件是特定于 SCons 的时,我将其发布到他们的用户邮件中。我不确定这是否纯粹是 SCons 问题。我对我们的构建持怀疑态度(否则会有更多人报告这一点)。但是我已经确定了对 SCons 的提交,这导致我们的构建中出现了这个问题。

标签: visual-studio-2015 scons cl lnk


【解决方案1】:

原来 SCons 2.3.5 引入了一个边缘情况错误。在以下提交中

https://bitbucket.org/scons/scons/commits/bad59be7270dbbe62c7868a532fad84480f95fae https://bitbucket.org/scons/scons/commits/9aa37cd21e99eb684ab6ae8f7b21e0a71751ac7f https://bitbucket.org/scons/scons/commits/da5785c5f30f852734b3f985b798a5508bfea9db

进一步调查后,我发现故障仅发生在构建脚本的一部分中。他们正在做类似的事情

# Get all the .cpp files
sources = getAllSources() 

# Create a group of .obj files from the sources
objFiles = envLocal.Object(sources) 

# Create a shared library from the sources
artifacts = envLocal.SharedLibrary('Library', sources) 

# Add the .obj files to the link path on another environment
envTest['LIBS'].append(objFiles)

test_sources = getAllSources() # Get all the test .cpp files

# Create a test executable which re-uses the .obj files from LIBS on another environment
envTest.Program('TestExecutable', test_sources) 

当我将代码更新为

# Create a shared library from the objFiles instead of sources
artifacts = envLocal.SharedLibrary('Library', objFiles) 

错误消失了。

【讨论】:

    猜你喜欢
    • 2020-07-02
    • 2014-10-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多