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

Enable Windows Build in the VMR #18214

Merged
merged 22 commits into from
Jan 12, 2024
Merged

Enable Windows Build in the VMR #18214

merged 22 commits into from
Jan 12, 2024

Conversation

ViktorHofer
Copy link
Member

@ViktorHofer ViktorHofer commented Jan 11, 2024

Contributes to dotnet/source-build#3706, dotnet/source-build#3786, dotnet/source-build#2974
Fixes dotnet/source-build#3677, dotnet/source-build#3682, dotnet/source-build#3783

Code comes from dotnet/dotnet#46. I didn't port all commits over as many of those don't make sense anymore and cleaning them up would have been too much work. Instead I brought the changes over and then grouped them into logical units.

Validation: CI & locally (Stage 1 and stage 2 builds succeeded locally on Ubuntu 22.04 with node 20.x installed)


Important for reviewers: The following changes are really hard to review and I suggest to skip them:

  • Directory.Build.props
  • eng/build.sourcebuild.targets (contains the source build specific code from build.proj without any significant changes aside from clean-up)
  • repo-projects/Directory.Build.props
  • repo-projects/Directory.Build.targets

To summarize changes in those files:

  1. Define central root properties for OS and Architecture: BuildOS, HostOS, TargetOS, BuildArchitecture, HostArchitecture and TargetArchitecture.
  2. Remove dead properties, items, targets and env vars and a lot of general msbuild clean-up. Move properties into the actual places where they are needed instead of having everything in the root Directory.Build.props.
  3. For the projects that don't import the Arcade.Sdk, define the properties that are needed (i.e. NetCurrent, ArtifactsDir, RepositoryEngineeringDir, RepoRoot and a few others with clear markers that this code should be kept in sync with what's in the Arcade.Sdk). This makes the artifacts output path the same as in other Arcadified repositories, without using the Arcade.Sdk itself for some projects. We follow that exact same approach in other repos like runtime.
  4. Rewrite the inner build command properties for The default source build command script should be eng/common/build.* source-build#3783 and to remove a lot of unnecessary complexity in the current properties.
  5. Make the msbuild sdk resolver custom code more understandable and better grouped together.

Kudos to @mmitche who is the co-author of these changes.

@ViktorHofer ViktorHofer changed the title Initial commit Enable Windows Build in the VMR Jan 11, 2024
... and simplify the Arcade Build.props extension point.

Move the build.proj source build logic into an extra targets file
so that infrastructure can be conditioned and then imported once.
... and set default properties that are true for source-build.
…ization)

... in Directory.Build.props and Directory.Build.targets in the repo root
and under repo-projects
@ViktorHofer ViktorHofer marked this pull request as ready for review January 11, 2024 19:20
@ViktorHofer ViktorHofer requested a review from a team as a code owner January 11, 2024 19:20
Copy link
Member

@MichaelSimons MichaelSimons left a comment

Choose a reason for hiding this comment

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

Lots of nice clean-up - thanks. IMO it would have been a lot easier to review and you would get better feedback had this been split apart into more incremental PRs.

My main feedback/question is the use of previous source-build artifacts in non-source-only builds. IMO we should be building with the previous artifacts all of the time.

Have you validated an offline build? After seeing the changes, I feel like this is warranted.

src/SourceBuild/content/build.sh Show resolved Hide resolved
src/SourceBuild/content/prep.sh Show resolved Hide resolved

<Target Name="UnpackTarballs"
Condition="'$(DotNetBuildFromSource)' == 'true'"
Copy link
Member

Choose a reason for hiding this comment

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

Why run this (and others like ExtractToolPackage) only running in source only builds? I was of the opinion all builds should be building with n-1. This helps ensure consistency across the build types.

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 talked about this with @mmitche offline. We believe that this requires a separate discussion as we don't see this as a goal for the UB effort right now. We don't have a separate "previously built from the VMR" registry aside from nuget.org and the SDK and it's not clear to us why we would want one. Condition this logic out for non source built is the tactical fix here to make progress on the non source built lanes. Let's have this discussion in our next sync meeting.

src/SourceBuild/content/Directory.Build.props Show resolved Hide resolved
<ArcadeBootstrapPackageDir Condition="'$(DotNetBuildFromSource)' == 'true'">$([MSBuild]::NormalizeDirectory('$(NuGetPackageRoot)', 'ArcadeBootstrapPackage'))</ArcadeBootstrapPackageDir>
<ArcadeBootstrapPackageDir Condition="'$(DotNetBuildFromSource)' != 'true'">$(NuGetPackageRoot)</ArcadeBootstrapPackageDir>

<!-- Collapsed output and intermediate path folders that are architecture and configuration specific. -->
Copy link
Member

Choose a reason for hiding this comment

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

I don't get the meaning of collapsed here. Can you help me understand?

Copy link
Member Author

@ViktorHofer ViktorHofer Jan 12, 2024

Choose a reason for hiding this comment

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

Maybe "flat" better transports the meaning? Collapsed here means that multiple projects/repos write into this folder. In msbuild, intermediate output and output paths exist and are isolated per project.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the explanation. flat doesn't help much IMO. Would shared make sense?

Copy link
Member

@mmitche mmitche left a comment

Choose a reason for hiding this comment

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

No major issues here. Some comments but nothing blocking

@ViktorHofer
Copy link
Member Author

ViktorHofer commented Jan 12, 2024

@MichaelSimons

Lots of nice clean-up - thanks. IMO it would have been a lot easier to review and you would get better feedback had this been split apart into more incremental PRs.

Thanks for the review and the points that you bring up. I will submit a follow-up to clean the things up that you and others mentioned and file issues for items that require more discussion or are entirely unrelated to this PR.

I tried to submit as many separate PRs as possible during the Windows PoC work (remember the random 10+ PRs that went into installer over the last weeks). Still, at some point I had to rely on previously established work from the PoC that wasn't easy to bring over without a large amount of work on my side (untangling those changes would have been very hard as we pushed ~200 commits).

That said, I'm quite happy with the review that I got and feel that the changes are well tested and reviewed.

Have you validated an offline build? After seeing the changes, I feel like this is warranted.

Yes I did a stage 1 and stage 2 built and both of those were offline builds.


As I didn't see any blocking feedback I'm going to merge this PR in now and will submit a follow-up change with clean-up and open tracking issues for other things that came up. Thanks everyone for the feedback.

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.

[VMR] [windows] DisplayDirSize* targets are not cross platform
4 participants