Reset CodeQL pipeline and apply dotnet-host-probe SDK drive-casing workaround (#9371)#9373
Closed
Evangelink wants to merge 3 commits into
Closed
Reset CodeQL pipeline and apply dotnet-host-probe SDK drive-casing workaround (#9371)#9373Evangelink wants to merge 3 commits into
Evangelink wants to merge 3 commits into
Conversation
Set MSBUILDDEBUGCOMM=1 and MSBUILDDEBUGPATH to artifacts/msbuild-debug for the Windows Build step, then publish the contents of that folder along with the build binlogs as pipeline artifacts so the MSBuild team can investigate the reported issue (cc Rainer Sigwald). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The previous attempt put the SDK-root drive-casing workaround in Directory.Build.targets, but the Arcade orchestrator/toolset project — which is where the cross-runtime task-host handshake first fires (InstallDotNetCore etc.) — does NOT import the repo's Directory.Build.targets. It DOES import eng/Versions.props via the Arcade SDK chain, so moving the InitialTargets + UsingTask + Target there makes the target actually run before the first .NET task host launch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…g workaround Reset azure-pipelines-codeql.yml to its state at 5857015 (drop the MSBuild node-communication diagnostics) and replace the LoadLibraryEx-based #14026 NetCoreSdkRoot drive-casing workaround in eng/Versions.props with the dotnet-host-probe implementation from #9371. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts repository build infrastructure to (1) restore the CodeQL Azure Pipelines definition to an earlier baseline and (2) add a temporary MSBuild workaround to normalize $(NetCoreSdkRoot) drive-letter casing to avoid intermittent MSB4216 task-host handshake failures on some Windows agents.
Changes:
- Reset
azure-pipelines-codeql.ymlby removing temporary diagnostics and related documentation. - Add a Windows/.NET Framework-only
NormalizeNetCoreSdkRootCasinginitial target ineng/Versions.propsthat probes the canonical drive-letter casing by launchingdotnet.exeand readingGetModuleFileNameW(NULL). - Introduce knobs
DisableNetCoreSdkRootDriveCasingWorkaroundandNetCoreSdkRootDriveCasingOverride=lower|upper(as described in PR metadata).
Show a summary per file
| File | Description |
|---|---|
| eng/Versions.props | Adds an inline RoslynCodeTaskFactory task + initial target to normalize $(NetCoreSdkRoot) drive casing and avoid MSB4216; also changes several pinned version properties. |
| azure-pipelines-codeql.yml | Removes a cautionary comment block about avoiding UseDotNet@2 useGlobalJson in this pipeline. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 4
Comment on lines
+246
to
+255
| using (var p = Process.Start(psi)) | ||
| { | ||
| string stdout = p.StandardOutput.ReadToEnd(); | ||
| string stderr = p.StandardError.ReadToEnd(); | ||
| if (!p.WaitForExit(120000)) | ||
| { | ||
| try { p.Kill(); } catch { } | ||
| Log.LogMessage(MessageImportance.Low, "NormalizeSdkRootDriveCasing: probe timed out launching '{0}'.", dotnetExe); | ||
| return '\0'; | ||
| } |
| // Returns '\0' if it cannot be determined. | ||
| private char GetRegisteredSdkDrive(string sdkRoot) | ||
| { | ||
| char driveKey = sdkRoot[0]; |
Comment on lines
+10
to
+14
| <MicrosoftDotNetBuildTasksTemplatingPackageVersion>11.0.0-beta.26310.1</MicrosoftDotNetBuildTasksTemplatingPackageVersion> | ||
| <MicrosoftTestingExtensionsCodeCoverageVersion>18.9.0-preview.26310.1</MicrosoftTestingExtensionsCodeCoverageVersion> | ||
| <!-- empty line to avoid merge conflicts for darc PRs to update CC and MSTest+MTP --> | ||
| <MSTestVersion>4.3.0-preview.26309.6</MSTestVersion> | ||
| <MicrosoftTestingPlatformVersion>2.3.0-preview.26309.6</MicrosoftTestingPlatformVersion> | ||
| <MSTestVersion>4.3.0-preview.26310.6</MSTestVersion> | ||
| <MicrosoftTestingPlatformVersion>2.3.0-preview.26310.6</MicrosoftTestingPlatformVersion> |
Comment on lines
49
to
51
| steps: | ||
|
|
||
| # NOTE: Do not add an explicit `UseDotNet@2` with `useGlobalJson: true` here. | ||
| # global.json pins a preview SDK (11.0.x-preview.*) and the `UseDotNet@2` task | ||
| # does not search preview channels by default, so it fails with | ||
| # "sdk version matching: 11.0.x could not be found". `eng\common\cibuild.cmd` | ||
| # (invoked below) restores the correct SDK from global.json via `dotnet-install.ps1`, | ||
| # which handles preview versions correctly. | ||
|
|
||
| - task: PowerShell@2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resets
azure-pipelines-codeql.ymlto its state at commit 5857015 and applies the SDK drive-casing workaround fix from #9371.Changes
azure-pipelines-codeql.yml— reset to commit5857015, dropping the temporary MSBuild node-communication diagnostics (MSBUILDDEBUGCOMM/MSBUILDDEBUGPATHenv vars, the debug-folder prep step, and thePublishBuildArtifactssteps).eng/Versions.props— replaces theLoadLibraryEx-based#14026NetCoreSdkRootdrive-casing workaround with the dotnet-host-probe implementation from Work around MSB4216 NET task host drive-casing failure in CodeQL build #9371. The new version learns the canonical drive-letter casing by launching the SDK'sdotnet.exeand readingGetModuleFileNameW(NULL), caches the result per-process, and adds theNetCoreSdkRootDriveCasingOverride(lower/upper) andDisableNetCoreSdkRootDriveCasingWorkaroundknobs. Version numbers are unchanged.