Skip to content

Revert to same version of System.CommandLine as 6.0.1xx. - #23380

Merged
marcpopMSFT merged 2 commits into
dotnet:release/6.0.2xxfrom
dsplaisted:revert-commandline-version
Jan 19, 2022
Merged

marcpopMSFT merged 2 commits into
dotnet:release/6.0.2xxfrom
dsplaisted:revert-commandline-version

Conversation

@dsplaisted

Copy link
Copy Markdown
Member

Reverts #22351

Comment thread eng/Versions.props
<MicrosoftDeploymentDotNetReleasesVersion>1.0.0-preview1.1.21112.1</MicrosoftDeploymentDotNetReleasesVersion>
<SystemManagementPackageVersion>4.6.0</SystemManagementPackageVersion>
<SystemCommandLineVersion>2.0.0-beta1.21601.2</SystemCommandLineVersion>
<SystemCommandLineVersion>2.0.0-beta1.21473.1</SystemCommandLineVersion>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The command-line-api entries in Version.Details.xml need to be updated accordingly as well with this version. Utilizing darc update-dependencies is a good way to ensure all entries are updated correctly.

@marcpopMSFT

Copy link
Copy Markdown
Member

@dsplaisted I think templating needs to be on the same system.command line first as well. They are currently on 2.0.0-beta1.21525.1 in their 6.0.200 branch.

CC @MichaelSimons @vlada-shubina @baronfel

@marcpopMSFT

Copy link
Copy Markdown
Member

@dsplaisted @MichaelSimons The darwin and source build legs have build failures installing 1.0.5. That is excluded from ubuntu with this line:

if [[ "$DISTRO" != "ubuntu" || "$MAJOR_VERSION" -le 16 ]]; then

Did the underlying images change that those legs used such that they no longer support 1.0.5?

@vlada-shubina

Copy link
Copy Markdown
Member

@dsplaisted I think templating needs to be on the same system.command line first as well. They are currently on 2.0.0-beta1.21525.1 in their 6.0.200 branch.

CC @MichaelSimons @vlada-shubina @baronfel

I can revert templating 6.0.2xx branch to same version (2.0.0-beta1.21473.1)

Comment thread src/Cli/dotnet/Parser.cs
else if (command.Name.Equals(NewCommandParser.GetCommand().Name))
{
NewCommandShim.Run(context.ParseResult.GetArguments());
NewCommandShim.Run(helpArgs);

@vlada-shubina vlada-shubina Jan 12, 2022 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this fix is still needed. dotnet new --help and dotnet new console --help are different commands. Passing just --help to dotnet new is not enough.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we dug into this some more - on its face this seems wrong for dotnet new (and any command with subcommands) but it turns out that in this revert the whole issue is sidestepped by the way the built-in commands are invoked in Program.cs. If a built-in command is detected then Program.cs forwards along the entire parseResult argument array to that command, which for dotnet new results in the correct help being returned, despite what this if block would suggest. I've tested this branch locally to ensure this is the case, and we do get template-specific help when dotnet.dll new console --help is invoked.

Therefore, I suggest that we delete this else if entirely for clarity reasons on this 6.0.2xx branch. See the linked suggestion

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We checked it more closely with @baronfel, due to other changes in Program.cs this code is not used anymore. Any dotnet new command is redirected to NewCommandShim as it is part of BuiltInCommand.

However, the code is still invalid. I would recommend to remove this if branch as once this code becomes reachable the bug discovered in #23162 will come back.

@MichaelSimons

Copy link
Copy Markdown
Member

Did the underlying images change that those legs used such that they no longer support 1.0.5?

The docker images used in the SB leg has not changed. This logic is busted for distros such as centos, fedora, etc. Why is this check necessary? If it is needed for certain scenarios, why not utilize an explicit setting to enable?

Comment thread src/Cli/dotnet/Parser.cs
Comment on lines 191 to 194
else if (command.Name.Equals(NewCommandParser.GetCommand().Name))
{
NewCommandShim.Run(context.ParseResult.GetArguments());
NewCommandShim.Run(helpArgs);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This whole range can be deleted due to https://github.com/dotnet/sdk/pull/23380/files#r783164794

Suggested change
else if (command.Name.Equals(NewCommandParser.GetCommand().Name))
{
NewCommandShim.Run(context.ParseResult.GetArguments());
NewCommandShim.Run(helpArgs);
}

@dsplaisted

Copy link
Copy Markdown
Member Author

@dsplaisted I think templating needs to be on the same system.command line first as well. They are currently on 2.0.0-beta1.21525.1 in their 6.0.200 branch.
CC @MichaelSimons @vlada-shubina @baronfel

I can revert templating 6.0.2xx branch to same version (2.0.0-beta1.21473.1)

@vlada-shubina Yes, can you go ahead and do this?

Reverting this change that was put in with the last system command line codeflow.
@marcpopMSFT

Copy link
Copy Markdown
Member

@dotnet/kitten Three of the test failures were accessviolations that may be coming from msbuild. Have ya'll seen reports of this?
Expected command to pass but it did not.\r\nFile Name:
1
D:\a_work\1\s\artifacts\bin\redist\Debug\dotnet\dotnet.exe\r\nArguments: pack -o ../pkgs\r\nExit Code: -2146233082\r\nStdOut:\r\nMicrosoft (R) Build Engine version 17.1.0-preview-22063-01+f3c1fc9e5 for .NET\r\nCopyright (C) Microsoft Corporation. All rights reserved.\r\nStdErr:\r\nFatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.\r\n
2
Expected command to pass but it did not.\r\nFile Name: D:\a_work\1\s\artifacts\bin\redist\Debug\dotnet\dotnet.exe\r\nArguments: add D:\a_work\1\s\artifacts\tmp\Debug\WhenRefWithCo---4C8F2363\WithRefCondNonUniform\WithRefCondNonUniform.csproj reference -f net451 D:\a_work\1\s\artifacts\tmp\Debug\WhenRefWithCo---4C8F2363\ValidRef\ValidRef.csproj\r\nExit Code: 57005\r\nStdOut:\r\n\r\nStdErr:\r\nFatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.\r\n at Microsoft.Build.Framework.NativeMethods.IsLongPathsEnabledRegistry()\r\n at Microsoft.Build.Framework.NativeMethods.IsMaxPathLegacyWindows()

3
Expected command to pass but it did not.\r\nFile Name: D:\a_work\1\s\artifacts\bin\redist\Debug\dotnet\dotnet.exe\r\nArguments: build --configuration Debug\r\nExit Code: 57005\r\nStdOut:\r\nMicrosoft (R) Build Engine version 17.1.0-preview-22063-01+f3c1fc9e5 for .NET\r\nCopyright (C) Microsoft Corporation. All rights reserved.\r\n\r\n Determining projects to restore...\r\n Restored D:\a_work\1\s\artifacts\tmp\Debug\ItPassesDepsf---D4353578\TestAppWithProjDepTool.csproj (in 1.04 sec).\r\n Restored D:\a_work\1\s\artifacts\tmp\Debug\ItPassesDepsf---D4353578\TestAppWithProjDepTool.csproj (in 1.19 sec).\r\n You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview\r\nStdErr:\r\nFatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.\r\n at System.Reflection.Metadata.MetadataReader.ReadMetadataTableRowCounts(System.Reflection.Metadata.BlobReader ByRef, UInt64)\r\n at System.Reflection.Metadata.MetadataReader.ReadMetadataTableHeader(System.Reflection.Metadata.BlobReader ByRef, System.Reflection.Metadata.Ecma335.HeapSizes ByRef, Int32[] ByRef, System.Reflection.Metadata.Ecma335.TableMask ByRef)\r\n at System.Reflection.Metadata.MetadataReader..ctor(Byte*, Int32, System.Reflection.Metadata.MetadataReaderOptions, System.Reflection.Metadata.MetadataStringDecoder, System.Object)\r\n at System.Reflection.Metadata.PEReaderExtensions.GetMetadataReader(System.Reflection.PortableExecutable.PEReader, System.Reflection.Metadata.MetadataReaderOptions, System.Reflection.Metadata.MetadataStringDecoder)\r\n at System.Reflection.Metadata.PEReaderExtensions.GetMetadataReader(System.Reflection.PortableExecutable.PEReader)\r\n at Microsoft.Build.Shared.AssemblyNameExtension.GetAssemblyNameEx(System.String)

@Forgind

Forgind commented Jan 19, 2022

Copy link
Copy Markdown
Contributor

We actually had an AV come up recently, and we suspected it was antivirus software. Is there a dump of the problem somewhere?

@Forgind

Forgind commented Jan 19, 2022

Copy link
Copy Markdown
Contributor

It should be almost impossible to get that from managed code.

@wtgodbe

wtgodbe commented Jan 19, 2022

Copy link
Copy Markdown
Member

@dsplaisted is this good to go?

@wtgodbe

wtgodbe commented Jan 19, 2022

Copy link
Copy Markdown
Member

Ah, Daniel's out - @marcpopMSFT were your concerns fixed by the last commit?

@marcpopMSFT
marcpopMSFT merged commit af70bc8 into dotnet:release/6.0.2xx Jan 19, 2022
@marcpopMSFT

Copy link
Copy Markdown
Member

@wtgodbe merged since it passed but the msbuild folks should be aware that there may be some instability if this happens again.

rainersigwald added a commit to dotnet-maestro-bot/sdk that referenced this pull request Jan 19, 2022
…dline-version"

This reverts commit af70bc8, reversing
changes made to 5df0e5f.

These changes are not needed in `main` because it is moving forward on
System.CommandLine versions, so the code changes needed to revert are
unnecessary.
baronfel added a commit to baronfel/sdk that referenced this pull request Jan 26, 2022
…dline-version"

This reverts commit af70bc8, reversing
changes made to 5df0e5f.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants