-
Notifications
You must be signed in to change notification settings - Fork 55
publish temporary SourceLink.LibGit2Sharp to NuGet Gallery that support dotnet core #140
Comments
before the compile? What does it do? Don't you need a PDB to do the work? Or is the new roslyn feature of passing a JSON file to the compiler so the PDB is written correctly the first time done and you're leveraging it? If you have a dotnet CLI tool and an MSBuild extension, do you have to have two NuGet packages, such that one is a PackageReference and the other is a DotNetCliTool? I'll publish a LibGit2Sharp.CoreCLR package (or named something like that) that you can consume by end of day (pacific time zone). And I like your policy of unlisting it once the official one offers equivalent functionality. |
Yes, it just creates a json file for the new format. The file location is passed in to the compilers via
Currently, it will looks like this: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.4</TargetFramework>
<DebugType>Portable</DebugType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SourceLink.Create.GitHub" Version="2.0.0-*" />
<DotNetCliToolReference Include="dotnet-sourcelink-git" Version="2.0.0-*" />
</ItemGroup>
</Project> I'm hoping that
Thanks. I'm a few issues away from pushing a build. If not tonight, then early this week. cc @tmat |
I don't think you'll get the dependencies the way you want. At least not in the near future. So I advocate for optimizing for easy consumption in the near term, by just having the msbuild extension package that bundles everything. |
Copying two lines to a .csproj instead of one to enable source linking isn't terrible. I want the msbuild extension package to be just a simple wrapper, so I'm probably not going to bundle everything. I really like how the dotnet cli tools extensions load all dependencies from the .nuget cache. |
@ctaggart Are you thinking copying the input source files to temp dir and replacing the line endings there? Interesting idea, but I'm not sure if that's ideal. I just hit the line ending issue with Roslyn. Roslyn build server normalizes line endings when checking out git branch to build, so GitLink is broken :(. Is it possible to override this for a particular checkout/clone command? If so then all we have to do so make sure that "official" build checks out "as is". |
BTW, the reason I think it's not ideal to translate the line endings in SourceLink tool is that it's fixing behavior of git. It'd be better if it was possible to configure git to do the right thing in the first place. |
I haven't experienced this line ending issue. We check in LF and checkout CRLF, and my source server testing seems to work. |
@ctaggart Do you need this to be a stable package that I publish to nuget.org? |
The line endings mismatch has plagued this project. Solutions are well documented at https://github.com/ctaggart/SourceLink/wiki/Line-Endings. |
@AArnott The compiler calculates SHA1 of the sources files in their binary form. If the files served by https://raw.githubusercontent.com have different line endings their SHAs will be different and hence the debugger would consider them not matching. |
@AArnott Probably. It might still care in some scenarios as I just found out (even if I set the option to not care). It might be a debugger bug. I sent debugger folks a repro to investigate. |
Or I wonder if... one might say that raw.githubcontent should offer CRLF files (just as the compiler saw) because the .gitattributes files says to. |
@ctaggart Thanks for the link. Very useful. Sounds like we could tweak our lab build to clone "as is". |
appveyor does something bizarre. It checks out LF despite the .gitattributes file. It causes some tests to fail. Very annoying. |
@AArnott Now that's an interesting point. |
Perhaps we should ask github folks. If raw.githubcontent did respect the .gitattributes it would fix everything. |
+1. Please CC me when you do. |
@AArnott Yes, a stable if you don't think one is coming out in the next week. :-) |
I've already got the code to autofix the line endings. I just need to port to C# and add it as an option. I think that GitHub should serve the files as they are stored in Git. Git stores them as LF. |
@ctaggart A couple more thoughts I had in the middle of the night: Regarding your "two lines" to be added to the project file instead of just one: does the DotNetCliToolRefrence propagate across P2Ps? If not, then actually it's 1-2 lines for every single project file, whereas a single PackageReference can propagate across P2Ps so folks can just define it in one of their commonly referenced projects in a very large solution and have it done entirely. But perhaps most importantly, I realized when developing PdbGit that as a separate process it would slow down the build noticeably. The roslyn compilers themselves have a resident process that spans project builds because the start time for a managed process (and their own code) was large enough to impact build time significantly. And in pdbgit at least, the time taken to validate the filenames have the appropriate capitalization, find and read the repo, etc., was significant enough that I considered that doing everything within the MSBuild.exe process as part of the MSBuild Task was very important to the user's build perf. But with your design, you're adding a perf hit that you can't optimize away. I don't know how impactful that is in your case, but you may want to measure it. |
libgit2/libgit2sharp#1318 (comment)
@AArnott No, it is not an additional build step. The msbuild task is called before the compile and it simply delegates to the dotnet sourcelink tool.
Could you please do this? I was going to publish a SourceLink.LibGit2Sharp. You have my permission to do so. I just plan on unlisting it once there is an official build.
<PackageReference Include="LibGit2Sharp" Version="0.24.7-g9fca61fdda" />
https://github.com/ctaggart/SourceLink/blob/v2/dotnet-sourcelink-git/dotnet-sourcelink-git.csproj#L18
<add key="aarnott" value="https://www.myget.org/F/aarnott/api/v3/index.json" protocolVersion="3" />
https://github.com/ctaggart/SourceLink/blob/v2/NuGet.Config#L6
The text was updated successfully, but these errors were encountered: