问题描述
我正在Azure DevOps服务器管道上运行批处理文件作为批处理脚本任务.该批处理文件在内部调用英特尔Parallel Studio编译器2019更新3,如下所示:
I am running a batch file on Azure DevOps server pipeline as batch script task.This batch file internally invokes Intel Parallel studio compiler 2019 update 3 like this:
if %ERRORLEVEL% NEQ 0 (
call "%ICPP_COMPILER19%bin\compilervars.bat" intel64 vs2017
)
并随后调用构建文件.
最近,我观察到此命令会引发错误,如下所示:
Lately, I am observing this command throws error as:
##[command]C:\build_dir\test.bat
Intel(R) MPI Library 2019 Update 3 for Windows* Target Build Environment for Intel(R) 64 applications
Copyright 2007-2019 Intel Corporation.
Copyright (C) 1985-2019 Intel Corporation. All rights reserved.
Intel(R) Compiler 19.0 Update 3 (package 203)
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.0.26228.57
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
The input line is too long.
The syntax of the command is incorrect.
这是什么错误,为什么现在呢?我看到了许多与此相关的问题,但找不到与查询相关的答案.
What is this error and why now? I saw many questions related to this but I couldn't find answers related to my query.
推荐答案
输入行太长.
通常发生在百分比扩展后,结果行长于8191个字符.
The input line is too long.
normally happens after a percent expansion with a resulting line longer than 8191 characters.
在您的情况下,可能是路径/includedir变量在添加某些内容后溢出.
此类问题的原因可能是该批处理文件的递归或多次调用.
然后您应该看到同一路径被附加了多次.
In your case it's probably a path/includedir variable overflowing after appending something.
The cause for such problems could be a recursion or multiple invocation of the batch file.
Then you should see that the same path was appended multiple times.
另一个问题可能是您的项目路径很长,例如 C:\ my疯狂的项目\被嵌套\到一个结构中\太深了\ ...< 2000个字符以后> \ myProject
Another problem could be that your project paths are very long, likeC:\my insane Projects\are nested\into a structure\that is much too deep\...<2000 characters later>\myProject
检查您的 PATH
变量,有时它很长,而且有很多重复.
Check your PATH
variable, sometimes it's ridiculous long with many repetitions.
要查找问题,请在 compilervars.bat
中添加一些 echo#123
以找到确切的行.
然后分析有问题的变量.
To find your problem, add some echo #123
into compilervars.bat
to find the exact line.
Then analyse the problematic variable.
这篇关于带有“输入行太长"的批处理命令vcvarsall.bat错误;在Azure DevOps服务器上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!