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

ReportGenerator not able to run on MacOS #3864

Open
2 tasks done
AdaskoTheBeAsT opened this issue Apr 7, 2022 · 3 comments
Open
2 tasks done

ReportGenerator not able to run on MacOS #3864

AdaskoTheBeAsT opened this issue Apr 7, 2022 · 3 comments

Comments

@AdaskoTheBeAsT
Copy link
Contributor

Prerequisites

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

return new[] { "reportgenerator", "ReportGenerator.exe" };

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

@gep13
Copy link
Member

gep13 commented Apr 7, 2022

@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?

@AdaskoTheBeAsT
Copy link
Contributor Author

AdaskoTheBeAsT commented Apr 7, 2022

@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 added a commit to AdaskoTheBeAsT/Cake.ReSharper.GlobalTools that referenced this issue Apr 9, 2022
@Cheesebaron
Copy link
Contributor

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.

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

3 participants