cake-build / cake-build/cake

`InspectCode` calls the exe file even on Linux, where it doesn't work

Open
#4,313 1 comment 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 .NET Tool, Cake Frosting

### Cake version

4.0.0

### Operating system

Linux

### Operating system architecture

64-Bit

### CI Server

_No response_

### What are you seeing?

I would like to run `InspectCode` on my solution. I have installed the [ReSharper Command Line Tools](https://www.jetbrains.com/resharper/features/command-line.html), as they contain the same code as the NuGet package (but can be installed globally once). On Linux, they need a custom runtime, therefore should be started from `inspectcode.sh` and not `inspectcode.exe`.
Therefore, I get the error
```
Failed to fill the environment container with handler ?{myArgs=?(2pcs)[/output:/output.xml, solution.sln]?}?. Could not find method '.ctor' due to a type load error: Could not load file or assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. assembly:/opt/resharper/JetBrains.Platform.Util.dll type:ListEvents`1 member:(null)
```

Unfortunately, `inspectcode.exe` is hardcoded in Cake. I would like to see a switch based on the current OS.

### What is expected?

If I run `InspectCode` on a Linux machine, `inspectcode.sh` is used instead of `inspectcode.exe`.

### Steps to Reproduce

Call `InspectCode` on a Linux machine

### Output log

See above for the error message

Contributor guide

Open the contributing guide

Research direction

Start by locating the InspectCode entry point and the code that hardcodes inspectcode.exe. Reproduce the command on Linux, then verify the expected script is selected there and the existing executable remains selected elsewhere.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.