Skip to content
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

GitClones throws "Method has no body" #82

Open
pleonex opened this issue Oct 6, 2018 · 1 comment
Open

GitClones throws "Method has no body" #82

pleonex opened this issue Oct 6, 2018 · 1 comment

Comments

@pleonex
Copy link

pleonex commented Oct 6, 2018

Running the following task throws an exception BadImageFormatException: Method has no body:

Task("CloneTest")
    .Does(() =>
{
    GitClone("https://github.com/cake-build/cake.git", "/tmp/cake");
});

I am using Fedora 28 with Mono 5.14 and Cake 0.30.

Error: System.AggregateException: One or more errors occurred. ---> System.BadImageFormatException: Method has no body
  at LibGit2Sharp.Core.Proxy.git_clone (System.String url, System.String workdir, LibGit2Sharp.Core.GitCloneOptions& opts) [0x00009] in <b59d5da32f8541b2a767004d8bddc22b>:0
  at LibGit2Sharp.Repository.Clone (System.String sourceUrl, System.StringworkdirPath, LibGit2Sharp.CloneOptions options) [0x000d3] in <b59d5da32f8541b2a767004d8bddc22b>:0
  at LibGit2Sharp.Repository.Clone (System.String sourceUrl, System.StringworkdirPath) [0x00000] in <b59d5da32f8541b2a767004d8bddc22b>:0
  at Cake.Git.GitAliases.GitClone (Cake.Core.ICakeContext context, System.String sourceUrl, Cake.Core.IO.DirectoryPath workDirectoryPath) [0x000d2] in <7958095920474dc68d0a782f46e32170>:0
  at Submission#0.GitClone (System.String sourceUrl, Cake.Core.IO.DirectoryPath workDirectoryPath) [0x0000c] in <206e5fefce8d49f39d9236778bce09b0>:0
  at Submission#0.<<Initialize>>b__0_4 () [0x00011] in <206e5fefce8d49f39d9236778bce09b0>:0
  at Cake.Core.CakeTaskBuilderExtensions+<>c__DisplayClass17_0.<Does>b__0 (Cake.Core.ICakeContext context) [0x00000] in <1a12afcf649f4de8ab5d15d82d4f6310>:0
  at Cake.Core.CakeTaskBuilderExtensions+<>c__DisplayClass20_0.<Does>b__0 (Cake.Core.ICakeContext x) [0x00000] in <1a12afcf649f4de8ab5d15d82d4f6310>:0
  at Cake.Core.CakeTask+<Execute>d__43.MoveNext () [0x00066] in <1a12afcf649f4de8ab5d15d82d4f6310>:0
--- End of stack trace from previous location where exception was thrown ---
  at Cake.Core.DefaultExecutionStrategy+<ExecuteAsync>d__4.MoveNext () [0x000ee] in <1a12afcf649f4de8ab5d15d82d4f6310>:0
--- End of stack trace from previous location where exception was thrown ---
  at Cake.Core.CakeEngine+<ExecuteTaskAsync>d__31.MoveNext () [0x00131] in<1a12afcf649f4de8ab5d15d82d4f6310>:0
--- End of stack trace from previous location where exception was thrown ---
  at Cake.Core.CakeEngine+<RunTask>d__28.MoveNext () [0x00124] in <1a12afcf649f4de8ab5d15d82d4f6310>:0
--- End of stack trace from previous location where exception was thrown ---
  at Cake.Core.CakeEngine+<RunTargetAsync>d__27.MoveNext () [0x00338] in <1a12afcf649f4de8ab5d15d82d4f6310>:0
--- End of stack trace from previous location where exception was thrown ---
  at Cake.Scripting.BuildScriptHost+<RunTargetAsync>d__3.MoveNext () [0x0009f] in <52bc22bce5254240ba373b3cf23da1ab>:0
--- End of stack trace from previous location where exception was thrown ---
  at Cake.Core.Scripting.ScriptHost.RunTarget (System.String target) [0x0000d] in <1a12afcf649f4de8ab5d15d82d4f6310>:0
  at Submission#0+<<Initialize>>d__0.MoveNext () [0x00195] in <206e5fefce8d49f39d9236778bce09b0>:0
