Conversation
build.libgit2sharp.sh
Outdated
There was a problem hiding this comment.
This -m32 looks like a workaround for an OSX issue, where IIRC the mono packages ship a 32-bit binary. On your average Linux distro (or other Unix) on an amd64 box, mono is built for the "native" architecture, and thus expects a a 64-bit .so file.
Even that aside, not many people will have the cross-compilation/multiarch support installed (as you don't often need it). Travis is such an example.
There was a problem hiding this comment.
I agree with @carlosmn here, we shouldn't be trying to force anything. Can we be fancy on Mac and build fat binaries?
if [ `uname -s` = "Darwin" ]; then
CFLAGS=-arch x86 -arch amd64
LDFLAGS=-bundle
fi
If you want to be really crazy you can add -arch ppc on Mac OS < 10.8 and -arch ppc64 on Mac OS 10.5 only. But that would be really crazy.
There was a problem hiding this comment.
CMake can do the fat binary setup for us https://github.com/libgit2/libgit2/blob/development/README.md#macos-x
|
/cc @dragan |
|
Yay for CMake! Looks like Travis is happy, and OS X builds fine now. There are still a couple of failing tests, though: I'll look into either fixing or skipping these. |
|
Heh. diff --git a/LibGit2Sharp.Tests/BranchFixture.cs b/LibGit2Sharp.Tests/BranchFixture.cs
index a6fcc30..4921879 100644
--- a/LibGit2Sharp.Tests/BranchFixture.cs
+++ b/LibGit2Sharp.Tests/BranchFixture.cs
@@ -30,7 +31,12 @@ public void CanCreateBranch(string name)
Assert.Equal("refs/heads/" + name, newBranch.CanonicalName);
Assert.NotNull(newBranch.Tip);
Assert.Equal(committish, newBranch.Tip.Sha);
- Assert.NotNull(repo.Branches.SingleOrDefault(p => p.Name == name));
+ Assert.NotNull(repo.Branches.SingleOrDefault(p => {
+ if (p.Name.EndsWith("m")) {
+ Assert.False(true, "(" + p.Name + " == " + name + ") = " + (p.Name == name));
+ }
+ return p.Name == name;
+ }));
AssertRefLogEntry(repo, newBranch.CanonicalName,
newBranch.Tip.Id,Output: I think this may be a precomposition thing. Should we just skip this test on OS X for now? |
/cc @arrbee
Let's do this. |
@ben Just for troubleshooting purpose, could you please output the bytes that those strings are made of? |
Yup, |
|
Okay, I've fixed one more failure, and it's green. Here's what my output looks like now: |
|
Canonically, even. We could |
|
You're right, that's better. |
|
Do we have any tests that exercise remote branches with special characters? |
|
Should we? We already cover remotes, and once the branch is local, we cover that too. |
|
I'm not familiar with |
|
No idea, just thinking out loud. I guess OSX would reencode the tracking branch file names just as it's messing with the normal branch file names? |
|
I don't think so. The string is being marshalled correctly and represents On Mon, Nov 11, 2013 at 10:43 AM, Keith Dahlby notifications@github.comwrote:
|
|
Should everything that goes through What OS X does to filenames I think is a separate issue, which should be dealt with at the native level (if at all). |
|
I don't think you want to normalize anything in the marshaller. On any system that doesn't force a specific composition in the filesystem, you can have both of those filenames. So we if you destroyed the actual filename by normalizing to NFC we wouldn't be able to roundtrip the actual filename. |
|
I think I'm with @ethomson - this test failure is an artifact of how we're checking for equality, not incorrect behavior. |
|
@ethomson @dahlbyk Ok, Thanks for your feedback! @ben Let's go with that, then. Could you please add an explicit comment in the test describing why we actually call then... rebasing/squashing time? |
|
Squashed, and Works on My Machine™. |
💖 Merged, and Works on the CI Server™, as well 💥 |
|
Just tried these changes on my machine running Mac OS X 10.8.5 with Mono 3.2.4 and the build and tests completed without issue as well. |

This reworks the
build.libgit2sharp.shscript to allow tests to run with Mono on OS X. Tested under Mono 3.2.4 on OS X Mavericks, and my 32-bit Ubuntu VM.Fixes #557.