windows - Azure DevOps 服务器上出现“输入行太长”的批处理命令 vcvarsall.bat 错误
问题描述
我在 Azure DevOps 服务器管道上运行批处理文件作为批处理脚本任务。此批处理文件在内部调用英特尔 Parallel Studio 编译器 2019 更新 3,如下所示:
if %ERRORLEVEL% NEQ 0 (
call "%ICPP_COMPILER19%bin\compilervars.bat" intel64 vs2017
)
然后调用构建文件。
最近,我观察到这个命令抛出错误:
##[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.
这是什么错误,为什么是现在?我看到了很多与此相关的问题,但我找不到与我的查询相关的答案。
解决方案
The input line is too long.
通常发生在百分比扩展后,结果行长于 8191 个字符。
在您的情况下,它可能是路径/includedir 变量在附加某些内容后溢出。
此类问题的原因可能是批处理文件的递归或多次调用。
然后您应该会看到多次附加相同的路径。
另一个问题可能是您的项目路径很长,例如
C:\my insane Projects\are nested\into a structure\that is much too deep\...<2000 characters later>\myProject
检查你的PATH
变量,有时重复很多次很荒谬。
要找到您的问题,请添加一些echo #123
以compilervars.bat
找到确切的行。
然后分析有问题的变量。
推荐阅读
- docusignapi - 我们可以通过 DocuSign API 按收件人 ID 定位签名者吗?
- laravel - Laravel - Laravel 中的 Cron 作业重复错误
- spring - 如何停止在 Spring 或 Spring 批处理中加载配置类(@Configuration)?
- dax - 显示去年同一周的测量结果?
- javascript - 如何在javascript中成对加入数组元素
- sed - sed 在一个字符串上返回多个下一个单词的结果
- javascript - 在select2中添加主题标签有理想的地方吗?
- python - 如何删除最外循环中的文本
- javascript - JavaScript 执行和网络带宽
- google-sheets - 是否有一个公式可以将 2 张纸与特定单词进行比较然后着色?