Skip to content

Conversation

@marcpopMSFT
Copy link
Member

@marcpopMSFT marcpopMSFT commented Aug 9, 2022

Fixes --print-download-links for VSMac

Description

The prior fix for this #26369 had some limitations. It didn't work correctly in non-band versions of the SDK (ie 6.0.401 wouldn't work even though 6.0.400 would work). It also didn't correctly fall back. In the case that we're likely to see in VSMac, a 6.0.4xx SDK will have 6.0.3xx manifests and running with --sdk-version 7.0.100. Without this change, it was finding the 7.0.100 versions of manifests but not falling back to both 6.0.400 and 6.0.300. As such, the 6.0.300 manifests were being left as older versions. Now we check the –sdk-version value, the current sdk band, and the fallback band.

Customer Impact

VSMac upgrades customers would be left on older versions of the workloads

Testing

See below. Tested using sdk-version for both future and past versions. Tested install still works. Tested with fallback and without. Tested that it would only print links for components not currently installed.

Risk

This is fairly limited in scope to just the print-download link scnario.

Regression

No, the prior fix was incomplete.

6.0.4xx port of the changes from #27011
Updated the fix to clean up the code, fallback to the installed manifest band, and use the installed sdk for the workload resolver.

Testing:
6.0.401-dev SDK with maui installed and 6.0.300 manifests

no SDK version --> 6.0.300 for runtime and 6.0.400 for the rest of the workloads
PS C:\test\bug> dotnet workload update --print-download-link-only
==allPackageLinksJsonOutputStart==
[
"https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.android.manifest-6.0.400/32.0.448/microsoft.net.sdk.android.manifest-6.0.400.32.0.448.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.ios.manifest-6.0.400/15.4.447/microsoft.net.sdk.ios.manifest-6.0.400.15.4.447.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.maccatalyst.manifest-6.0.400/15.4.447/microsoft.net.sdk.maccatalyst.manifest-6.0.400.15.4.447.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.macos.manifest-6.0.400/12.3.447/microsoft.net.sdk.macos.manifest-6.0.400.12.3.447.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.maui.manifest-6.0.400/6.0.486/microsoft.net.sdk.maui.manifest-6.0.400.6.0.486.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.tvos.manifest-6.0.400/15.4.447/microsoft.net.sdk.tvos.manifest-6.0.400.15.4.447.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.net.workload.mono.toolchain.manifest-6.0.300/6.0.8/microsoft.net.workload.mono.toolchain.manifest-6.0.300.6.0.8.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.net.workload.emscripten.manifest-6.0.300/6.0.4/microsoft.net.workload.emscripten.manifest-6.0.300.6.0.4.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.maui.core.ref.android/6.0.486/microsoft.maui.core.ref.android.6.0.486.nupkg",
...
Future version --> 7.0.100 for runtime, 6.0.400 for the rest of the workloads
PS C:\test\bug> dotnet workload update --print-download-link-only --sdk-version 7.0.100
==allPackageLinksJsonOutputStart==
[
"https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.android.manifest-6.0.400/32.0.448/microsoft.net.sdk.android.manifest-6.0.400.32.0.448.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.ios.manifest-6.0.400/15.4.447/microsoft.net.sdk.ios.manifest-6.0.400.15.4.447.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.maccatalyst.manifest-6.0.400/15.4.447/microsoft.net.sdk.maccatalyst.manifest-6.0.400.15.4.447.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.macos.manifest-6.0.400/12.3.447/microsoft.net.sdk.macos.manifest-6.0.400.12.3.447.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.maui.manifest-6.0.400/6.0.486/microsoft.net.sdk.maui.manifest-6.0.400.6.0.486.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.tvos.manifest-6.0.400/15.4.447/microsoft.net.sdk.tvos.manifest-6.0.400.15.4.447.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.net.workload.mono.toolchain.manifest-7.0.100/7.0.0-preview.7.22375.6/microsoft.net.workload.mono.toolchain.manifest-7.0.100.7.0.0-preview.7.22375.6.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.net.workload.emscripten.manifest-7.0.100/7.0.0-preview.7.22361.2/microsoft.net.workload.emscripten.manifest-7.0.100.7.0.0-preview.7.22361.2.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.maui.core.ref.android/6.0.486/microsoft.maui.core.ref.android.6.0.486.nupkg",
...

Past version --> this used the 6.0.300 versions for all manifests and packs
PS C:\test\bug> dotnet workload update --print-download-link-only --sdk-version 6.0.300
==allPackageLinksJsonOutputStart==
[
"https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.android.manifest-6.0.300/32.0.440/microsoft.net.sdk.android.manifest-6.0.300.32.0.440.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.ios.manifest-6.0.300/15.4.328/microsoft.net.sdk.ios.manifest-6.0.300.15.4.328.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.maccatalyst.manifest-6.0.300/15.4.328/microsoft.net.sdk.maccatalyst.manifest-6.0.300.15.4.328.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.macos.manifest-6.0.300/12.3.328/microsoft.net.sdk.macos.manifest-6.0.300.12.3.328.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.maui.manifest-6.0.300/6.0.419/microsoft.net.sdk.maui.manifest-6.0.300.6.0.419.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.tvos.manifest-6.0.300/15.4.328/microsoft.net.sdk.tvos.manifest-6.0.300.15.4.328.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.net.workload.mono.toolchain.manifest-6.0.300/6.0.8/microsoft.net.workload.mono.toolchain.manifest-6.0.300.6.0.8.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.net.workload.emscripten.manifest-6.0.300/6.0.4/microsoft.net.workload.emscripten.manifest-6.0.300.6.0.4.nupkg",
"https://api.nuget.org/v3-flatcontainer/microsoft.maui.core.ref.android/6.0.419/microsoft.maui.core.ref.android.6.0.419.nupkg",

7.0.200 was the same as no version.

@marcpopMSFT marcpopMSFT requested review from a team, ericstj, joperezr and vijayrkn as code owners August 9, 2022 22:42
@ghost ghost added the Area-Infrastructure label Aug 9, 2022
@marcpopMSFT marcpopMSFT changed the base branch from main to release/6.0.4xx August 9, 2022 22:42
@ViktorHofer ViktorHofer removed request for a team, ericstj and joperezr August 10, 2022 07:20
@ViktorHofer
Copy link
Member

@marcpopMSFT I just removed the area-infrastructure-libraries review request as we don't own the component that is being changed in this PR.

@marcpopMSFT marcpopMSFT removed request for a team and vijayrkn August 10, 2022 17:14
@marcpopMSFT
Copy link
Member Author

@ViktorHofer thanks, I'm not sure why those got added as I didn't add anyone. Maybe some connection with the codeowners file?

@marcpopMSFT marcpopMSFT merged commit 5a78b67 into release/6.0.4xx Aug 15, 2022
@marcpopMSFT marcpopMSFT deleted the marcpopMSFT-portprintdownloadfix branch August 15, 2022 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants