Skip to content

Add polyfill for ProcessStartInfo.ArgumentList#125

Merged
Tyrrrz merged 12 commits intoprimefrom
copilot/add-polyfill-processstartinfo-argumentlist
Apr 19, 2026
Merged

Add polyfill for ProcessStartInfo.ArgumentList#125
Tyrrrz merged 12 commits intoprimefrom
copilot/add-polyfill-processstartinfo-argumentlist

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 19, 2026

  • Add NetCore10/WeakReference.csWeakReference<T> for NETFRAMEWORK && !NET45_OR_GREATER
  • Add NetCore10/ConditionalWeakTable.csConditionalWeakTable<TKey, TValue> for NETFRAMEWORK && !NET40_OR_GREATER
  • Update NetCore30/ProcessStartInfo.cs — widen NETFRAMEWORK guard from NET45_OR_GREATER to NETFRAMEWORK
  • Add PolyShim.Tests/NetCore10/WeakReferenceTests.cs
  • Add PolyShim.Tests/NetCore10/ConditionalWeakTableTests.cs
  • Build and verify

Agent-Logs-Url: https://github.com/Tyrrrz/PolyShim/sessions/73ea323c-ae3a-48b2-9134-2d04d9d871e2

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
@Tyrrrz Tyrrrz added the enhancement New feature or request label Apr 19, 2026
@Tyrrrz Tyrrrz marked this pull request as ready for review April 19, 2026 12:21
Copilot AI review requested due to automatic review settings April 19, 2026 12:21
Comment thread PolyShim.Tests/NetCore30/ProcessStartInfoTests.cs Outdated
Comment thread PolyShim.Tests/NetCore30/ProcessStartInfoTests.cs Outdated
Comment thread PolyShim/NetCore30/ProcessStartInfo.cs Outdated
Agent-Logs-Url: https://github.com/Tyrrrz/PolyShim/sessions/3aa77282-ca0f-4189-9371-9a0117a5eb0d

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a PolyShim member polyfill for System.Diagnostics.ProcessStartInfo.ArgumentList to enable argument-list based process invocation on TFMs where the BCL property isn’t available (e.g., .NET Framework and older .NET Core).

Changes:

  • Introduces an extension ArgumentList property backed by a ConditionalWeakTable, rebuilding ProcessStartInfo.Arguments on collection mutations.
  • Implements Windows-style command-line argument escaping when materializing Arguments.
  • Adds end-to-end tests that spawn cmd/sh to validate multi-arg and space-containing argument behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
PolyShim/NetCore30/ProcessStartInfo.cs Adds the ProcessStartInfo.ArgumentList member polyfill and argument escaping logic.
PolyShim.Tests/NetCore30/ProcessStartInfoTests.cs Adds process-based tests intended to validate the new ArgumentList behavior across platforms.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread PolyShim/NetCore30/ProcessStartInfo.cs Outdated
Comment thread PolyShim.Tests/NetCore30/ProcessStartInfoTests.cs Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Apr 19, 2026

@copilot the build is failing on net35 and net40: https://github.com/Tyrrrz/PolyShim/actions/runs/24629070630/job/72013142864?pr=125

How hard would it be to polyfill those missing APIs?

Comment thread PolyShim/NetCore30/ProcessStartInfo.cs Outdated
Agent-Logs-Url: https://github.com/Tyrrrz/PolyShim/sessions/cefeebcd-9df2-42ed-b8d6-b5ecf34bd7cd

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Apr 19, 2026

@copilot declare ArgumentListCollection as file class at the top of the file, mark with ExcludeFromCoverage same as everything else

…to file class

Agent-Logs-Url: https://github.com/Tyrrrz/PolyShim/sessions/8c8419fc-9d41-482c-806e-6931321f907c

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Tyrrrz/PolyShim/sessions/e61d0a1d-8333-4035-ad9b-92713e866984

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 19, 2026

Codecov Report

❌ Patch coverage is 91.83673% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.80%. Comparing base (d7bd31b) to head (d71e738).
⚠️ Report is 1 commits behind head on prime.

Files with missing lines Patch % Lines
PolyShim.Tests/NetCore30/ProcessStartInfoTests.cs 69.23% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            prime     #125      +/-   ##
==========================================
+ Coverage   90.76%   95.80%   +5.03%     
==========================================
  Files         285      188      -97     
  Lines        4959     3550    -1409     
  Branches      404      169     -235     
==========================================
- Hits         4501     3401    -1100     
+ Misses        366      128     -238     
+ Partials       92       21      -71     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants