Skip to content
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

Add analyzer redirecting VSIX #42861

Merged
merged 31 commits into from
Mar 10, 2025
Merged

Conversation

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Request triage from a team member labels Aug 20, 2024
}
string directoryPathVersion = Path.GetFileName(Path.GetDirectoryName(directoryPath.Substring(0, index)));

return getMajorMinorPart(directoryPathVersion) == getMajorMinorPart(version);
Copy link
Member

Choose a reason for hiding this comment

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

This is reasonable. I was imagining you'd use System.Version but I can see how that might complicate things. If you leave it this way you can avoid creating new strings by having a single method that compares the strings. Here's a sample

Copy link
Member Author

Choose a reason for hiding this comment

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

Also System.Version cannot parse versions with a hyphen it seems.

@jjonescz jjonescz requested a review from ericstj September 4, 2024 07:49
Copy link
Member

@333fred 333fred left a comment

Choose a reason for hiding this comment

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

Generally LGTM, but it looks like builds are broken so I'll hold off approving until they're good.

@jjonescz
Copy link
Member Author

jjonescz commented Jan 17, 2025

it looks like builds are broken

Yeah, there are source build errors like the following which I hope will go away once the Roslyn PR is merged and we can update it properly here.

Failed to synchronize repo sdk Failed to find all requested refs (6b364f666a4014bc8269131ef30df18c16a83511, 889d6fefa9e7ffb51f97ee1628856d27697c8fc9) in https://github.com/dotnet/roslyn.

@jjonescz jjonescz requested a review from marcpopMSFT March 1, 2025 09:51
@@ -67,6 +67,8 @@
<PackageVersion Include="Microsoft.TestPlatform.Build" Version="$(MicrosoftTestPlatformBuildPackageVersion)" />
<PackageVersion Include="Microsoft.TestPlatform.CLI" Version="$(MicrosoftTestPlatformCLIPackageVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Composition" Version="17.4.16" />
<PackageVersion Include="Microsoft.VisualStudio.Sdk" Version="17.2.32505.173" />
Copy link
Member

Choose a reason for hiding this comment

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

Do you know how often these get updated and how best to keep them updated?

Copy link
Member Author

Choose a reason for hiding this comment

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

This gets a non-preview release with every VS minor version. But I don't think this needs to be updated unless a new functionality from the VS SDK is needed (or if there are some transitive dependency conflicts). That's why it's fine that this is using an old version 17.2 instead of the latest 17.13 (but the real reason I chose 17.2 was because there were some conflicts with transitive dependencies IIRC).

<IncludeDebugSymbolsInVSIXContainer>true</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>true</IncludeDebugSymbolsInLocalVSIXDeployment>
<IncludeCopyLocalReferencesInVSIXContainer>false</IncludeCopyLocalReferencesInVSIXContainer>
<VsixVersion Condition="'$(VsixVersion)' == ''">42.42.42.4242424</VsixVersion>
Copy link
Member

Choose a reason for hiding this comment

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

when is this ever set to a different value?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm, good point, I thought arcade would set this, but maybe something is missing.

Copy link
Member

Choose a reason for hiding this comment

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

It does look like the arcade targets set this. src/Microsoft.DotNet.Arcade.Sdk/tools/VisualStudio.targets. I think it does set this to a default version if not specified. So maybe this line is not necessary?

Copy link
Member Author

@jjonescz jjonescz Mar 10, 2025

Choose a reason for hiding this comment

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

Ah, okay, I've remembered why this is needed. (I will add a comment.)

Arcade imports VisualStudio.targets only on .NET Framework MSBuild. But SDK's CI builds are using Core MSBuild. Filed also dotnet/arcade#15617.

when is this ever set to a different value?

And yes, it's set to a different value in production builds, see the target GetVsixVersion below in this file.

@jjonescz jjonescz merged commit 1ada0f9 into dotnet:main Mar 10, 2025
39 checks passed
@jjonescz jjonescz deleted the analyzer-redirecting branch March 10, 2025 16:39
@@ -405,6 +409,27 @@
</ItemGroup>
</Target>

<Target Name="GenerateRuntimeAnalyzersNupkg"
DependsOnTargets="GenerateLayout;MsiTargetsSetupInputOutputs"
Condition=" '$(OS)' == 'Windows_NT' And '$(Architecture)' == 'x64' And '$(DotNetBuild)' != 'true' "
Copy link
Member

Choose a reason for hiding this comment

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

@jjonescz I just saw this PR. Why did you add the DotNetBuild condition here? Shouldn't the package get produced in the product build? Note that starting with P4 we will ship the product from the VMR and this asset will be missing from the product then.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, I will look into removing the condition.

baronfel pushed a commit to baronfel/sdk that referenced this pull request Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants