cake-build / cake-build/cake

ReportGenerator not able to run on MacOS

Open
#3,864 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.2k
Forks
778
Avg merge
1h 15m
Merged PRs (30d)
19

Description

### Prerequisites

- [X] I have written a descriptive issue title
- [X] I have searched [issues](https://github.com/cake-build/cake/issues) to ensure it has not already been reported

### Cake runner

Cake Frosting

### Cake version

2.1

### Operating system

macOS

### Operating system architecture

64-Bit

### CI Server

local

### What are you seeing?

when I try to use ReportGenerator from cake I receive

Error: An error occurred trying to start process '/build/tools/dotnet-reportgenerator-globaltool.5.1.4/tools/netcoreapp3.1/any/ReportGenerator.exe' with working directory '/build'. Exec format error

### What is expected?

when I checked by manual command
'''
dotnet ./build/tools/dotnet-reportgenerator-globaltool.5.1.4/tools/net6.0/any/ReportGenerator.dll "-reports:" "-targetdir:" "-reporttypes:Cobertura"
'''

all works - so after first investigation it seems that this is the line responsible for probems
https://github.com/cake-build/cake/blob/48baa8a7dda744f694a209cd4f9ed5fa0471523d/src/Cake.Common/Tools/ReportGenerator/ReportGeneratorRunner.cs#L129

will it be possible to launch report generator by dotnet /ReportGenerator.dll instead?
it would make report generator cross platform

Could you please advise?

### Steps to Reproduce

any usage of context.ReportGenerator

for example. (where unitReport path is root folder for subfolders with xunit reports)

var reportGeneratorSettings = new ReportGeneratorSettings
{
ReportTypes = new[] { ReportGeneratorReportType.Cobertura },
};

context.ReportGenerator(
new GlobPattern($"{unitReportPath.FullPath}/**/coverage.cobertura.xml"),
unitReportPath,
reportGeneratorSettings);

### Output log

Error: An error occurred trying to start process '/build/tools/dotnet-reportgenerator-globaltool.5.1.4/tools/netcoreapp3.1/any/ReportGenerator.exe' with working directory '/build'. Exec format error

Contributor guide

Open the contributing guide

Research direction

Start in src/Cake.Common/Tools/ReportGenerator/ReportGeneratorRunner.cs at the referenced process-launching line, then reproduce the failure with context.ReportGenerator on macOS. Compare it with the working dotnet invocation of ReportGenerator.dll shown in the issue. Done means ReportGenerator runs successfully through Cake Frosting on macOS and the reported example no longer produces an exec format error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system, cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.