Skip to content

Create full PlatformManifest.txt in "live-live" dotnet/runtime builds #1362

Closed
@dagood

Description

@dagood

The platform manifest is a text file that describes the files in every platform's shared framework. The SDK uses it to filter FDE/FDD publish outputs. The manifest ends up in the targeting pack and runtime packs, at data\PlatformManifest.txt. A little example of the contents:

mscorlib.dll|Microsoft.NETCore.App.Ref|4.0.0.0|4.700.19.46214
System.IO.Compression.Native.a|Microsoft.NETCore.App.Ref||0.0.0.0
System.IO.Compression.Native.so|Microsoft.NETCore.App.Ref||0.0.0.0
...
libcoreclr.so|Microsoft.NETCore.App.Ref||0.0.0.0
...
libcoreclr.dylib|Microsoft.NETCore.App.Ref||0.0.0.0
...
api-ms-win-crt-utility-l1-1-0.dll|Microsoft.NETCore.App.Ref||10.0.17134.12
...
coreclr.dll|Microsoft.NETCore.App.Ref||4.700.19.46205
...

Note that coreclr.dll/libcoreclr.so/libcoreclr.dylib are all listed: each platform's native binary. This list and data is harvested from the actual files, so multiple machines are necessarily involved.

The consolidation effort (dotnet/runtime) is going to be building "live-live" builds: builds that take place on a single machine all the way through coreclr, corefx, and core-setup. It won't rely on cached files built by an earlier run of the repo. This means we can't use the current approach, because it needs multiple machines to produce all the native artifacts.


I think we need to stop using harvesting to populate this file, and instead calculate the contents. We probably need to keep a platform manifest template (list of files) in the source to act as a template.

This would normally be a maintenance hazard, but we can prevent that:

  1. Each platform uses the template to generate an expected platform manifest, which is used when building targeting packs, runtime packs, installers, etc.
  2. When running a platform-specific job, validate:
    • All sharedfx files generated on that platform are in the manifest template.
    • There are no files in the template that are expected to be built on the current platform but weren't.
  3. By the time any CI/PR validation build ends, all platforms have run the validation step. This means that if all jobs succeed, we know the platform manifest is valid. Even if some platforms silently produced bad platform manifests, the build would fail overall.
  4. Since official builds stop if some jobs failed, there is no risk of releasing an outdated platform manifest.

This does impact dev flows. Someone may add a new file to the shared framework and not know how to properly update the manifest template. To mitigate this, when the validation step fails, it should emit the corrected list of files and tell devs where they need to put it to fix up their PR.

This also fixes source-build, where there are even more constraints than "live-live" builds: https://github.com/dotnet/core-setup/issues/5297. (The platform manifest is already broken for source-build even without consolidation.)

Here are some other options I considered that I don't think are viable (especially short-term) and don't fix source-build. (Click me)
  1. Have a "fan in" stage in the dotnet/runtime official build.

    • The new stage would download the pipeline artifacts from all the platform builds and harvest the platform manifest. It would then produce the artifacts the manifest is included in. This stage would have its own matrix of platforms to fan back out, because the platform manifest is included in some installers, and installers can only be built on the target platform.
    • This is not easily reproducible on dev machines, and pinches the build down to a choke point which could prevent build time improvements.
  2. Defer the harvest to downstream.

    • We can skip producing the platform manifest in dotnet/runtime, and instead make it in a downstream repo that isn't in the "live live" build. The downstream repo needs to download dotnet/runtime artifacts anyway, so there's no problem with harvesting from multiple platforms.
    • Lots of downstream effects depending on how exactly this is split out.
  3. Eliminate the need for a platform manifest file.

    • I don't see how to do this, but if we can, it's an option. The platform manifest can be thought of as a performance improvement: instead of downloading every single runtime pack to check what files they contain, this text file in targeting pack is used.
    • A major caveat for some ways of doing this is that the targeting pack version matches the runtime pack version. We can't simply have the SDK generate and contain a platform manifest, because the SDK needs to be able to target downlevel runtimes.

I think I should work on this, and in the meantime I think it's reasonable to disable "full" platform manifest generation (set BuildFullPlatformManifest to false) to unblock dotnet/runtime "live live" builds.

/cc @MichaelSimons @dleeapho @jkoritzinsky @jashook @dseefeld @crummel @NikolaMilosavljevic @adaggarwal

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions