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

Can only build Roslyn.sln a single time before building breaks (2) #74156

Open
CyrusNajmabadi opened this issue Jun 25, 2024 · 4 comments · May be fixed by #74205
Open

Can only build Roslyn.sln a single time before building breaks (2) #74156

CyrusNajmabadi opened this issue Jun 25, 2024 · 4 comments · May be fixed by #74205

Comments

@CyrusNajmabadi
Copy link
Member

Using:

image

Repro steps.

  1. Build Roslyn.sln.
  2. Build Roslyn.sln again

First time succeeds with:

WARNING: Potential build performance issue in 'IntegrationTestBuildProject.csproj'. The project does not appear up-to-date after a successful build: Output 'D:\github\roslyn\artifacts\bin\IntegrationTestBuildProject\Debug\net45\IntegrationTestBuildProject.dll' does not exist, not up-to-date. See https://aka.ms/incremental-build-failure.
========== Rebuild All: 207 succeeded, 0 failed, 0 skipped ==========
========== Rebuild completed at 2:10 PM and took 03:20.100 minutes ==========

Second time fails with:

...
8>Roslyn.VisualStudio.Setup -> D:\github\roslyn\artifacts\bin\Roslyn.VisualStudio.Setup\Debug\net472\Roslyn.VisualStudio.Setup.dll
8>InteractiveHost64 -> D:\github\roslyn\artifacts\bin\InteractiveHost64\Debug\net8.0-windows\win-x64\publish\
8>InteractiveHost64 -> D:\github\roslyn\artifacts\bin\InteractiveHost64\Debug\net472\win-x64\publish\
8>InteractiveHost32 -> D:\github\roslyn\artifacts\bin\InteractiveHost32\Debug\net472\InteractiveHost32.exe
8>D:\github\roslyn\src\VisualStudio\CSharp\Impl\Options\Formatting\FormattingOptionPageControl.xaml.cs(16,35,16,59): error CS0281: Friend access was granted by 'Microsoft.VisualStudio.LanguageServices.Implementation, Version=42.42.42.42, Culture=neutral, PublicKeyToken=31bf3856ad364e35', but the public key of the output assembly ('') does not match that specified by the InternalsVisibleTo attribute in the granting assembly.
8>CSC : error CS8102: Public signing was specified and requires a public key, but no public key was specified.
8>D:\github\roslyn\src\VisualStudio\CSharp\Impl\ChangeSignature\CSharpChangeSignatureViewModelFactoryService.cs(14,85,14,115): error CS0281: Friend access was granted by 'Microsoft.VisualStudio.LanguageServices, Version=42.42.42.42, Culture=neutral, PublicKeyToken=31bf3856ad364e35', but the public key of the output assembly ('') does not match that specified by the InternalsVisibleTo attribute in the granting assembly.
8>D:\github\roslyn\src\VisualStudio\CSharp\Impl\Interactive\CSharpVsInteractiveWindowPackage.cs(8,70,8,75): error CS0281: Friend access was granted by 'Microsoft.VisualStudio.LanguageServices, Version=42.42.42.42, Culture=neutral, PublicKeyToken=31bf3856ad364e35', but the public key of the output assembly ('') does not match that specified by the InternalsVisibleTo attribute in the granting assembly.
8>D:\github\roslyn\src\VisualStudio\CSharp\Impl\Interactive\CSharpVsInteractiveWindowProvider.cs(22,70,22,75): error CS0281: Friend access was granted by 'Microsoft.VisualStudio.LanguageServices, Version=42.42.42.42, Culture=neutral, PublicKeyToken=31bf3856ad364e35', but the public key of the output assembly ('') does not match that specified by the InternalsVisibleTo attribute in the granting assembly.
8>D:\github\roslyn\src\VisualStudio\CSharp\Impl\Options\CSharpVisualStudioOptionStorageReadFallbacks.cs(64,105,64,125): error CS0281: Friend access was granted by 'Microsoft.VisualStudio.LanguageServices, Version=42.42.42.42, Culture=neutral, PublicKeyToken=31bf3856ad364e35', but the public key of the output assembly ('') does not match that specified by the InternalsVisibleTo attribute in the granting assembly.
8>D:\github\roslyn\src\VisualStudio\CSharp\Impl\ChangeSignature\CSharpChangeSignatureViewModelFactoryService.cs(19,67,19,105): error CS0281: Friend access was granted by 'Microsoft.VisualStudio.LanguageServices, Version=42.42.42.42, Culture=neutral, PublicKeyToken=31bf3856ad364e35', but the public key of the output assembly ('') does not match that specified by the InternalsVisibleTo attribute in the granting assembly.
8>D:\github\roslyn\src\VisualStudio\CSharp\Impl\ObjectBrowser\CSharpLibraryService.cs(17,43,17,65): error CS0281: Friend access was granted by 'Microsoft.VisualStudio.LanguageServices, Version=42.42.42.42, Culture=neutral, PublicKeyToken=31bf3856ad364e35', but the public key of the output assembly ('') does not match that specified by the InternalsVisibleTo attribute in the granting assembly.
8>D:\github\roslyn\src\VisualStudio\CSharp\Impl\LanguageService\CSharpCodeCleanupFixerProvider.cs(19,53,19,85): error CS0281: Friend access was granted by 'Microsoft.VisualStudio.LanguageServices, Version=42.42.42.42, Culture=neutral, PublicKeyToken=31bf3856ad364e35', but the public key of the output assembly ('') does not match that specified by the InternalsVisibleTo attribute in the granting assembly.
8>D:\github\roslyn\src\VisualStudio\CSharp\Impl\Options\AdvancedOptionPage.cs(13,41,13,59): error CS0281: Friend access was granted by 'Microsoft.VisualStudio.LanguageServices.Implementation, Version=42.42.42.42, Culture=neutral, PublicKeyToken=31bf3856ad364e35', but the public key of the output assembly ('') does not match that specified by the InternalsVisibleTo attribute in the granting assembly.
...
12>Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests -> D:\github\roslyn\artifacts\bin\Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests\Debug\net472\Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests.dll
12>Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests -> D:\github\roslyn\artifacts\bin\Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests\Debug\net8.0\Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests.dll
========== Build: 7 succeeded, 5 failed, 195 up-to-date, 0 skipped ==========
========== Build completed at 2:15 PM and took 23.812 seconds ==========
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 25, 2024
@arkalyanms
Copy link
Member

