批处理命令 vcvarsall.bat 出现“输入行太长"错误在 Azure DevOps 服务器上 [英] Batch command vcvarsall.bat errors with "input line is too long" on Azure DevOps server

查看:41
本文介绍了批处理命令 vcvarsall.bat 出现“输入行太长"错误在 Azure DevOps 服务器上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Azure DevOps 服务器管道上运行批处理文件作为批处理脚本任务.此批处理文件在内部调用 Intel Parallel Studio compiler 2019 update 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%bincompilervars.bat" intel64 vs2017
)

然后调用构建文件.

最近,我观察到这个命令抛出错误:

Lately, I am observing this command throws error as:

##[command]C:uild_dir	est.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:我疯狂的项目被嵌套进入一个结构太深了...<2000 个字符之后>myProject

Another problem could be that your project paths are very long, like C:my insane Projectsare nestedinto a structure hat 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 服务器上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