Repository navigation
Add dnx shim to dotnet-host package - #129258
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a dnx dispatcher script to the dotnet-host package output and introduces a Linux package symlink (/usr/bin/dnx → ../share/dotnet/dnx), so dnx is shipped alongside the dotnet host rather than from the SDK package.
Changes:
- Publish a
dnxshim into the host package output on Unix targets and mark it executable. - Add a Linux package symlink for
dnxunder/usr/bin. - Introduce the
dnxdispatcher script that locatesdotnetnext to itself and dispatches into the latest installed SDK.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/installer/pkg/sfx/installers/dotnet-host.proj | Publishes dnx and adds /usr/bin/dnx symlink; adds a chmod step. |
| src/installer/pkg/sfx/installers/dnx | New dnx shell dispatcher script that resolves its install location and invokes the SDK entrypoint. |
The previous condition '$(TargetsUnix)' == 'true' is a target-OS gate and
runs unconditionally on the build machine. If a Unix-targeted host package is
ever built on a Windows host, chmod isn't on PATH and the build fails. Match
the existing pattern elsewhere in the file by additionally gating on host OS
via !$([MSBuild]::IsOSPlatform('windows')).
Co-authored-by: Copilot <[email protected]>
Three changes addressing review feedback on dotnet#129258: 1. Replace `readlink -f` with a POSIX `while [ -L ]` loop. The `-f` flag is a GNU extension and is not supported by macOS's BSD `readlink` before macOS 12.3 (and not at all in default POSIX). The loop walks any chain of symlinks (absolute or relative targets) and combines with `cd ... && pwd -P` to resolve the script's real install directory portably across Linux and macOS. 2. Detect the no-SDK case and emit a clear error instead of producing a confusing `.../sdk//dotnet.dll` path-not-found message when `dotnet --list-sdks` returns nothing. 3. `exec` the final `dotnet` invocation so the shell process is replaced rather than waiting on a child, giving correct signal handling and exit-code propagation without an extra process layer. Co-authored-by: Copilot <[email protected]>
Open
3 tasks
baronfel
approved these changes
Jun 11, 2026
Replace the obsolescent `tail -1` shorthand with the POSIX-mandated `tail -n 1` form. Every `tail` implementation we'd encounter (GNU, BSD, macOS, busybox) supports both, but `-n N` is the form required by POSIX and is preferred for portable `/bin/sh` scripts.
Member
Author
|
/ba-g unrelated build job issue |
This was referenced Jul 14, 2026
eiriktsarpalis
pushed a commit
that referenced
this pull request
Jul 15, 2026
Per the [.NET distribution-packaging guidelines](https://learn.microsoft.com/dotnet/core/distribution-packaging), the dnx dispatcher script lives in the host package alongside the dotnet binary, with a `/usr/bin/dnx` symlink that resolves into `/usr/share/dotnet/dnx`. The script is SDK-version-independent. Previously dnx was shipped from dotnet/sdk's Linux SDK package, which caused a dpkg file conflict on systems where Canonical's `dotnet-host` package was already installed (dotnet/sdk#53834). This also updates the migrated `dnx` script with a fix for dotnet/sdk#54687. This PR must ship alongside a corresponding dotnet/sdk change (dotnet/sdk#54688) that removes dnx from the `dotnet-sdk` package. --------- Co-authored-by: Copilot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per the .NET distribution-packaging guidelines, the dnx dispatcher script lives in the host package alongside the dotnet binary, with a
/usr/bin/dnxsymlink that resolves into/usr/share/dotnet/dnx. The script is SDK-version-independent.Previously dnx was shipped from dotnet/sdk's Linux SDK package, which caused a dpkg file conflict on systems where Canonical's
dotnet-hostpackage was already installed (dotnet/sdk#53834).This also updates the migrated
dnxscript with a fix for dotnet/sdk#54687.This PR must ship alongside a corresponding dotnet/sdk change (dotnet/sdk#54688) that removes dnx from the
dotnet-sdkpackage.Contributes to dotnet/sdk#53834