Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mono support #816

Merged
merged 23 commits into from
Apr 26, 2016
Merged

Mono support #816

merged 23 commits into from
Apr 26, 2016

Conversation

asbjornu
Copy link
Member

@asbjornu asbjornu commented Apr 1, 2016

This PR builds on @BeeWarloc's work in #638 and fixes #264. I've added a Travis build so we can have continuous integration testing on Linux. I don't think I've broken backward compatibility with anything, so it should be safe to merge this into master and release as a 3.x. I think adding Linux support is so important that it can't wait for version 4.

That being said, the tests on Travis fail with the following exception:

System.TypeInitializationException : The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception.
  ----> System.DllNotFoundException : NativeBinaries/linux/amd64/libgit2-785d8c4.so
  at LibGit2Sharp.Core.Proxy.git_repository_init_ext (LibGit2Sharp.Core.FilePath workdirPath, LibGit2Sharp.Core.FilePath gitdirPath, Boolean isBare) <0x4188cb20 + 0x00058> in <filename unknown>:0 
  at LibGit2Sharp.Repository.Init (System.String path, Boolean isBare) <0x4188b080 + 0x0005a> in <filename unknown>:0 
  at LibGit2Sharp.Repository.Init (System.String path) <0x4188b050 + 0x00016> in <filename unknown>:0 
  at EmptyRepositoryFixture.CreateNewRepository (System.String path) <0x4188afb0 + 0x00017> in <filename unknown>:0 
  at RepositoryFixtureBase..ctor (System.Func`2 repoBuilder, GitVersion.Config configuration) <0x4188acd0 + 0x0002b> in <filename unknown>:0 
  at EmptyRepositoryFixture..ctor (GitVersion.Config configuration) <0x4188ac00 + 0x000ad> in <filename unknown>:0 
  at PullRequestInTeamCityTest.GivenARemoteWithATagOnMaster_AndAPullRequestWithTwoCommits_AndBuildIsRunningInTeamCity_VersionIsCalculatedProperly (System.String pullRequestRef) <0x418931b0 + 0x0009b> in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0x41733ab0 + 0x000b7> in <filename unknown>:0 
--DllNotFoundException
  at (wrapper managed-to-native) LibGit2Sharp.Core.NativeMethods:git_libgit2_init ()
  at LibGit2Sharp.Core.NativeMethods+LibraryLifetimeObject..ctor () <0x4188d390 + 0x00010> in <filename unknown>:0 
  at LibGit2Sharp.Core.NativeMethods..cctor () <0x4188d120 + 0x00159> in <filename unknown>:0 

I think this is the problem being described in libgit2/libgit2sharp#1170, so when that's closed and LibGit2Sharp upgraded in this PR, Travis should happily execute the build and paint all tests in a beautiful, green color. I hope @nulltoken can verify this?

Unless libgit2/libgit2sharp#1170 takes an ice age to complete, I think merging this PR should wait until it's fixed. Oh and thanks to @gep13 for the moral support and tips on Gitter. 😄

@asbjornu asbjornu force-pushed the feature/mono-support branch 3 times, most recently from e6da25c to 47c8787 Compare April 6, 2016 10:54
@apmorton
Copy link

apmorton commented Apr 6, 2016

I'm on mobile now, so this is just a guess. I can look into it further
later today.

On line 56, make compilers static.

private readonly ICompiler[] compilers = new ICompiler[]

I vaguely remember having issues with that being static, which is why it
ended up being private readonly, but I might be mistaken.

Austin
On Apr 6, 2016 6:58 AM, "Asbjørn Ulsberg" [email protected] wrote:

Ugh. Seems like 6caae2e
6caae2e
is causing trouble with NUnit 3.2. I can't get the parametrization of
AssemblyInfoBuilderTests to work:

AssemblyInfoBuilderTests.VerifyAssemblyVersion_Major: The sourceName
specified on a ValueSourceAttribute must refer to a non null static
field, property or method.

@apmorton https://github.com/apmorton, @JakeGinnivan
https://github.com/JakeGinnivan, do you have idea on how to fix this?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#816 (comment)

@apmorton
Copy link

apmorton commented Apr 6, 2016

Ignore me - github delivered that email notification waaaaay late :)

@asbjornu
Copy link
Member Author

asbjornu commented Apr 6, 2016

@apmorton Thanks for checking in! A bit of searching and poking brought me to nunit/nunit#947 which made me realize that ValueSourceAttributes expects the referenced field to be static in NUnit 3. So, all good! 😄

asbjornu added 19 commits April 13, 2016 14:08
Upgraded LibGit2Sharp from version 0.22.0-pre20150716071016 to version 0.22.0 and its associated LibGit2Sharp.NativeBinaries from version 1.0.72 to version 1.0.129.
Changed usage of `Branch.Name` to `Branch.FriendlyName` and a few other properties and methods made obsolete by LibGit2Sharp v0.22.0.
Added Unix guards on the `AfterBuild` MSBuild target, so `ilmerge.exe` won't be attempted to run under Mono, where it will fail with an exit code of `126` (whatever that means).
Added reference to NUnit.Runners so we can run unit tests in the console (for Mono/Travis builds, especially).
Since `nunit3-console` is not backwards compatible with the console of NUnit 2, remove the `/noshadow` argument.
According to nunit/nunit#947, `ValueSourceAttributes` expects the referenced field to be `static` in NUnit 3.
- Upgraded LibGit2Sharp from v0.22.0 to v0.23.0-dev
- Upgraded LibGit2Sharp.NativeBinaries from v1.0.129 to v1.0.137
asbjornu added a commit to Pomona/Pomona that referenced this pull request Apr 19, 2016
Add a conditional on the GitVersionTask import so it's not imported on Unix, until GitTools/GitVersion#816 is fixed through a (pre-) release of libgit2/libgit2sharp#1298 on NuGet.
asbjornu added a commit to Pomona/Pomona that referenced this pull request Apr 19, 2016
Add a conditional on the GitVersionTask import so it's not imported on Unix, until GitTools/GitVersion#816 is fixed through a (pre-) release of libgit2/libgit2sharp#1298 on NuGet.
Upgraded LibGit2Sharp from version 0.23.0-dev000000000000 to version 0.23.0-pre20150419160303.
Upgraded NUnit from version 3.2.0 to version 3.2.1
@asbjornu asbjornu force-pushed the feature/mono-support branch from 48b9075 to 8f5a431 Compare April 20, 2016 05:54
Update NuGet in the Travis install step
@asbjornu
Copy link
Member Author

This PR depends on GitTools/GitTools.Core#29 being merged and pre-released on NuGet so every dependency in the chain is built against LibGit2Sharp version 0.23.0-pre20150419160303.

@JakeGinnivan JakeGinnivan merged commit b2b6084 into GitTools:master Apr 26, 2016
@JakeGinnivan
Copy link
Contributor

Everything downstream has been merged/updated. Gonna try and push out a release, if there is any further work then we can just do a patch release :) There are other fixes I want to get out

@ghuntley
Copy link
Contributor

ghuntley commented Apr 26, 2016

Thanks so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Question] Support for Mono
4 participants