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

Already on GitHub? Sign in to your account

Add a script to update NativeBinaries/x86 #124

Merged
merged 6 commits into from Apr 23, 2012

Conversation

Projects
None yet
4 participants
Contributor

aroben commented Mar 12, 2012

This way we won't all have to remember the magic incantation to do this.

@Haacked Haacked commented on an outdated diff Mar 12, 2012

update-native-binaries.ps1
@@ -0,0 +1,49 @@
+<#
+.SYNOPSIS
+ Builds libgit2 and sticks it in Lib/NativeBinaries/x86
+#>
+
+$libgit2sharpDirectory = Split-Path $MyInvocation.MyCommand.Path
+$libgit2Directory = Join-Path $libgit2sharpDirectory "libgit2"
+$x86Directory = Join-Path $libgit2sharpDirectory "Lib\NativeBinaries\x86"
+$configuration = "RelWithDebInfo"
+
+function Build-Libgit2 {
+ & cmake -D BUILD_CLAR=ON -D THREADSAFE=ON -D CMAKE_BUILD_TYPE=$configuration $libgit2Directory
+ if (!$?) {
@Haacked

Haacked Mar 12, 2012

Contributor

God I love powershell. ;) !$?

@Haacked

Haacked Mar 12, 2012

Contributor

I think I broke GitHub with the last comment. ;)
This if statement is why I love Powershell. ;)

Contributor

Haacked commented Mar 12, 2012

👍 I'm not qualified to review the cmake call, but I love the idea of automating this.

Contributor

aroben commented Mar 12, 2012

@nulltoken Does this way of invoking cmake match what you've done when updating NativeBinaries in the past?

Contributor

paulcbetts commented Mar 12, 2012

@aroben Nuke the BUILD_CLAR section or else you have to have Python installed which is Annoying™

Contributor

aroben commented Mar 12, 2012

I will need to nuke the whole Test-Libgit2 bit in that case.

Contributor

paulcbetts commented Mar 13, 2012

Maybe make a check to see if Python is in $PATH then whine up a storm if it isn't but still work?

Contributor

aroben commented Mar 13, 2012

I like that. Warn if Python isn't available, scream if it is available and tests fail.

Member

nulltoken commented Mar 13, 2012

@aroben Awesome addition!

Does this way of invoking cmake match what you've done when updating NativeBinaries in the past?

Yes it does. I also maintain an experimental hybrid (x86/amd64) branch and it would be a very nice feature to also cope with the building of the 64 bits version (-G "Visual Studio 10 Win64") if the Windows SDK is installed. Of course, this would require to only run the correct version of the compiled tests according the running platform.

I also encounter some random p_rename() issues when running the libgit2_test.exe. Usually, relaunching the build makes the problem vanish.

Warn if Python isn't available, scream if it is available and tests fail.

👍

Note: Unless a major issue is raised, LibGit2Sharp v0.9 will embed both versions (x86 and amd64) of libgit2.

Contributor

aroben commented Mar 13, 2012

I also encounter some random p_rename() issues when running the libgit2_test.exe. Usually, relaunching the build makes the problem vanish.

I've seen this too, which is why I opted not to run libgit2_test.exe as part of this script. But we should totally fix the issues and run those tests too!

Member

nulltoken commented Mar 14, 2012

I've seen this too, which is why I opted not to run libgit2_test.exe as part of this script.

Hmm. The p_rename() issue just happened a few times while running the libgit2_clar.exe.

But we should totally fix the issues and run those tests too!

I can't +1 this enough! Unfortunately, I haven't the slightest why this occurs.

Member

nulltoken commented Mar 17, 2012

@aroben I've just run against the same issue. Below an excerpt of the clar output. Do you also encounter this behavior?

[...]
# *** diff::iterator ***
ok 91 - index_0
ok 92 - index_1
ok 93 - tree_0
ok 94 - tree_1
ok 95 - tree_2
ok 96 - tree_3
ok 97 - workdir_0
not ok 98 - workdir_1
  ---
  message : Function call failed: p_rename(".gitted", ".git")
  severity: fail
  suite   : diff::iterator
  test    : workdir_1
  file    : ..\..\libgit2\tests-clar\clar_helpers.c
  line    : 59
  ...
# *** diff::tree ***
ok 99 - 0
ok 100 - options
# *** diff::workdir ***
ok 101 - to_index
ok 102 - to_tree
[...]

@aroben aroben merged commit 4ded435 into blueline Apr 23, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment