0

I'm trying to build v0.19 of libgit2sharp on my Ubuntu 14 machine using Mono 3.6.0. However when I call ./build.libgit2sharp.sh I get lots of messages like the one below.

/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

The error message is always the same "Only relative redirects are supported".

I have been reading on the issue tracker that the version of Mono that libgit2sharp is built with can be an issue, is 3.6.0 okay?


Turns out I was wrong, the above error is from when I was trying to build v0.14 (i forgot to switch branch). My error on v0.19 is:

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

I get a lot more errors like that. Full log is here.

JimCricket
  • 51
  • 1
  • 6
  • Are you sure that's 0.19? Error messages haven't been formatted like that since 0.16. It was changed at https://github.com/libgit2/libgit2sharp/pull/669. – Edward Thomson Sep 08 '14 at 13:19
  • Doh your right, i was fiddling around and switched to 0.14 branch. However the build still fails with this message: `/home/chris/projects/libgit2sharp/CI/build.msbuild: error : LibGit2Sharp.Tests.BlameFixture.CanBlameFromADifferentCommit: Assert.Throws() Failure Expected: LibGit2Sharp.LibGit2SharpException Actual: System.EntryPointNotFoundException: git_blame_file` I get alot more errors like that. Full log is [here](http://pastebin.com/g7PY7Ci9). – JimCricket Sep 08 '14 at 21:55
  • EntryPointNotFoundException -> The error message hints at a wrong version of libgit2 being loaded by LibGit2Sharp. the .sh scripts takes care of building the correct one for you, but maybe have you still the version from v0.14 reachable from the PATH? – nulltoken Sep 10 '14 at 21:17
  • Doh, got it fixed. Git submodules are a pain. I had checked out v0.19 but forgot to update the submodules. Wonder if its worth adding a git submodule update to the build script? – JimCricket Sep 11 '14 at 23:56

1 Answers1

1

The version of mono isn't an issue. The network code is not implemented in C# anyhow.

For various reasons, the libgit2 HTTP layer only supports relative redirects at the moment. As you're using http as the scheme, GitHub first needs to tell you to use HTTPS which has to be an absolute redirect.

If you use HTTPS to connect to GitHub, it will work correctly (which you should be using for all of it in any case).

Carlos Martín Nieto
  • 5,207
  • 1
  • 15
  • 16
  • But I'm not doing this. I'm just calling build.libgit2sharp.sh which runs some unit tests that come with the library that are failing with that error. I find it hard to believe that those unit tests have been added but don't actually work? – JimCricket Sep 08 '14 at 12:44