Skip to content

Widen Process arguments to IEnumerable<string> - #584

Merged
SimonCropp merged 1 commit into
mainfrom
process-arguments-ienumerable
Sep 9, 2026
Merged

Widen Process arguments to IEnumerable<string>#584
SimonCropp merged 1 commit into
mainfrom
process-arguments-ienumerable

Conversation

@SimonCropp

Copy link
Copy Markdown
Owner

Run, RunAsync, RunAndCaptureText, RunAndCaptureTextAsync and StartAndForget declare arguments as IList<string>?, but net11 RC1 ships them as IEnumerable<string>?:

ProcessExitStatus Run(string fileName, IEnumerable<string>? arguments = null, bool silent = false, TimeSpan? timeout = null)

So passing a sequence that is not a list — a LINQ result, an IReadOnlyList<string>, a HashSet<string> — compiles on net11 and fails to compile on every polyfilled target framework. That is the break the package exists to prevent.

The signatures came from #547, written against an earlier preview where the parameter was IList<string>. The shape changed before RC1.

Widening is source compatible for existing callers.

Changes

  • The five public methods, plus the RunSilentAsync and BuildStartInfo helpers that carried the type through. BuildStartInfo only enumerated the arguments, so no bodies changed.
  • The five //Link: overload anchors, which encode the parameter type (system-collections-generic-ilist((system-string)) to ...-ienumerable((system-string))). They would otherwise point at an overload that does not exist.
  • Consume.cs now calls all five through a variable typed IEnumerable<string> backed by a HashSet<string>, so a non-list sequence has to bind. That is a compile check across all 22 target frameworks, and on net11 it compiles against the BCL, so both sides are pinned.

API count is unchanged at 1038, since this is a signature change rather than a new API.

Verification

  • Solution builds clean in Release, Consume rebuilds clean in Debug across all 22 target frameworks.
  • Tests green on net11.0 (1601), net462 (1581) and net8.0 (1598).
  • ApiBuilderTests rerun to regenerate the Split files, api_list.include.md and the readme.

Run, RunAsync, RunAndCaptureText, RunAndCaptureTextAsync and
StartAndForget declared arguments as IList<string>?, but net11 RC1 ships
them as IEnumerable<string>?. Passing a sequence that is not a list, such
as a LINQ result or an IReadOnlyList, compiled on net11 and failed on
every polyfilled target framework.

The signatures were written against an earlier preview, where the
parameter was IList<string>. Widening is source compatible for existing
callers.
@SimonCropp SimonCropp added this to the 11.3.0 milestone Sep 9, 2026
@SimonCropp
SimonCropp merged commit f9b93ea into main Sep 9, 2026
4 of 6 checks passed
@SimonCropp
SimonCropp deleted the process-arguments-ienumerable branch September 9, 2026 11:57
This was referenced Sep 10, 2026
This was referenced Sep 11, 2026
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

Successfully merging this pull request may close these issues.

1 participant