【问题标题】:Build libgit2sharp on Ubuntu在 Ubuntu 上构建 libgit2sharp
【发布时间】:2014-09-07 22:23:34
【问题描述】:

我正在尝试使用 Mono 3.6.0 在我的 Ubuntu 14 机器上构建 libgit2sharp v0.19。但是,当我调用 ./build.libgit2sharp.sh 时,会收到很多如下所示的消息。

/home/chris/projects/libgit2sharp/CI-build.msbuild: error: 
LibGit2Sharp.Tests.CloneFixture.CanCloneBarely(url: "http://github.com/libgit2/TestGitRepository"): LibGit2Sharp.LibGit2SharpException : An error was raised by libgit2. Category = Net (Error).
Only relative redirects are supported

错误消息总是相同的“仅支持相对重定向”。

我一直在问题跟踪器上阅读,构建 libgit2sharp 的 Mono 版本可能是一个问题,3.6.0 好吗?


原来我错了,上面的错误来自我尝试构建 v0.14 时(我忘了切换分支)。我在 v0.19 上的错误是:

/home/chris/projects/libgit2sharp/CI/build.msbuild: error : LibGit2Sharp.Tests.BlameFixture.CanBlameFromADifferentCommit: Assert.Throws() Failure Expected: LibGit2Sharp.LibGit2SharpException Actual:   System.EntryPointNotFoundException: git_blame_file 

我得到了更多这样的错误。完整日志为here

【问题讨论】:

  • 你确定是 0.19 吗?自 0.16 以来,错误消息还没有被这样格式化。它已在 github.com/libgit2/libgit2sharp/pull/669 更改。
  • 你的权利,我在摆弄并切换到 0.14 分支。但是,构建仍然失败并显示此消息:/home/chris/projects/libgit2sharp/CI/build.msbuild: error : LibGit2Sharp.Tests.BlameFixture.CanBlameFromADifferentCommit: Assert.Throws() Failure Expected: LibGit2Sharp.LibGit2SharpException Actual: System.EntryPointNotFoundException: git_blame_file 我收到了更多类似的错误。完整日志为here
  • EntryPointNotFoundException -> 错误消息提示 LibGit2Sharp 加载的 libgit2 版本错误。 .sh 脚本负责为您构建正确的脚本,但也许您仍然可以从 PATH 访问 v0.14 的版本?
  • 呵呵,修好了。 Git 子模块很痛苦。我检查了 v0.19 但忘记更新子模块。想知道是否值得在构建脚本中添加 git 子模块更新?

标签: c# mono ubuntu-14.04 libgit2 libgit2sharp


【解决方案1】:

单声道版本不是问题。无论如何,网络代码没有用 C# 实现。

由于种种原因,libgit2 HTTP 层目前只支持相对重定向。当您使用http 作为方案时,GitHub 首先需要告诉您使用 HTTPS,它必须是绝对重定向。

如果您使用 HTTPS 连接到 GitHub,它将正常工作(无论如何您都应该使用它)。

【讨论】:

  • 但我不这样做。我只是调用 build.libgit2sharp.sh 来运行一些单元测试,这些测试是库附带的,但由于该错误而失败。我很难相信这些单元测试已添加但实际上不起作用?
猜你喜欢
  • 1970-01-01
  • 2015-07-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-03-05
  • 2013-05-27
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多