Skip to content

Add runtimeIdentifier parameter to Bundler and TargetInfo for RID-based OS/arch detection#126437

Draft
Copilot wants to merge 7 commits intomainfrom
copilot/remove-optional-os-arch-args
Draft

Add runtimeIdentifier parameter to Bundler and TargetInfo for RID-based OS/arch detection#126437
Copilot wants to merge 7 commits intomainfrom
copilot/remove-optional-os-arch-args

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

  • Remove #nullable enable from TargetInfo.cs
  • Restore FrameworkVersion = targetFrameworkVersion ?? Environment.Version; in TargetInfo constructor
  • Build to verify

@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

Copilot AI and others added 2 commits April 2, 2026 00:06
…ed OS/arch detection

Add a new optional `runtimeIdentifier` parameter to both the `TargetInfo` and
`Bundler` constructors. When provided, the runtime identifier string (e.g.,
"linux-x64", "win-arm64") is parsed to determine the target OS and architecture,
eliminating the need for callers to implement their own RID parsing logic.

Explicit `os` and `arch` parameters take precedence over RID-derived values.
When neither the RID nor explicit parameters are provided, existing behavior
(defaulting to the current OS/arch) is preserved.

Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/080a2b19-6edb-49cd-aa57-3169ae7c998c

Co-authored-by: elinor-fung <47805090+elinor-fung@users.noreply.github.com>
…iscV64 extension

The NETFRAMEWORK Architecture extension already provides LoongArch64, so
the #if !NETFRAMEWORK guard was incorrectly excluding it from RID parsing
on .NET Framework. Add RiscV64 extension for NETFRAMEWORK parity and
remove the conditional compilation from ParseRuntimeIdentifier.

Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/080a2b19-6edb-49cd-aa57-3169ae7c998c

Co-authored-by: elinor-fung <47805090+elinor-fung@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove optional OS/arch arguments in Bundler and TargetInfo Add runtimeIdentifier parameter to Bundler and TargetInfo for RID-based OS/arch detection Apr 2, 2026
Copilot AI requested a review from elinor-fung April 2, 2026 00:13
Copilot AI and others added 2 commits April 2, 2026 00:35
Make the OS and architecture parameters required (non-nullable) in both
the TargetInfo and Bundler constructors, removing the previous approach
of adding a runtimeIdentifier parameter.

- TargetInfo: os and arch are now required positional parameters
- Bundler: targetOS and targetArch are now required positional parameters
  (3rd and 4th, after hostName and outputDir)
- Remove ParseRuntimeIdentifier method and HostOS fallback detection
- Update all test callers to pass explicit OS/arch values
- Keep #nullable enable, RiscV64/LoongArch64 extensions, Version? nullability

Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/181f3158-29d6-449a-b597-e998407a7c29

Co-authored-by: elinor-fung <47805090+elinor-fung@users.noreply.github.com>
… non-optional

Restore the original parameter order (options, targetOS, targetArch) and
make all three required. This avoids changing the parameter order which
would be more disruptive to callers.

Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/181f3158-29d6-449a-b597-e998407a7c29

Co-authored-by: elinor-fung <47805090+elinor-fung@users.noreply.github.com>
…ameworkVersion non-optional

- Add Binaries.CurrentOSPlatform matching the original _hostOS logic
  (Linux → OSX → FreeBSD → Windows fallback)
- Use shared property in both BundlerConsistencyTests and SingleFileTestApp
- Make targetFrameworkVersion non-optional on both TargetInfo and Bundler
- All callers now pass explicit version (Environment.Version as default)

Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/fb0ea73a-20ee-458f-ad6f-9362fdbdb6c7

Co-authored-by: elinor-fung <47805090+elinor-fung@users.noreply.github.com>
…getInfo

Restore the ?? Environment.Version fallback for FrameworkVersion and
remove the #nullable enable directive that was added.

Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/111adf2b-fa15-47e9-9942-56791bd4bfe9

Co-authored-by: elinor-fung <47805090+elinor-fung@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status
Status: No status

Development

Successfully merging this pull request may close these issues.

OS/arch optional arguments in Bundler and TargetInfo

2 participants