@CyrusNajmabadi is this both cmdline and vs?

@CyrusNajmabadi
Copy link
Member Author

no. just VS> i don't use the command line :)

@arkalyanms arkalyanms added Bug and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 27, 2024
@arkalyanms arkalyanms added this to the 17.11 P3 milestone Jun 27, 2024
@arkalyanms
Copy link
Member

@jjonescz Compile error + Tiger. Would you scout and transition to next Tiger as necessary?

@jjonescz
Copy link
Contributor

jjonescz commented Jun 28, 2024

The main error seems to be

CSC error CS8102: Public signing was specified and requires a public key, but no public key was specified. [D:\roslyn-D\src\VisualStudio\CSharp\Impl\Microsoft.VisualStudio.LanguageServices.CSharp.csproj]

Indeed in the binlog I can see the key is not provided to csc.

Adding <PublicSign>False</PublicSign> to Microsoft.VisualStudio.LanguageServices.CSharp.csproj is one way to work around the problem (but not sure if it doesn't cause other issues).

It seems the underlying bug is that CoreCompile target uses the KeyOriginatorFile property which is set by target ResolveKeySource but that target is not a dependency of CoreCompile (although it's a dependency of CoreBuild and Compile). Most of the time, the ResolveKeySource actually runs before CoreCompile so it works fine, but not in this case (not sure why exactly).

So adding <CoreCompileDependsOn>$(CoreCompileDependsOn);ResolveKeySource</CoreCompileDependsOn> somewhere works around the problem.

I've opened an issue at MSBuild: dotnet/msbuild#10306
And a workaround here: #74205

Outdated

In Error List I see this additional error (but not always, so might be unrelated/flaky thing):

Severity Code Description Project File Line Suppression State Details
Error (active) VSSDK1044 Could not find project VisualStudioSetup referenced from source.extension.vsixmanifest. Please add a ProjectReference to VisualStudioSetup or correct project name in source.extension.vsixmanifest. ExpressionEvaluatorPackage, Microsoft.VisualStudio.IntegrationTest.Setup C:\.tools\.nuget\packages\microsoft.vssdk.buildtools\17.9.3137-preview3\tools\vssdk\Microsoft.VsSDK.targets 120

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants