【问题标题】:"Too many environment variables" when trying to launch a cywin shell from Hudson尝试从 Hudson 启动 cywin shell 时出现“太多环境变量”
【发布时间】:2023-11-14 15:30:01
【问题描述】:

我正在尝试在 cygwin 中的 Windows XP Hudson 从站上执行脚本。这是在 Hudson 中配置的 shell 命令:

#!C:\cygwin\bin\bash.exe
echo "hello"

在 windows 机器上启动 cygwin 似乎有问题,我收到了这个错误:

2 [main] bash 2692 C:\cygwin\bin\bash.exe: *** fatal error - C:\cygwin\bin\bash.exe: 
*** internal error reading the windows environment - too many environment variables?

那么有没有其他人经历过这种情况,以及关于如何让脚本运行的任何想法?

【问题讨论】:

  • 如果删除 shebang 行会怎样? #!C:\....?我不记得 cygwin 在那里接受反斜杠,但我已经有一段时间没有想到了......
  • FWIW,您所描述的内容适用于我使用 Execute shell 构建步骤(但不是 Execute Windows 批处理命令)。
  • @JimR:我尝试删除 shebang 行,但它不知道 bash 可执行文件在哪里运行 bash 脚本。所以看起来它可以用windows的东西来解释反斜杠。 (我的shebang线就像这里的一样:wiki.hudson-ci.org/display/HUDSON/Shells
  • @Dave Bacher:我在执行 shell 构建步骤中确实有这个,我想知道是否存在版本问题。我正在运行 cygwin 1.5.21 和 Hudson 1.3.82,你在运行什么?
  • 我在 cygwin 1.5.21-2 和 Hudson 1.388 上。由于历史原因(我不记得了),我让我的 Windows+cygwin 构建运行一个调用 \cygwin\bin\bash -c "my_build_script param param param"Windows 批处理命令

标签: windows scripting hudson cygwin


【解决方案1】:

如果您遇到这个老错误,我不会感到惊讶

Windows 有一个大问题 尽管如此。使用 ASCII 时 访问环境的功能, 就像 Cygwin 所做的那样,环境是 在 32K 处默默切断。

来自http://cygwin.com/ml/cygwin/2005-09/msg00646.html

您还可以查看从 Windows 快捷方式启动 emacs 的解决方法(与您的错误消息相同)。可能您可以更改 bash 调用以合并 cygwin run 命令,如下面的帖子所述。

http://cygwin.com/ml/cygwin/2006-03/msg00156.html

【讨论】: