-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add Android workload manifests to SB .NET SDK #42125
base: main
Are you sure you want to change the base?
Conversation
Context: https://github.com/dotnet/maui/releases/tag/9.0.0-preview.6.24327.7 Context: https://github.com/dotnet/android/releases/tag/34.99.0-preview.6.340 Context: https://github.com/xamarin/xamarin-macios/releases/tag/dotnet-9.0.1xx-preview6-9714 These released yesterday with .NET 9 Preview 6.
Context: dotnet/source-build#3242 If using a source-built .NET SDK, the Android workload manifests are not included in the SDK. So, you won't see `android` workload when you run `dotnet workload search`. The Android workload, in general, contains private sources, but the manifest files are completely public. In the long run, we could consider onboarding dotnet/android to: * https://github.com/dotnet/source-build/blob/main/Documentation/sourcebuild-in-repos/new-repo.md But the prerequisites would be to first have the Android workload onboard to arcade: * https://github.com/dotnet/arcade/blob/main/Documentation/Onboarding.md *For now*, we could include the Android workload in source-build by: * Add a step that copies the Android workload manifests source code in-tree (to be used when updating manifests). * Commit the manifest sources. * Source-build will then include the Android workload manifests in the SDK by using the source code, in-tree.
<!-- Do not copy for source build, should already be in-tree --> | ||
<Copy Condition="'$(DotNetBuildSourceOnly)' != 'true'" | ||
SourceFiles="@(SourceManifestContent)" | ||
DestinationFolder="sdk-manifests/%(DestinationPath)" | ||
SkipUnchangedFiles="true" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for convenience of someone updating the manifests (likely me). We could put it behind a property like -p:UpdateManifestSources=true
, if we are concerned about this running.
008916f
to
6ffb23a
Compare
cc @dotnet/source-build-internal this change updates the source-built SDK - does running the build script with |
No it won't. You need the sdk tarball that is produced from the sdk-source-build leg. |
Ok, it seems to be working, I tested in a GitHub codespace:
|
@MichaelSimons there is an error like:
Can that be fixed in this repo? |
eng/SourceBuildPrebuiltBaseline.xml
Outdated
@@ -7,6 +7,9 @@ | |||
<UsagePattern IdentityGlob="Nuget.*/*" /> | |||
<UsagePattern IdentityGlob="Microsoft.Build.NuGetSdkResolver/*" /> | |||
|
|||
<!-- Sources for this package are included in-repo --> | |||
<UsagePattern IdentityGlob="Microsoft.NET.Sdk.Android.Manifest-*/*" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should be added here. If it is in this repo, then it shouldn't be detected as a prebuilt. I suspect something isn't working as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does it "find" prebuilts? Would <PackageDownload Include="Foo" Version="[1.0.0]"/>
trigger this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More often than not, prebuilts are caused by package references & transitive dependencies. Technically, any package used in the build that is not built from source is a prebuilt, so it makes sense that a download dependency would cause a prebuilt, but this is the first time I've seen a package download cause a prebuilt.
src/Installer/redist-installer/targets/BundledManifests.targets
Outdated
Show resolved
Hide resolved
Co-authored-by: Michael Simons <msimons@microsoft.com>
@@ -31,12 +31,14 @@ | |||
<RestoredNupkgContentPath>$(NuGetPackageRoot)$([MSBuild]::ValueOrDefault('%(NupkgId)', '').ToLower())/$([MSBuild]::ValueOrDefault('%(Version)', '').ToLower())</RestoredNupkgContentPath> | |||
<MsiNupkgId>%(Identity).Manifest-%(FeatureBand).Msi.$(MsiArchitectureForWorkloadManifests)</MsiNupkgId> | |||
<RestoredMsiNupkgContentPath>$(NuGetPackageRoot)$([MSBuild]::ValueOrDefault('%(MsiNupkgId)', '').ToLower())/$([MSBuild]::ValueOrDefault('%(Version)', '').ToLower())</RestoredMsiNupkgContentPath> | |||
<IncludedInSource Condition="'%(IncludedInSource)' == ''">false</IncludedInSource> | |||
<PackageDownload Condition="'$(DotNetBuildSourceOnly)' != 'true' or '%(IncludedInSource)' != 'true'">true</PackageDownload> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to not specialize this for source-build? e.g. the MSFT build would also use the version from the SDK repo. It is best to avoid unnecessary differences between the two builds. Keeping them the same helps flush out issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can rework this to use a property like -p:UpdateManifestSources=true
, and then it wouldn't need to ever check $(DotNetBuildSourceOnly)
. Someone would only set this property when updating the manifest sources.
Is the build green (or need a rerun)? I don't think I've seen it fully green yet, so just wondering if it works before I refactor it. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think this got past the pre-built errors now, but some of the smoke tests run into:
System.InvalidOperationException : Failed to execute /vmr/artifacts/bin/Microsoft.DotNet.SourceBuild.SmokeTests/Release/extracted-sdk/dotnet test /bl:/vmr/artifacts/TestResults/Release/BasicScenarioTests_MSTest_CSharp-test.binlog
Exit code: 1
/vmr/artifacts/bin/Microsoft.DotNet.SourceBuild.SmokeTests/Release/projects-202407231701323151/BasicScenarioTests_MSTest_CSharp/BasicScenarioTests_MSTest_CSharp.csproj : error MSB4242: SDK Resolver Failure: "The SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" failed while attempting to resolve the SDK "MSTest.Sdk/3.4.3". Exception: "System.IO.FileNotFoundException: Workload manifest microsoft.net.sdk.android: 34.99.0-preview.6.340/9.0.100-preview.6 from workload version 9.0.100-preview.7.24373.1 was not installed. Running "dotnet workload repair" may resolve this.
/vmr/artifacts/bin/Microsoft.DotNet.SourceBuild.SmokeTests/Release/projects-202407231701323151/BasicScenarioTests_MSTest_CSharp/BasicScenarioTests_MSTest_CSharp.csproj : error MSB4242: at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.GetManifests()
/vmr/artifacts/bin/Microsoft.DotNet.SourceBuild.SmokeTests/Release/projects-202407231701323151/BasicScenarioTests_MSTest_CSharp/BasicScenarioTests_MSTest_CSharp.csproj : error MSB4242: at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.LoadManifestsFromProvider(IWorkloadManifestProvider manifestProvider)
/vmr/artifacts/bin/Microsoft.DotNet.SourceBuild.SmokeTests/Release/projects-202407231701323151/BasicScenarioTests_MSTest_CSharp/BasicScenarioTests_MSTest_CSharp.csproj : error MSB4242: at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.InitializeManifests()
/vmr/artifacts/bin/Microsoft.DotNet.SourceBuild.SmokeTests/Release/projects-202407231701323151/BasicScenarioTests_MSTest_CSharp/BasicScenarioTests_MSTest_CSharp.csproj : error MSB4242: at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.TryGetPackInfo(WorkloadPackId packId)
/vmr/artifacts/bin/Microsoft.DotNet.SourceBuild.SmokeTests/Release/projects-202407231701323151/BasicScenarioTests_MSTest_CSharp/BasicScenarioTests_MSTest_CSharp.csproj : error MSB4242: at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.CachingWorkloadResolver.Resolve(String sdkReferenceName, IWorkloadManifestProvider manifestProvider, IWorkloadResolver workloadResolver)
/vmr/artifacts/bin/Microsoft.DotNet.SourceBuild.SmokeTests/Release/projects-202407231701323151/BasicScenarioTests_MSTest_CSharp/BasicScenarioTests_MSTest_CSharp.csproj : error MSB4242: at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.CachingWorkloadResolver.Resolve(String sdkReferenceName, String dotnetRootPath, String sdkVersion, String userProfileDir, String globalJsonPath)
/vmr/artifacts/bin/Microsoft.DotNet.SourceBuild.SmokeTests/Release/projects-202407231701323151/BasicScenarioTests_MSTest_CSharp/BasicScenarioTests_MSTest_CSharp.csproj : error MSB4242: at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.WorkloadSdkResolver.Resolve(SdkReference sdkReference, SdkResolverContext resolverContext, SdkResultFactory factory)
/vmr/artifacts/bin/Microsoft.DotNet.SourceBuild.SmokeTests/Release/projects-202407231701323151/BasicScenarioTests_MSTest_CSharp/BasicScenarioTests_MSTest_CSharp.csproj : error MSB4242: at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.TryResolveSdkUsingSpecifiedResolvers(IReadOnlyList`1 resolvers, Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio, SdkResult& sdkResult, IEnumerable`1& errors, IEnumerable`1& warnings)""
I'll see if I can reproduce this on GitHub codespaces.
@jonathanpeppers, is this something that is still in scope for 9.0? |
@MichaelSimons yes, unfortunately I've had to focus on other things for a bit. Linux support is just lower on the list than anything else, but we'd still like to complete this at some point. Maybe if this doesn't make RC 2, we do it for .NET 10? |
Thanks, if you need help diagnosing source-build related failures, let me know and I can help. |
Context: dotnet/source-build#3242
If using a source-built .NET SDK, the Android workload manifests are
not included in the SDK. So, you won't see
android
workload when yourun
dotnet workload search
.The Android workload, in general, contains private sources, but the
manifest files are completely public.
In the long run, we could consider onboarding dotnet/android to:
But the prerequisites would be to first have the Android workload
onboard to arcade:
For now, we could include the Android workload in source-build by:
Add a step that copies the Android workload manifests source code
in-tree (to be used when updating manifests).
Commit the manifest sources.
Source-build will then include the Android workload manifests in
the SDK by using the source code, in-tree.