[release/10.0.1xx] [build] Fix ConfigureLocalWorkload for .NET 10.0.400 SDK#11579
Draft
jonathanpeppers wants to merge 3 commits into
Draft
[release/10.0.1xx] [build] Fix ConfigureLocalWorkload for .NET 10.0.400 SDK#11579jonathanpeppers wants to merge 3 commits into
ConfigureLocalWorkload for .NET 10.0.400 SDK#11579jonathanpeppers wants to merge 3 commits into
Conversation
….400 SDK PR #11550 bumped the SDK to 10.0.400-preview.0.26281.104, where workload-set mode is the default. As a result, `dotnet workload install android-deps --skip-manifest-update` no longer reliably enumerates loose manifests from `DOTNETSDK_WORKLOAD_MANIFEST_ROOTS`, and the synthetic `android-deps` workload written by `InstallManifestAndDependencies` is not recognized: Workload installation failed: Workload ID android-deps is not recognized. Switch the local SDK to manifest-mode before the workload install via `dotnet workload config --update-mode manifests` so loose manifests are honored again. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
/azp run |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses CI failures on release/10.0.1xx when running ConfigureLocalWorkload, caused by .NET 10.0.400 SDK defaulting to workload-set mode where the synthetic android-deps workload (from loose manifests under DOTNETSDK_WORKLOAD_MANIFEST_ROOTS) is not reliably discovered. The change opts the CLI back into loose-manifest update mode prior to installing android-deps.
Changes:
- Adds
dotnet workload config --update-mode manifestsbefore installing the syntheticandroid-depsworkload. - Keeps the existing
dotnet workload install android-deps ... --skip-manifest-updateflow intact, relying onDOTNETSDK_WORKLOAD_MANIFEST_ROOTS.
`build-tools/banned-apis/banned-apis.targets` and
`src/Mono.Android/Mono.Android.csproj` were committed by dependabot
with CRLF stored directly in the index, bypassing git's clean
filter. `.gitattributes` declares `*.targets` and `*.csproj` as
`eol=crlf`, which means the index should store them as LF and the
smudge filter writes CRLF to the working tree on checkout. With the
"wrong" CRLF blobs, any tool that rewrites these files on Linux/macOS
during CI leaves them in a state `git status` reports as modified,
failing the "Ensure no modified/untracked files" check:
Changes not staged for commit:
modified: build-tools/banned-apis/banned-apis.targets
modified: src/Mono.Android/Mono.Android.csproj
Example failing build:
https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=14283875
Run `git add --renormalize` on the two affected files so the index
stores LF (matching `.gitattributes`). `git diff -w` shows no
content change; only line endings.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
/azp run |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
…r preview band
The previous attempt added `dotnet workload config --update-mode manifests`,
but the install still failed on 10.0.400-preview SDKs with:
Workload installation failed: Workload ID android-deps is not recognized.
Root cause: `SdkDirectoryWorkloadManifestProvider` enumerates loose
manifests from `<root>/<SdkFeatureBand.ToString()>/`. For SDK
10.0.400-preview.0.26281.104, that band string is `10.0.400-preview.0`,
not `10.0.400`. The synthetic `android-deps` manifest was being written
to `lib/sdk-manifests/10.0.400/android.deps.workload/...`, so the SDK
never discovered it.
Fix: write the synthetic `android.deps.workload` folder under
`$(DotNetPreviewVersionBand)` (which already includes the preview
suffix and matches `SdkFeatureBand.ToString()` for both stable and
preview SDKs). `_LocalAndroidManifestFolder` is left under
`$(DotNetSdkManifestsFolder)` since it is only the packaging source
for the workload-manifest NuGet, not a path the SDK reads at install
time.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
PRs targeting
release/10.0.1xxwere failing in two CI steps after PR #11550 bumped the SDK to10.0.400-preview.0.26281.104. This PR fixes both.1.
ConfigureLocalWorkloadtargetSymptom (example failing builds: 14272822, 14286661):
Root cause:
SdkDirectoryWorkloadManifestProviderdiscovers loose manifests under<root>/<SdkFeatureBand.ToString()>/. For SDK10.0.400-preview.0.26281.104that string is10.0.400-preview.0, not10.0.400. The syntheticandroid-depsworkload manifest was being written tobin/Release/lib/sdk-manifests/10.0.400/android.deps.workload/..., so the SDK's resolver never found it. Previous stable /-rtm/-devSDKs returned just10.0.400fromSdkFeatureBand.ToString(), which is why this worked before #11550.Fix in
build-tools/create-packs/ConfigureLocalWorkload.targets:android.deps.workloadfolder under$(DotNetPreviewVersionBand)(e.g.10.0.400-preview.0) instead of$(DotNetSdkManifestsFolder)(10.0.400).DotNetPreviewVersionBandalready matchesSdkFeatureBand.ToString()for both stable and preview SDKs.dotnet workload config --update-mode manifestsbefore the install to ensure the local SDK is in loose-manifest mode, since workload-set mode is now the default in 10.0.400._LocalAndroidManifestFolderis intentionally left under$(DotNetSdkManifestsFolder)— it is only the packaging source for the workload-manifest NuGet, not a path the SDK reads at install time.2. "Ensure no modified/untracked files" dirty-tree check
Symptom (example failing build: 14283875): the dirty-tree check reported
build-tools/banned-apis/banned-apis.targetsandsrc/Mono.Android/Mono.Android.csprojas modified.Root cause: dependabot bumps (#11562, #11563) stored these files with CRLF directly in the git index.
.gitattributesdeclares*.targetsand*.csprojaseol=crlf, which means the index should hold LF and the smudge filter writes CRLF to the working tree on checkout. When CRLF is stored in the index, any cross-platform tool that touches the file causesgit statusto report changes.Fix: ran
git add --renormalizeon just those two files. The diff is whitespace-only (verifiable withgit diff -w); content is unchanged.