Skip to content

[BuildCheck Suggestion]: Flag Process.Start usages #10989

@JanKrivanek

Description

@JanKrivanek

Summary

Process.Start from within custom task should be flagged and usage of Exec or ToolTask tasks should be suggested.

On Hold (!)

Let's not action upon this yet. Let's first have a sample demonstrative case that'd be breaking the MSBuild server (plus see if it actually isn't already broken with the curent long lived nodes) and only then decide whether we want to restrict it.

Then we might possibly want to resort to compiler analyzer (or banned API) if runtime checks proves complicted

Background and Motivation

Process.Start creates child processes that cannot be easily controlled by MSBuild engine (as opposed to using Exec or ToolTask tasks). This can e.g. lead to issues during MSBuild server adoption (issue with redirecting outputs)

Notes

Possible ways to detect the Process.Start (need to be investigated if doable):

  • Injecting reroute function for Process.Start (akin unittest mocking)
  • .net profiling API
  • Monitor for child process creation (akin child process debugging)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: BuildCheckBuildCheck SuggestionSuggestion for a built in MSBuild analyzer. Label should be applied together with 'Area: BuildCheck'triaged

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions