Skip to content
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

Local Live live builds #55

Closed
wants to merge 34 commits into from
Closed

Local Live live builds #55

wants to merge 34 commits into from

Conversation

jkoritzinsky
Copy link
Member

@jkoritzinsky jkoritzinsky commented Nov 15, 2019

This PR implements local live-live builds. The eng/liveBuilds.targets MSBuild file is the central location for live dependency file discovery. There are various MSBuild property hooks in there to enable overriding the location of the various consumed live components.

Work completed in this PR:

  • Libraries consumes:
    • A live copy of the CoreCLR build's shared framework and System.Private.CoreLib output.
  • Installer consumes:
    • A live copy of the CoreCLR build's shared framework and System.Private.CoreLib output
    • A live copy of the Libraries shared framework ref and implementation assemblies.
    • A live copy of Microsoft.NETCore.Platforms and Microsoft.NETCore.Targets
  • CoreCLR managed test build consumes:
    • A live copy of the Libraries shared framework and OOB ref assemblies.
  • CoreCLR Core_Root generation:
    • A live copy of the Libraries shared framework and OOB implementation assemblies.
  • Customization points for each "unit" of output that is consumed between subset categories.
  • Subset category dependencies will automatically rebuild only when their subset category is included in the current build. Otherwise the build will let you use out-of-date live builds.

This PR depends on:

Future work for another PR once we are off the critical path:

  • Refactor out target overrides in src/installer/pkg/projects/netcoreapp/src/localnetcoreapp.override.targets so we can send back a patch to Arcade and remove localnetcoreapp.override.targets.
  • Extend eng/liveBuilds.targets to have a target for consuming a live build of the hosting layer.
  • Consume a live build of the hosting layer in the CoreFX test build instead of consuming packages.

eng/liveBuilds.targets Outdated Show resolved Hide resolved
eng/liveBuilds.targets Outdated Show resolved Hide resolved
<Project>

<PropertyGroup>
<HostArch>$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant)</HostArch>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these static properties have to live in a targets file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The static properties don't have to. I just decided to keep them localized to where they're used. The path properties should be here since they depend on the configuration properties, which can be overridden in a subtree (libraries overrides them since there ConfigurationGroup represents what Configuration represents everywhere else).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer if they were in a target so they're truly localized. But without seeing an MSBuild style guide anywhere ever, I'm not going to claim consistency here or anything like that. No objection to merging.

@dagood
Copy link
Member

dagood commented Nov 15, 2019

Add an extensibility point to Arcade to force the required build ordering.

The way I do this in Core-Setup is with MSBuild tasks, nothing special. This is the same mechanism project references use. (When running an MSBuild task against the same project with the same properties from multiple projects, MSBuild only runs it once with safe parallelism and all that. This lets you build up the build graph with as fine-grained parallelism as you can stomach.)

To make one chunk of the build depend on another, I used <MSBuild Projects="@(CorehostProjectToBuild)" Targets="Build" />. That's why eng/Subsets.props is imported by the installer build.

@dagood
Copy link
Member

dagood commented Nov 15, 2019

I'm going to be flying tomorrow and very busy this weekend, so if you or others could help drive this closer to the finish line while I'm gone that would be fantastic!

Unfortunate timing... my team's boxing up stuff to be moved to another part of the building over the weekend so I won't have access to my main hardware. I'll try to make some progress on these two if I can manage with laptops:

  • Consume the live build of the files from Microsoft.NETCore.Platforms and Microsoft.NETCore.Targets in src/installer/pkg/projects/netcoreapp/src/netcoreapp.depproj
  • Add an extensibility point to Arcade to force the required build ordering.

("Refactor out changes to GetCrossgenToolPaths" doesn't sound necessary for the initial dotnet/runtime opening, I can help with that in the future.)

@jkotas
Copy link
Member

jkotas commented Nov 18, 2019

@jkotas jkotas mentioned this pull request Nov 18, 2019
@ViktorHofer ViktorHofer mentioned this pull request Nov 18, 2019
3 tasks
…ding a new BinplaceConfiguration. Update test_dependencies in the CoreCLR tree to use that to restore OOB libraries.
…he reference is only needed at runtime and Core_Root already has System.Drawing.Common).
…live world, we'll run this test configuration by pointing the CoreFX test host build step at the artifacts from a checked CoreCLR build (possible in both local and CI builds).
@jkoritzinsky
Copy link
Member Author

Update though today:

  • CoreCLR tests now populate Core_Root with a live libraries build including out-of-box libraries.
  • Live-live dependencies builds are done when their outputs are needed when their in-place output path (where the build is dropped in artifacts) is used as their location, their included in the currently building subset, and the dependency build hasn't been explicitly disabled (the CoreCLR test build disables it for now until that build is Arcade-ified).
  • The CoreCLR-specific infra for running CoreFX tests against a checked CoreCLR has been removed since we can now run the libraries tests against a live drop of checked CoreCLR. The CoreCLR-specific exludes in CoreFX.rsp will be covered via new attributes on the CoreFX tests that @safern has added to Arcade and will apply to the tests once we get the Arcade update.
  • Remove a dependency on an old package that contained the UCRT for the test build and replace it by copying the UCRT directly when targeting Windows.

@jkoritzinsky
Copy link
Member Author

This PR now has support for live builds of coreclr and libraries being consumed in both product and test builds for everything except the dependency of the legacy Microsoft.NETCore.App package on Microsoft.NETCore.Platforms on Windows. There are some issues I need to work out on non-Windows and I need to figure out how to get the version of the live Microsoft.NETCore.Platforms package for building the legacy Microsoft.NETCore.App package.

Any additional work past these pieces that is not documentation (ie consuming the live hosting layer in the CoreFX tests) will wait until a future PR since that is not on the critical path.

eng/liveBuilds.targets Outdated Show resolved Hide resolved
<PropertyGroup>
<CoreCLRArtifactsPath>$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)'))</CoreCLRArtifactsPath>
</PropertyGroup>
<PropertyGroup>
Copy link
Member

@ViktorHofer ViktorHofer Nov 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we merge these two property groups instead?

eng/liveBuilds.targets Outdated Show resolved Hide resolved
@@ -221,9 +234,18 @@
<ProjectAssetsFile></ProjectAssetsFile>
</PropertyGroup>

<PropertyGroup Condition="'$(ReferenceSystemPrivateCoreLib)' == 'true' and '$(UsingMicrosoftNETSdk)' == 'true'">
<PropertyGroup Condition="'$(UsingMicrosoftNETSdk)' == 'true'">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we actually need this remaining condition? Usually we just disable the property entirely without checking if we use an SDK which honors it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I can remove the remaining part of the condition

<!-- enable trimming for any runtime project that's part of the shared framework and hasn't already set ILLinkTrimAssembly -->
<SetProperties Condition="'$(BinPlaceRuntime)' == 'true' and '$(ILLinkTrimAssembly)' == ''">ILLinkTrimAssembly=true</SetProperties>
</BinPlaceConfiguration>

<!-- Binplace the OOB libraries built in the netcoreapp build. -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you instead just use the artifacts/bin/ref/netcoreapp and artifacts/bin/runtime/netcoreapp folders instead of binplacing new ones?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think to build coreclr tests we can use ref/netcoreapp and runtime/netcoreapp. That way we only binplace the inbox assemblies which are needed by the installer to produce the shared framework package.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I'm seeing, the artifacts/bin/runtime/netcoreapp folder has more than just the implementation assemblies. It looks like it has the restored runtime from the CoreCLR build as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can change that if necessary. We don't use those artifacts there.

Copy link
Member

@safern safern Nov 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. We just need to think about the ReferenceFromRuntime scenario as we special case it for S.P.CoreLib to take the assets from runtime.depproj output, however for all others we get them from runtime/netcoreapp

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point. I think we should treat CoreLib as part of libraries.

@ViktorHofer
Copy link
Member

Very impressive! Good work.

@jkoritzinsky jkoritzinsky changed the title WIP: Local Live live builds Local Live live builds Nov 21, 2019
@jkoritzinsky
Copy link
Member Author

Superseded by #494

@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
radical pushed a commit to radical/runtime that referenced this pull request Jul 7, 2022
)

Do not generate the hml per default. This is a feature for
xamarin-macios and has to be explicitly enabled.

fixes: dotnet#55

Co-authored-by: Premek Vysoky <premek.vysoky@microsoft.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants