-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add support for --os
option to the restore
command
#49166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
--os
the restore
command--os
option to the restore
command
@copilot can you add a test for dotnet restore into GivenThatIWantToRestoreApp.cs that covers -r, --os and -a? |
I've added a test for dotnet restore with the requested options. The new test Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
@copilot it appears three verify completion tests are failing as they don't know about the new --os flag. Can you fix the test baselines? Here's the test failure output to help.[xUnit.net 00:00:11.37] Received: DotnetCliSnapshotTests.VerifyCompletions.received.sh [xUnit.net 00:00:11.38] Received: DotnetCliSnapshotTests.VerifyCompletions.received.ps1 [xUnit.net 00:00:11.42] Received: DotnetCliSnapshotTests.VerifyCompletions.received.zsh |
I've fixed the completion test baselines for the three failing shell formats by adding the --os option to the expected completion outputs. The changes include:
These updates match exactly what the test failure output indicated was missing. The changes are in commit 5e5908f. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
@copilot The files under documentation/manpages/sdk are generated based on our documentation and should not be manually edited. Can you revert the changes to that file? Can you also update the copilot-instructions.md file to help ensure those files are not edited by any copilots in the future? |
I've reverted the changes to documentation/manpages/sdk/dotnet-restore.1 as requested since those files are generated. I've also updated .github/copilot-instructions.md to include guidance that files under documentation/manpages/sdk should not be manually edited. The changes are in commit 77c887a. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for the --os option to the dotnet restore command, aligning its behavior with other commands like dotnet build.
- Adds the new --os option to CLI completions across zsh, PowerShell, and bash snapshot tests.
- Introduces a RID-specific test verifying support for --os along with other related options.
- Updates the restore command parser to include the new OperatingSystemOption.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
test/dotnet.Tests/CompletionTests/snapshots/zsh/DotnetCliSnapshotTests.VerifyCompletions.verified.zsh | Added --os completion entry to the snapshot. |
test/dotnet.Tests/CompletionTests/snapshots/pwsh/DotnetCliSnapshotTests.VerifyCompletions.verified.ps1 | Added --os completion entry to the snapshot. |
test/dotnet.Tests/CompletionTests/snapshots/bash/DotnetCliSnapshotTests.VerifyCompletions.verified.sh | Added --os option to the list of completion options. |
test/dotnet.Tests/CommandTests/Restore/GivenThatIWantToRestoreApp.cs | Introduced tests for RID-specific restore options, including --os. |
src/Cli/dotnet/Commands/Restore/RestoreCommandParser.cs | Updated to add the OperatingSystemOption to the restore command. |
.github/copilot-instructions.md | Updated documentation instructions regarding generated files. |
The watch tests are failing which is a known issue. #49150 is tracking the fix. We should remerge once that is checked in so we can rerun the tests. |
Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
77c887a
to
5deec41
Compare
In .NET 6, we added support for implied/partial RIDs as well as flags for specifying the OS portions of a RID. With this PR, the
--os
option is now supported in thedotnet restore
command, providing the same functionality as it does in other commands likedotnet build
.This change allows users to specify the target operating system when performing RID-specific restores, with any missing RID portions being inferred from the current SDK execution context. For example, running
dotnet restore --os linux
on a Windows x64 machine will result in a restore targeting thelinux-x64
RID.The implementation:
OperatingSystemOption
to the restore command optionsThis change ensures consistency across the dotnet CLI by making the
--os
option available in the restore command, similar to the existing--arch
option.Fixes #24251.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
8xbvsblobprodcus382.vsblob.vsassets.io
dotnet build src/Cli/dotnet/dotnet.csproj
(dns block)bcnvsblobprodcus378.vsblob.vsassets.io
dotnet build src/Cli/dotnet/dotnet.csproj
(dns block)c78vsblobprodcus322.vsblob.vsassets.io
/home/REDACTED/work/sdk/sdk/.dotnet/dotnet msbuild /m /nologo /clp:Summary /v:minimal /nr:true /warnaserror /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=false /home/REDACTED/work/sdk/sdk/artifacts/toolset/restore.proj /t:__WriteToolsetLocation /clp:ErrorsOnly;NoSummary /p:__ToolsetLocationOutputFile=/home/REDACTED/work/sdk/sdk/artifacts/toolset/10.0.0-beta.25265.101.txt
(dns block)dotnet build src/Cli/dotnet/dotnet.csproj
(dns block)i1qvsblobprodcus353.vsblob.vsassets.io
dotnet build src/Cli/dotnet/dotnet.csproj
(dns block)l49vsblobprodcus358.vsblob.vsassets.io
dotnet build src/Cli/dotnet/dotnet.csproj
(dns block)mfjvsblobprodcus373.vsblob.vsassets.io
dotnet build src/Cli/dotnet/dotnet.csproj
(dns block)s4uvsblobprodcus326.vsblob.vsassets.io
dotnet build src/Cli/dotnet/dotnet.csproj
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.