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

Intermittent MSB6006 compiler failures using CodeQL in GitHub Actions #70368

Closed
martincostello opened this issue Oct 13, 2023 · 3 comments
Closed
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@martincostello
Copy link
Member

For some time period of time (I don't remember exactly, but it's been months) I've been getting intermittent failures in the C# compiler in CodeQL analysis legs in GitHub Actions workflows.

Seemingly at random, the code will fail to compile with an error like this:

Running /home/runner/work/Polly/Polly/.dotnet/dotnet build --no-incremental /home/runner/work/Polly/Polly/Polly.sln
MSBuild version 17.7.3+8ec440e68 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  Polly.Core -> /home/runner/work/Polly/Polly/src/Polly.Core/bin/Debug/net6.0/Polly.Core.dll
  Polly.Core -> /home/runner/work/Polly/Polly/src/Polly.Core/bin/Debug/net462/Polly.Core.dll
/home/runner/work/Polly/Polly/.dotnet/sdk/7.0.402/Roslyn/Microsoft.CSharp.Core.targets(80,5): error MSB6006: "csc.dll" exited with code 1. [/home/runner/work/Polly/Polly/src/Polly/Polly.csproj::TargetFramework=net6.0]

This only affects compilation for CodeQL so I imagine that something there is part of the problem, however I've attempted to get more information out of the build using approaches like --verbosity diagnostic and /p:ErrorLog=./msbuild.log (e.g. martincostello/alexa-london-travel-site#1910), but to no avail. I don't seem to be able to get any further detail out of the compiler as to why it is failing.

In this case today, it failed 5 times in a row.

Maybe this is related to #42616 and some custom analysis for CodeQL is the root cause, but unless I'm incorrectly configuring something, the C# compiler should emit some more detailed information about what is wrong to aid resolution of the problem.

Version Used:

At least the following versions of the .NET SDK have manifested this issue:

  • 7.0.400
  • 7.0.401
  • 7.0.402

Steps to Reproduce:

Run either of these two workflows in GitHub Actions to perform CodeQL code analysis:

Diagnostic Id:

MSB6006

Expected Behavior:

The code compiles.

Actual Behavior:

Errors such as the below occur:

/home/runner/work/Polly/Polly/.dotnet/sdk/7.0.402/Roslyn/Microsoft.CSharp.Core.targets(80,5): error MSB6006: "csc.dll" exited with code 1. [/home/runner/work/Polly/Polly/src/Polly/Polly.csproj::TargetFramework=net6.0]
@jaredpar
Copy link
Member

Sorry, this bug somehow slipped through my triage board. I just came across it again today.

Is this still happening? If so can you try to get a binary log of the build (use the -bl argument)? That will give us a full stack and we can start tracking down where this is coming from.

@martincostello
Copy link
Member Author

I'm not sure if it's would still happen to be honest.

In Polly this workaround seemed to avoid the problem App-vNext/Polly@160efa5, and this seems to have done a similar job in the other repo: martincostello/alexa-london-travel-site@e372a22

When I get a moment I'll undo the workaround in a branch and see if it comes back. If it does I'll try and grab a binary log.

martincostello added a commit to martincostello/alexa-london-travel-site that referenced this issue Jul 23, 2024
martincostello added a commit to App-vNext/Polly that referenced this issue Jul 23, 2024
@martincostello
Copy link
Member Author

No errors after 5 re-runs in Polly and 10 in the other repo.

I'll close this for now on the assumption something somewhere fixed this, and merge the removal of my workaround. I'll open a new issue referencing this one if it comes back again.

@martincostello martincostello closed this as not planned Won't fix, can't repro, duplicate, stale Jul 23, 2024
martincostello added a commit to martincostello/alexa-london-travel-site that referenced this issue Jul 23, 2024
martincostello added a commit to App-vNext/Polly that referenced this issue Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

2 participants