Repository navigation
[sharpie] Show a helpful error message when installed on x64 - #25359
Conversation
When users try to install sharpie on x64 Macs, they previously got a confusing 'DotnetToolSettings.xml was not found' error because the nupkg only contained an arm64 binary. Fix this by including a small x64 native binary in the nupkg that prints a clear error message explaining that sharpie requires Apple Silicon and suggests using an arm64 Mac. Fixes #25339 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Packages an osx-x64 “shim” executable into the Sharpie.Bind.Tool .NET tool NuGet so that x64 installs fail with a clear, actionable message instead of the confusing “DotnetToolSettings.xml was not found” error (fixing #25339).
Changes:
- Adds an
osx-x64NativeAOT shim project that prints a targeted unsupported-platform error and exits non-zero. - Extends the tool pack to include an
osx-x64DotnetToolSettings.xmlplus the shim executable undertools/any/osx-x64/. - Updates the sharpie
Makefileto publish the shim before packing the tool nupkg.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/sharpie/Sharpie.Bind.Tool/Sharpie.Bind.Tool.csproj | Attempts to include x64 shim + x64 DotnetToolSettings into the packed tool nupkg. |
| tools/sharpie/Sharpie.Bind.Tool/DotnetToolSettings.osx-x64.xml | Defines sharpie command for the osx-x64 runtime folder using an executable runner. |
| tools/sharpie/Sharpie.Bind.Tool.Unsupported/Sharpie.Bind.Tool.Unsupported.csproj | New shim project that publishes an osx-x64 NativeAOT executable named Sharpie.Bind.Tool. |
| tools/sharpie/Sharpie.Bind.Tool.Unsupported/Program.cs | Implements the shim’s user-facing error message and exit code. |
| tools/sharpie/Makefile | Ensures shim is published prior to dotnet pack for the tool. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
- Use TargetsForTfmSpecificContentInPackage instead of AfterTargets=PackTool so the x64 shim is included during packing, not after. - Add an Exists check with a clear error message if the shim hasn't been published before packing. - Add source file dependencies to the Makefile shim target so changes to the Unsupported project trigger a rebuild. - Fix error message wording to not assume Intel hardware (could be Rosetta). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Replace the Sharpie.Bind.Tool.Unsupported NativeAOT project with a simple bash script. This removes the need for a separate publish step and simplifies the build pipeline. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #b89bc22] Build passed (Detect API changes) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #b89bc22] Build passed (Build packages) ✅Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
✅ [PR Build #b89bc22] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #b89bc22] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 183 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
When users try to install sharpie on x64 Macs, they previously got a
confusing 'DotnetToolSettings.xml was not found' error because the
nupkg only contained an arm64 binary.
Fix this by including a small x64 native binary in the nupkg that
prints a clear error message explaining that sharpie requires Apple
Silicon and suggests using an arm64 Mac.
Fixes #25339