--- End of stack trace from previous location where exception was thrown ---
  at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState+<RunSubmissionsAsync>d__9`1[TResult].MoveNext () [0x00186] in <3ee4bd870c1146d59b98317e4bbdcbe8>:0
--- End of stack trace from previous location where exception was thrown ---
  at Microsoft.CodeAnalysis.Scripting.Script`1+<RunSubmissionsAsync>d__21[T].MoveNext () [0x000a8] in <3ee4bd870c1146d59b98317e4bbdcbe8>:0
   --- End of inner exception stack trace ---
  at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <b78dcefd6c184245be8bf4a1e52466d9>:0
  at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00043] in <b78dcefd6c184245be8bf4a1e52466d9>:0
  at System.Threading.Tasks.Task.Wait () [0x00000] in <b78dcefd6c184245be8bf4a1e52466d9>:0
  at Cake.Scripting.Roslyn.RoslynScriptSession.Execute (Cake.Core.Scripting.Script script) [0x001a7] in <52bc22bce5254240ba373b3cf23da1ab>:0
  at Cake.Core.Scripting.ScriptRunner.Run (Cake.Core.Scripting.IScriptHosthost, Cake.Core.IO.FilePath scriptPath, System.Collections.Generic.IDictionary`2[TKey,TValue] arguments) [0x00358] in <1a12afcf649f4de8ab5d15d82d4f6310>:0
  at Cake.Commands.BuildCommand.Execute (Cake.CakeOptions options) [0x0003f] in <52bc22bce5254240ba373b3cf23da1ab>:0
  at Cake.CakeApplication.Run (Cake.CakeOptions options) [0x00015] in <52bc22bce5254240ba373b3cf23da1ab>:0
  at Cake.Program.Main () [0x000d1] in <52bc22bce5254240ba373b3cf23da1ab>:0
---> (Inner Exception #0) System.BadImageFormatException: Method has no body
File name: 'LibGit2Sharp'
  at LibGit2Sharp.Core.Proxy.git_clone (System.String url, System.String workdir, LibGit2Sharp.Core.GitCloneOptions& opts) [0x00009] in <b59d5da32f8541b2a767004d8bddc22b>:0
  at LibGit2Sharp.Repository.Clone (System.String sourceUrl, System.StringworkdirPath, LibGit2Sharp.CloneOptions options) [0x000d3] in <b59d5da32f8541b2a767004d8bddc22b>:0
  at LibGit2Sharp.Repository.Clone (System.String sourceUrl, System.StringworkdirPath) [0x00000] in <b59d5da32f8541b2a767004d8bddc22b>:0
  at Cake.Git.GitAliases.GitClone (Cake.Core.ICakeContext context, System.String sourceUrl, Cake.Core.IO.DirectoryPath workDirectoryPath) [0x000d2] in <7958095920474dc68d0a782f46e32170>:0
  at Submission#0.GitClone (System.String sourceUrl, Cake.Core.IO.DirectoryPath workDirectoryPath) [0x0000c] in <206e5fefce8d49f39d9236778bce09b0>:0
  at Submission#0.<<Initialize>>b__0_4 () [0x00011] in <206e5fefce8d49f39d9236778bce09b0>:0
  at Cake.Core.CakeTaskBuilderExtensions+<>c__DisplayClass17_0.<Does>b__0 (Cake.Core.ICakeContext context) [0x00000] in <1a12afcf649f4de8ab5d15d82d4f6310>:0
  at Cake.Core.CakeTaskBuilderExtensions+<>c__DisplayClass20_0.<Does>b__0 (Cake.Core.ICakeContext x) [0x00000] in <1a12afcf649f4de8ab5d15d82d4f6310>:0
  at Cake.Core.CakeTask+<Execute>d__43.MoveNext () [0x00066] in <1a12afcf649f4de8ab5d15d82d4f6310>:0
--- End of stack trace from previous location where exception was thrown ---
  at Cake.Core.DefaultExecutionStrategy+<ExecuteAsync>d__4.MoveNext () [0x000ee] in <1a12afcf649f4de8ab5d15d82d4f6310>:0
--- End of stack trace from previous location where exception was thrown ---
  at Cake.Core.CakeEngine+<ExecuteTaskAsync>d__31.MoveNext () [0x00131] in<1a12afcf649f4de8ab5d15d82d4f6310>:0
--- End of stack trace from previous location where exception was thrown ---
  at Cake.Core.CakeEngine+<RunTask>d__28.MoveNext () [0x00124] in <1a12afcf649f4de8ab5d15d82d4f6310>:0
--- End of stack trace from previous location where exception was thrown ---
  at Cake.Core.CakeEngine+<RunTargetAsync>d__27.MoveNext () [0x00338] in <1a12afcf649f4de8ab5d15d82d4f6310>:0
--- End of stack trace from previous location where exception was thrown ---
  at Cake.Scripting.BuildScriptHost+<RunTargetAsync>d__3.MoveNext () [0x0009f] in <52bc22bce5254240ba373b3cf23da1ab>:0
--- End of stack trace from previous location where exception was thrown ---
  at Cake.Core.Scripting.ScriptHost.RunTarget (System.String target) [0x0000d] in <1a12afcf649f4de8ab5d15d82d4f6310>:0
  at Submission#0+<<Initialize>>d__0.MoveNext () [0x00195] in <206e5fefce8d49f39d9236778bce09b0>:0
--- End of stack trace from previous location where exception was thrown ---
  at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState+<RunSubmissionsAsync>d__9`1[TResult].MoveNext () [0x00186] in <3ee4bd870c1146d59b98317e4bbdcbe8>:0
--- End of stack trace from previous location where exception was thrown ---
  at Microsoft.CodeAnalysis.Scripting.Script`1+<RunSubmissionsAsync>d__21[T].MoveNext () [0x000a8] in <3ee4bd870c1146d59b98317e4bbdcbe8>:0 <---
@t081as
Copy link

t081as commented Dec 1, 2018

I'm encountering the same issue using Cake 0.30.0 / Cake.Git 0.19.0.
Seems to be a problem in LibGit2Sharp:
libgit2/libgit2sharp#1637

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants