cake icon indicating copy to clipboard operation
cake copied to clipboard

ReportGenerator not able to run on MacOS

Open AdaskoTheBeAsT opened this issue 3 years ago • 3 comments

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched 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

AdaskoTheBeAsT avatar Apr 07 '22 08:04 AdaskoTheBeAsT

@AdaskoTheBeAsT can you confirm how you are installing the tool? Are you using the Cake pre-processor directive to do this, or is this being done elsewhere?

gep13 avatar Apr 07 '22 08:04 gep13

@gep13 I use it in cake.frosting - it is installed by "InstallTool" method

return new CakeHost() .UseContext<BuildContext>() .InstallTool(new Uri("nuget:?package=dotnet-reportgenerator-globaltool&version=5.1.4&loaddependencies=true"))

AdaskoTheBeAsT avatar Apr 07 '22 10:04 AdaskoTheBeAsT

I think this one can be closed. I've been using the dotnet-reportgenerator-globaltool for several years and don't have issues with it on macOS.

Cheesebaron avatar Oct 11 '23 09:10 Cheesebaron