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

Fix build host when only the .net 6 SDK is installed #73818

Merged
merged 3 commits into from
Jun 5, 2024

Conversation

dibarbet
Copy link
Member

@dibarbet dibarbet commented Jun 1, 2024

Was caught by integration tests

[Error - 12:58:15 AM] [BuildHost PID 3252] The BuildHost process exited with -532462766. Process output:
Unhandled exception. System.IO.FileLoadException: Could not load file or assembly 'System.Collections.Immutable, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)
File name: 'System.Collections.Immutable, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at Microsoft.CodeAnalysis.MSBuild.Program.Main(String[] args)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.CodeAnalysis.MSBuild.Program.Main(String[] args)
   at Microsoft.CodeAnalysis.MSBuild.Program.<Main>(String[] args)

SCI was not getting shipped in the output, so when using a .net6 runtime (.net6 SDK only installed, launch server via .exe instead of .dll) it failed to find the 8.0 dependency.
Adding an explicit reference seems to fix the issue

@dibarbet dibarbet requested a review from a team as a code owner June 1, 2024 00:59
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 1, 2024
@dibarbet dibarbet requested review from tmat and jasonmalinowski June 1, 2024 01:00
Copy link
Member

@jasonmalinowski jasonmalinowski left a comment

Choose a reason for hiding this comment

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

As a workaround this seems fine, but can we file a bug to investigate why this is necessary? This feels like a bug in MSBuild or NuGet...

@dibarbet
Copy link
Member Author

dibarbet commented Jun 1, 2024

As a workaround this seems fine, but can we file a bug to investigate why this is necessary? This feels like a bug in MSBuild or NuGet...

it kind of seems expected to me? We didn't directly reference it and we're not shipping self contained, so wouldn't it generally not be added to the output dir (since its part of the SDK)? Might be entirely wrong here.

@sharwell
Copy link
Member

sharwell commented Jun 3, 2024

We didn't directly reference it and we're not shipping self contained

I was expecting we would have an implicit reference to it from the SDK. From there, the <PackageVersion> element would override the version of the implicit reference.

@dibarbet
Copy link
Member Author

dibarbet commented Jun 3, 2024

/azp run roslyn-ci

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@dibarbet
Copy link
Member Author

dibarbet commented Jun 3, 2024

/azp run roslyn-integration-CI

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

using (var pipeServer = new AnonymousPipeServerStream(PipeDirection.Out, HandleInheritability.Inheritable))
{
// Pass the client process a handle to the server.
arguments.Add(pipeServer.GetClientHandleAsString());
pipeClient.StartInfo.Arguments = string.Join(" ", arguments);
pipeClient.StartInfo.UseShellExecute = false;

// Errors will be logged to stderr, redirect to us so we can capture it.
Copy link
Member Author

Choose a reason for hiding this comment

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

errors were getting swallowed so it was just failing with no info. this ensures error output from the discovery worker is captured


// Wait for 'sync message' from the server.
do
try
Copy link
Member Author

Choose a reason for hiding this comment

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

similar change to ensure exception details are captured if something goes wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants