Repository navigation
Closed
Description
Tryign to use beta 2 gives me these errors
StrictFilePathMarshaler must be used on a FilePath. [C:\dev\NuGetKeyVaultSignTool\NuGetKeyVaultSignTool\NuGetKeyVaultSignTool.csproj]
at LibGit2Sharp.Core.StrictFilePathMarshaler.MarshalManagedToNative(Object managedObj) [C:\dev\NuGetKeyVaultSignTool\NuGetKeyVaultSignTool\NuGetKeyVaultSignTool.csproj]
at System.StubHelpers.MngdRefCustomMarshaler.ConvertContentsToNative(IntPtr pMarshalState, Object& pManagedHome, IntPtr pNativeHome) [C:\dev\NuGetKeyVaultSignTool\NuGetKeyVaultSignTool\NuGetKeyVaultSignTool.csproj]
at LibGit2Sharp.Core.NativeMethods.git_repository_discover(GitBuf buf, FilePath start_path, Boolean across_fs, FilePath ceiling_dirs) [C:\dev\NuGetKeyVaultSignTool\NuGetKeyVaultSignTool\NuGetKeyVaultSignTool.csproj]
at LibGit2Sharp.Core.Proxy.<>c__DisplayClass219_0.<git_repository_discover>b__0(GitBuf buf) [C:\dev\NuGetKeyVaultSignTool\NuGetKeyVaultSignTool\NuGetKeyVaultSignTool.csproj]
at LibGit2Sharp.Core.Proxy.ConvertPath(Func`2 pathRetriever) [C:\dev\NuGetKeyVaultSignTool\NuGetKeyVaultSignTool\NuGetKeyVaultSignTool.csproj]
at LibGit2Sharp.Core.Proxy.git_repository_discover(FilePath start_path) [C:\dev\NuGetKeyVaultSignTool\NuGetKeyVaultSignTool\NuGetKeyVaultSignTool.csproj]
at LibGit2Sharp.Repository.Discover(String startingPath) [C:\dev\NuGetKeyVaultSignTool\NuGetKeyVaultSignTool\NuGetKeyVaultSignTool.csproj]
at Microsoft.Build.Tasks.Git.GitOperations.LocateRepository(String directory) in /_/src/Microsoft.Build.Tasks.Git.Operations/GitOperations.cs:line 26 [C:\dev\NuGetKeyVaultSignTool\NuGetKeyVaultSignTool\NuGetKeyVaultSignTool.csproj]
at Microsoft.Build.Tasks.Git.RepositoryTasks.LocateRepository(LocateRepository task) in /_/src/Microsoft.Build.Tasks.Git.Operations/RepositoryTasks.cs:line 58 [C:\dev\NuGetKeyVaultSignTool\NuGetKeyVaultSignTool\NuGetKeyVaultSignTool.csproj]
Using 1.0.0-beta-63127-02 works correctly, 1.0.0-beta2-18618-05 does not.
Reacted by Andrew Arnott
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]Errors wtih beta 2[/-][+]Errors with beta 2[/+]tmat commentedon Jan 22, 2019
@bording
tmat commentedon Jan 22, 2019
Odd, this looks like basic functionality that's well covered by tests. We are also using
1.0.0-beta2-18618-05in our repos and I haven't seen a failure like this.bording commentedon Jan 22, 2019
@onovotny Do you have a repro? Like @tmat said, that should be some pretty basic usage of LibGit2Sharp, so it's surprising to see that sort of error.
clairernovotny commentedon Jan 22, 2019
This repro'd for me both locally and on CI build for https://github.com/onovotny/NuGetKeyVaultSignTool
Just change the version in the props file: https://github.com/onovotny/NuGetKeyVaultSignTool/blob/master/Directory.Build.Props
CI build:
https://dev.azure.com/onovotny/GitBuilds/_build/results?buildId=1579
Look at the Pack step, at the bottom its log file, same problem.
bording commentedon Jan 22, 2019
@onovotny I see that you're referencing both Microsoft.SourceLink.GitHub and Nerdbank.GitVersioning. Could you temporarily remove Nerdbank.GitVersioning and see if the problem still occurs?
Looking at the historical issues around that caused "StrictFilePathMarshaler must be used on a FilePath" errors, it's been related to having more than one copy of LibGit2Sharp in memory.
Those sorts of problems should have been mitigated, but I'm wondering if there is some new reason it would be causing a problem.
tmat commentedon Jan 27, 2019
@onovotny Does removing Nerdbank.GitVersioning fix the issue?
clairernovotny commentedon Jan 27, 2019
Sorry, have not had a chance to take a look yet
clairernovotny commentedon Jan 28, 2019
It still repros for that even when I remove NB.GV.
clairernovotny commentedon Feb 8, 2019
Any ideas?
bording commentedon Feb 9, 2019
@onovotny What do I need to be doing to repro it? It seems to be working fine when I build/pack from Visual Studio.
clairernovotny commentedon Feb 9, 2019
hmm...I just tried again and it's not repro'ing for me right now. very odd given that it repro'd locally and on Azure DevOps.
clairernovotny commentedon Feb 9, 2019
wait...I see something.
With the 2.2.101 SDK, I see the errors, even on Azure DevOps. When I try the 3.0.100-preview 2 SDK to build, I don't.
I'm guessing that we both have the 3.0.100 preview sdk as the default. Adding a global.json to pin the 2.2.100/101 sdk should cause it to repro locally.
clairernovotny commentedon Feb 9, 2019
Moreso, it works with the 3.0 SDK but not the 2.2 SDK:
Build with 2.2.101, you see this:
https://dev.azure.com/onovotny/GitBuilds/_build/results?buildId=1606&view=results
If you open the nupkg in NuGet Package Explorer and double-click the dll, you'll see the embedded ppdb data showing the sourcelink. It's wrong there, pointing at local files.
Built with the 3.0.100-preview2 sdk, here, doing the same thing, the sourcelink works correctly:
https://dev.azure.com/onovotny/GitBuilds/_build/results?buildId=1607&view=results
bording commentedon Feb 9, 2019
I actually don't have a 3.0 SDK installed on this machine. I typically keep prerelease stuff on a VM instead.
The only SDKs I have installed are 2.1.503 and 2.2.102.
2.1.100/101 includes the 2.2.0 runtime, but 2.1.102 has the 2.2.1 runtime. I wonder if there was a bug fixed that could be relevant?
Can you try bumping up to 2.1.102 and see if that fixes things for you as well?
6 remaining items
tmat commentedon Feb 10, 2019
@AaronRobinsonMSFT To comment on which versions of Core CLR dotnet/coreclr#21606 is fixed in and possible backporting.
AaronRobinsonMSFT commentedon Feb 10, 2019
Thanks @tmat.
The issue was fixed in 3.0 preview 2.
@onovotny We addressed this issue based on the following https://github.com/dotnet/coreclr/issues/19654 - it may help you to understand the issue in LibGit2Sharp.
From the looks of this it seems like the issue is related to using the CLI build to consume a library (via a Task/Target?) where the same code works just fine in Visual Studio, right? This makes sense because .NET Framework probably doesn't have the issue and Visual Studio uses .NET Framework for MSBuild.
With respect to backporting to 2.2, that is something I would like to avoid unless absolutely necessary (i..e there is no work around). For right now, this does work from Visual Studio, is the 2.2 CLI a hard requirement for the work at hand?
@jeffschwMSFT for his thoughts on potential backporting of dotnet/coreclr#21606. (cc @jkoritzinsky)
NickCraver commentedon Feb 14, 2019
FWIW, I'm hitting this as well with a build locally. Only noticed it today, but it's happening for others.
Igorbek commentedon Mar 12, 2019
I get the following errors with beta2, building locally with Vsts package:
ctaggart commentedon Mar 19, 2019
The StrictFilePathMarshaler warning shows up for me when I use Nerdbank.GitVersioning.
Pull request to reproduce it is:
ctaggart/froto#100
use previous SourceLink
ctaggart commentedon Mar 19, 2019
I just confirmed what @onovotny mentioned, the previous beta,
1.0.0-beta-63127-02does not produce these warnings.bording commentedon Mar 19, 2019
Unfortunately, if this is hitting the bug fixed by dotnet/coreclr#21606, and at this point it seems quite likely, then I don't think there's a workaround for it. We'd need that to be backported.
use Nerdbank.GitVersioning (#101)
aidapsibr commentedon Apr 14, 2019
Can I recommend adding a warning to users/updating the README to point to the functional package if they use the CLI? Just ran into this as well and 3.0 is a trek away still.
AArnott commentedon May 29, 2019
I'm working on upgrading the https://github.com/tonerdo/coverlet.git repo to using sourcelink and the beta2 of this package exhibits the same problem, while beta1 works.
AArnott commentedon May 29, 2019
I also got the same error as @Igorbek when switching from beta2 to beta1. I filed #286 to track.
Igorbek commentedon May 29, 2019
Thank you @AArnott. So it now seems to have been fixed by #277
tmat commentedon Jun 22, 2019
Fixed by #288