从源代码构建Go时测试失败

问题描述:

I cannot pass build tests when I build Golang from source:

hg clone -u release https://code.google.com/p/go
cd go/src
./all.bash

....
ok      net/url 0.005s
ok      os  0.595s
--- FAIL: TestExtraFiles (0.12 seconds)
exec_test.go:230: TestExtraFiles: Something already leaked - closed fd 3
exec_test.go:403: Run: exit status 1; stdout "leaked parent file. fd = 10; want 9
", stderr ""
FAIL
FAIL    os/exec 0.822s
ok      os/signal   0.511s

please help. this is on my webfaction shared machine.

[~] lsb_release -a
LSB Version:    :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: CentOS
Description:    CentOS release 5.10 (Final)
Release:    5.10
Codename:   Final

从源代码构建Golang时,我无法通过构建测试: p>

  hg clone -u release https://code.google.com/p/go
cd go / src 
./all.bash 
 
 .... 
ok net / url 0.005s 
ok os  0.595s 
 ---失败:TestExtraFiles(0.12秒)
exec_test.go:230:TestExtraFiles:某些东西已经泄漏-关闭fd 3 
exec_test.go:403:运行:退出状态1;  stdout“泄漏的父文件。fd = 10;想要9 
”,stderr“” 
FAIL 
FAIL os / exec 0.822s 
ok os / signal 0.511s 
  code>  pre> 
 
 请帮助。   p> 
 
 
  [〜] lsb_release -a 
LSB版本::core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32  :graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch 
分发服务器ID:CentOS 
描述:CentOS版本5.10(最终版)
发行版:5.10 
代码名称:最终版本
  code>  pre>  
  div>

It's a bug in CentOS 5/RHEL 5 according to issue 3001, basicly the kernel ignores O_CLOEXEC.

So either ignore the error (bad idea) or move to a more recent Linux version.