-
Notifications
You must be signed in to change notification settings - Fork 910
LocalDebug configuration using locally-built libgit2 #1194
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
LocalDebug configuration using locally-built libgit2 #1194
Conversation
What I was thinking is doing Or modifying the task which generates that file to be superseded by this property. |
I suppose there are several ways to do this. Doing WRT updating the generate task, I looked at that, but without a good way to indicate that |
After catching up on the comments on #1193, I think I see a pretty easy way to let LibGit2Sharp load a locally built version that wouldn't require any code changes, and would allow for a quick code -> build -> use loop. The NativeBinaries package has a If you go into your packages folder, you can open that file up and change the value to point to the name of your local file. Then, just have your custom libgit2 file copied into the correct NativeBinaries folder in LibGit2Sharp's bin folder. You'd also need to copy it into the Tests bin folder, because at that point VS wouldn't know anything about it, since it wouldn't be listed in the .props file. I've used a variation of this approach before, and it works pretty well. |
I did something like that in #1193 but using an alternate directory for the .txt and .props files that Manually doing what you describe feels like a pain that anyone who wants to contribute must I still don't think it addresses the issue of needing to regenerate NativeDllName.cs whenever I could see removing the getenv code I added to NativeMethods.cs, so that in the mainline |
Agreed. Shouldn't the nuget package restore directory be an opaque thing? Further, trying to copy one file into the build output directory manually seems wrong, it... well, it seems like exactly what a build is supposed to do. |
The MSBuild targets file
Well, sure, but you could always add that copy as a post-build step or something! 😄 I'm not saying that what I suggested is the best way to handle this, just that it is possible to do it without requiring changes to the project! |
Is there something wrong with the CI build servers? One was complaining about machine time limit exceeded and another about a NuGet package dependency. |
I kicked 'em. On Fri, Sep 25, 2015 at 5:33 PM, Jeff Hostetler notifications@github.com
|
Here is an alternative to #1193. Much simpler.
The goal is to allow you to use a locally-built version of libgit2.dll rather than getting it from the
NativeBinaries NuGet package. This allows you hack on libgit2 and immediately use/test it
from C# without needing to build/deploy your own local NuGet package.
It works by defining a new "LocalDebug" configuration (based upon the standard "Debug"
configuration). We then can switch the value of Core.NativeDllName.Name at compile time
using conditionals in the .csproj. It also allows you to quickly switch between "Debug" and
"LocalDebug" in VisualStudio to do A/B testing on libgit2.
As a convenience, I also let you set "LIBGIT2_LOCALDEBUG" environment variable to
point to the directory containing your local build. This value is prepended to your PATH.
This step is optional.