question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Bad IL format with Cake 2.3.0 MacOSX

See original GitHub issue

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

Cake runner

Cake .NET Tool

Cake version

2.3.0

Operating system

macOS

Operating system architecture

64-Bit

CI Server

Azure DevOps

What are you seeing?

Running builds for (AndroidX and GooglePlayServices-Firebase-MLKit) both locally and on CI with Cake 2.3.0 there is an error.

Stripped for search:

Error: Bad IL format. 
The format of the file 
    'tools/Addins/runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple.4.3.0/runtimes/osx.10.10-x64/native/System.Security.Cryptography.Native.Apple.dylib' 
is invalid. 
An error occurred when executing task Error: .NET CLI: 
Process returned an error (exit code 1)

from CI server:

Error: Bad IL format. 
The format of the file 
    '/Users/runner/work/1/s/tools/Addins/runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple.4.3.0/runtimes/osx.10.10-x64/native/System.Security.Cryptography.Native.Apple.dylib' 
is invalid. 
An error occurred when executing task Error: .NET CLI: Process returned an error (exit code 1)

What is expected?

correct build

Steps to Reproduce

  1. install or update Cake.Tool to 2.3.0
  2. clone AndroidX or GooglePlayServices-Firebase-MLKit
  3. run builds
    dotnet cake -t=clean && dotnet cake -t=ci 
    

ping me in the comments if you need scripts to repro (installing, cloning, building)

Output log

too long

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
moljaccommented, Apr 3, 2023

error I get on MacOSX Ventura:

Error: Bad IL format. The format of the file './tools/Addins/runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple.4.3.0/runtimes/osx.10.10-x64/native/System.Security.Cryptography.Native.Apple.dylib' is invalid.
An error occurred when executing task 'tools-executive-order'.
Error: .NET CLI: Process returned an error (exit code 1).

cake version:

dotnet cake --version
3.0.0

Looks like some transitive dependencies cause this.

quite old packages:

https://www.nuget.org/packages/runtime.native.System.Security.Cryptography.Apple/4.3.0

https://www.nuget.org/packages/runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0

Commands that should repro (with cake 3.0 installed):

git clone --recursive https://github.com/xamarin/GooglePlayServicesComponents.git
cd GooglePlayServicesComponents/
dotnet tool uninstall --global Cake.Tool && dotnet tool install --global Cake.Tool --version 3.0.0
dotnet cake -t=ci && dotnet cake utilities.cake -t=tools-executive-order
1reaction
moljaccommented, Apr 3, 2023

Thanks @moljac. If I understand correctly, these builds seem to work fine on Cake v2.2.0 but break on v2.3.0

Well right now I get it with cake 3.0, so I downgrade to 2.3.0.

Any chance you can get a repro of one of these repos running on GitHub Actions?

I can try.

I gave it a shot on https://github.com/augustoproiete-repros/repro-cake-build-issue-3996-bad-il-format but the build seems to be stuck for hours - I’m probably missing something there

Yeah those are looong builds. AX 45 minutes to 1 hour and GPS-FB-MLKit 1.5-2 hrs.

I will try to use 3.0.0 and see if I can repro something.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Bad IL format - Strange .NET error
It seems to occur when a certain stored procedure is called, but its really difficult to re-create and happens randomly. System.
Read more >
Issues · cake-build/cake
cake: Cake (C# Make) is a cross platform build automation system. - Issues · cake-build/cake. ... Error: Bad IL format with Cake 2.3.0...
Read more >
How can I fix "Bad IL format" Error when Publishing after ...
I added the UiPath.Form.Activities (version 1.96) to my C# UiPath Project. Now, when I publish my project, numerous Bad IL format. messages ...
Read more >
Bad IL format
I am getting Bad Image format error frequently , previously i was using 6.1 and after implementing 6.3 i am getting this error....
Read more >
Untitled
#flat Cooker cake in hindi with egg, Alluka kills, Mathletics foals lyrics, ... Pow file format, Mc trucks burgess hill, Bad apple brewing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found