我是Github的新手。我通常不会编程,但我在这里试图为Google Code-In做点什么。我在Github上提交了pull request对xsf / xeps的一些更改,但我得到了error with Travis CI。使用TCI的日志结尾如下所示:
unable to parse xep-0363.xml
make: *** [build/xep-0363.html] Error 6
The command "make all" exited with 2.
2.88s$ echo "lint,$(xmllint --nonet --noout --noent --loaddtd --valid *.xml 2>&1 | wc -l)" | ./git-ratchet check -v
INFO: 2016/12/18 20:33:55 check.go:12: Parsing measures from stdin
INFO: 2016/12/18 20:33:58 check.go:14: Finished parsing measures from stdin
INFO: 2016/12/18 20:33:58 check.go:15: [{lint 4279 4279}]
INFO: 2016/12/18 20:33:58 check.go:21: Reading measures stored in git
INFO: 2016/12/18 20:33:58 git.go:14: git --no-pager log --notes=git-ratchet-1-master --pretty=format:'%H,%ae,%at,"%N",' HEAD
INFO: 2016/12/18 20:33:58 check.go:50: Checking passed measure against stored value
INFO: 2016/12/18 20:33:58 git.go:14: git --no-pager log --notes=git-ratchet-excuse-1-master --pretty=format:'%N' 8930133cb12cef58730b70ca2abac6523b19b6a7^1..HEAD
INFO: 2016/12/18 20:33:58 reader.go:169: Total excuses []
INFO: 2016/12/18 20:33:58 reader.go:183: Checking measures: lint lint
ERROR: 2016/12/18 20:33:58 reader.go:209: Measure rising: lint, delta 3 (0.07015902712815715 percents)
FATAL: 2016/12/18 20:33:58 check.go:63: One or more metrics currently failing.
The command "echo "lint,$(xmllint --nonet --noout --noent --loaddtd --valid *.xml 2>&1 | wc -l)" | ./git-ratchet check -v" exited with 50.
Done. Your build exited with 1.
The command "make all" exited with 2.
和The command "echo "lint,$(xmllint --nonet --noout --noent --loaddtd --valid *.xml 2>&1 | wc -l)" | ./git-ratchet check -v" exited with 50.
行为红色。
这里发生了什么?
好的,我正在对此进行编辑,以补充说我已经尝试了@melpomene在下面的回答中提出的建议。但是,我试图删除该行4次然后重新压缩提交后,它会不断重新出现。我该如何解决这个问题?
答案 0 :(得分:3)
根据the Travis configuration of that build:
{
"addons": {
"apt": {
"packages": [
"xsltproc",
"libxml2-utils"
]
}
},
"before_install": [
"wget -O git-ratchet https://github.com/iangrunert/git-ratchet/releases/download/v0.3.1/linux_amd64_git-ratchet",
"chmod +x git-ratchet",
"git fetch https://github.com/xsf/xeps.git refs/notes/*:refs/notes/*"
],
"script": [
"make all",
"echo \"lint,$(xmllint --nonet --noout --noent --loaddtd --valid *.xml 2>&1 | wc -l)\" | ./git-ratchet check -v"
],
"language": "ruby",
"group": "stable",
"dist": "precise",
"os": "linux"
}
......直接来自that repo's .travis.yml
:
addons:
apt:
packages:
- xsltproc
- libxml2-utils
before_install:
- wget -O git-ratchet https://github.com/iangrunert/git-ratchet/releases/download/v0.3.1/linux_amd64_git-ratchet
- chmod +x git-ratchet
- git fetch https://github.com/xsf/xeps.git refs/notes/*:refs/notes/*
script:
- make all
- echo "lint,$(xmllint --nonet --noout --noent --loaddtd --valid *.xml 2>&1 | wc -l)" | ./git-ratchet check -v
通过设置script
密钥,有人customized the build step。
script
的值是单个shell命令或由travis执行的shell命令列表。它们全部运行,但如果它们中的任何一个失败(通过返回非零退出状态),则整个构建计为失败。
红线来自Travis,告诉你哪个命令失败了,退出状态是什么。
至于那些命令实际上做了什么以及错误意味着什么,这取决于项目。我不熟悉这个,但失败前的最后一行输出是:
xep-0363.xml:249: parser error : XML declaration allowed only at the start of the document
<?xml version='1.0' encoding='UTF-8'?>
^
xep-0363.xml:249: parser error : XML declaration allowed only at the start of the document
<?xml version='1.0' encoding='UTF-8'?>
^
unable to parse xep-0363.xml
make: *** [build/xep-0363.html] Error 6
确实your commit在文件中间引入了一条<?xml ...?>
行,所以这可能会破坏构建。