8000 Remove VMR inner-build concept by ViktorHofer · Pull Request #176 · dotnet/dotnet · GitHub
[go: up one dir, main page]

Skip to content

Remove VMR inner-build concept #176

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

Merged
merged 2 commits into from 8000
May 6, 2025
Merged

Remove VMR inner-build concept #176

merged 2 commits into from
May 6, 2025

Conversation

ViktorHofer
Copy link
Member
@ViktorHofer ViktorHofer commented Apr 10, 2025

Fixes dotnet/source-build#4249
Fixes dotnet/source-build#3789
Fixes dotnet/source-build#3807
Fixes dotnet/source-build#4184
Fixes dotnet/source-build#4444
Fixes dotnet/source-build#5135

  1. Remove the outer/inner-build concept for SB & UB. A repo's DotNetBuild.props file doesn't get imported anymore when using an Arcade SDK with this change.
  2. Move runtime's DotNetBuild.props in runtime.proj in the VMR. Most of the content became unnecessary as we don't need to pass through args anymore with the inner build removal.
  3. Remove the DotNetBuildInnerRepo and DotNetBuildPhase properties and replace its usage with the now only two inclusive properties. Update docs.
  4. Remove now unnecessary DotNetBuild.props files (runtime, aspnetcore, nuget-client, source-build-externals). The remaining DotNetBuild.props files are for repos that are still on Arcade 9 (tooling repos).
  5. Make the PrebuiltUsage an opt-in feature in the Arcade.Sdk (defaults to true for source-build) and untie it from the source-build infra so that it can be enabled for all kinds of builds.

Extra work for which I will submitted separate PRs:


Official build: https://dev.azure.com/dnceng/internal/_build/results?buildId=2702751&view=results (the previous official build was already green)

@ViktorHofer ViktorHofer force-pushed the RemoveInnerBuildConcept branch 9 times, most recently from 632b15f to 49725e3 Compare April 10, 2025 20:27
@ViktorHofer ViktorHofer force-pushed the RemoveInnerBuildConcept branch 3 times, most recently from 754095a to 28af55e Compare April 10, 2025 22:11
@ViktorHofer ViktorHofer force-pushed the RemoveInnerBuildConcept branch 16 times, most recently from a2c3bc4 to 609c8c6 Compare April 14, 2025 20:21
ViktorHofer added a commit to dotnet/roslyn that referenced this pull request May 3, 2025
Extracted from dotnet/dotnet#176

The above PR removes the DotNetBuild.props VMR / SB entrypoint. All settings will move into the repo infra.

The RestoreUseStaticGraphEvaluation property needs to be set before Arcade's Build.proj builds the solution and in the repo infra so that dotnet/msbuild/NuGet commands use that restore mode. Therefore, also define it in eng/Build.props which is imported by Build.proj and remove the prop from the build scripts.

Move the DotNetBuild condition inline into the two places that now set it.
ViktorHofer added a commit to dotnet/roslyn that referenced this pull request May 5, 2025
* Move RestoreUseStaticGraphEvaluation setting inside repo

Extracted from dotnet/dotnet#176

The above PR removes the DotNetBuild.props VMR / SB entrypoint. All settings will move into the repo infra.

The RestoreUseStaticGraphEvaluation property needs to be set before Arcade's Build.proj builds the solution and in the repo infra so that dotnet/msbuild/NuGet commands use that restore mode. Therefore, also define it in eng/Build.props which is imported by Build.proj and remove the prop from the build scripts.

Move the DotNetBuild condition inline into the two places that now set it.

* Fixes and PR feedback

* Add D.Solution.props to make restore consistent

* Add condition and update comment

* try a workaround

* Revert change in editorfeatures project
@ViktorHofer ViktorHofer force-pushed the RemoveInnerBuildConcept branch 2 times, most recently from 2e69dfd to fb59d8c Compare May 5, 2025 20:11
@ViktorHofer ViktorHofer marked this pull request as ready for review May 5, 2025 20:14
@ViktorHofer ViktorHofer requested review from a team as code owners May 5, 2025 20:14
@ViktorHofer ViktorHofer changed the title [WIP] [NO-REVIEW] [NO-MERGE] Remove VMR inner-build concept Remove VMR inner-build concept May 5, 2025
1. Remove the repo source-build infrastructure:
   - The outer/inner-build concept
   - The SB intermediate package creation
2. Remove the DotNetBuildPhase property and replace its usage with
   the now only two inclusive properties. Update docs.
3. Move the ArPow inner clone target into the VMR orchestrator and
   integrate it into the repo infra (still conditional only for SBE).
4. Move the ArPow target that handles creating the
   package usage data and the package report into the VMR orchestrator
5. Update the remaining DotNetBuild.props files with the new property,
   item and target names.

Extra work:
- Move the `WritePrebuiltUsageData` and `ReportPrebuiltUsage` targets
  that were executed only for dotnet.proj into finish-source-only.proj
  to better distinguish them from the newly added ArPow targets that
  got moved into the VMR orchestrator.
- Place the "prebuilt-report" logs under "artifacts\log\<config>\"
  and avoid the now unnecessary copy step in the YML.
- Remove unnecessary SourceBuild.props / DotNetBuild.props which
  only contained properties that were used for repo source-build.
- Rename the remaining few SourceBuild.props to DotNetBuild.props
@ViktorHofer ViktorHofer force-pushed the RemoveInnerBuildConcept branch from fb59d8c to 23e4c42 Compare May 5, 2025 21:10
Copy link
Member
@akoeplinger akoeplinger left a comment

Choose a reason for hiding this comment

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

LGTM, most of my comments are non-blocking except the one in src/arcade/eng/common/core-templates/steps/source-build.yml

<BuildArgs Condition="'$(MonoAOTEnableLLVM)' != ''">$(BuildArgs) /p:MonoAOTEnableLLVM=$(MonoAOTEnableLLVM)</BuildArgs>
<BuildArgs Condition="'$(MonoBundleLLVMOptimizer)' != ''">$(BuildArgs) /p:MonoBundleLLVMOptimizer=$(MonoBundleLLVMOptimizer)</BuildArgs>
<BuildArgs Condition="'$(PgoInstrument)' == 'true'">$(BuildArgs) $(FlagParameterPrefix)pgoinstrument</BuildArgs>
<!-- TODO: This parameter is only available on the Unix script. Intentional? -->
Copy link
Member

Choose a reason for hiding this comment

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

can you file an issue for this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

--outputrid is runtime's name for TargetRid. I assume it is historically not set on Windows because there only portable rids are built and the runtime can infer those.

We could pass this on Windows as well (and deal with the fallout if there is any).

Copy link
Member Author
@ViktorHofer ViktorHofer May 6, 2025
10000

Choose a reason for hiding this comment

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

The VMR already passes TargetRid in to all inner repos:

<CommonArgs>$(CommonArgs) /p:TargetRid=$(TargetRid)</CommonArgs>

So runtime already receives it. Maybe we just need to consolidate on TargetRid and remove OutputRid (ideally with the switch if it isn't needed)?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, we should consolidate on TargetRid.

Copy link
Member Author

Choose a reason for hiding this comment

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

@tmds do you want to give that a try? You could submit your first real VMR PR and I can help with the validation :)

Copy link
Member

Choose a reason for hiding this comment

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

It's on my TODO list. If someone beats me to it, that's fine.


<BuildArgs Condition="'$(UseSystemLibs)' != ''">$(BuildArgs) /p:UseSystemLibs=$(UseSystemLibs)</BuildArgs>
<!-- Source-build will use non-portable RIDs. To build for these non-portable RID scenarios, we must do a boostrapped build. -->
<BuildArgs Condition="'$(DotNetBuildSourceOnly)' == 'true' and '$(DotNetBuildUseMonoRuntime)' != 'true'">$(BuildArgs) --bootstrap</BuildArgs>
Copy link
Member

Choose a reason for hiding this comment

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

we don't need a bootstrap build for mono because it doesn't execute tools like ilc during the build in that case right? might be worth a comment, or handle/ignore this in the bootstrap script itself so we don't need to have this knowledge here

Copy link
Member Author

Choose a reason for hiding this comment

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

<!-- TODO: LinuxTracepoints -->
<BuildArgs Condition="$(UseSystemLibs.Contains('+rapidjson'))">$(BuildArgs) --cmakeargs -DCLR_CMAKE_USE_SYSTEM_RAPIDJSON=true</BuildArgs>
<BuildArgs Condition="$(UseSystemLibs.Contains('+zlib'))">$(BuildArgs) --cmakeargs -DCLR_CMAKE_USE_SYSTEM_ZLIB=true</BuildArgs>
<BuildArgs Condition="$(UseSystemLibs.Contains('-lttng'))">$(BuildArgs) /p:FeatureXplatEventSource=false</BuildArgs>
Copy link
Member

Choose a reason for hiding this comment

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

this should probably be

Suggested change
<BuildArgs Condition="$(UseSystemLibs.Contains('-lttng'))">$(BuildArgs) /p:FeatureXplatEventSource=false</BuildArgs>
<BuildArgs Condition="$(UseSystemLibs.Contains('+lttng'))">$(BuildArgs) /p:FeatureXplatEventSource=false</BuildArgs>

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

This is meant to be '-' (minus) for not using lttng.

@ViktorHofer
Copy link
Member Author
ViktorHofer commented May 6, 2025

Talked with @akoeplinger offline. I will address the feedback in a follow-up: #397

@ViktorHofer ViktorHofer merged commit 2774010 into main May 6, 2025
11 checks passed
@ViktorHofer ViktorHofer deleted the RemoveInnerBuildConcept branch May 6, 2025 09:37
attempts as the install script walks through potential locations for a runtime.
The overall build script will return a proper exit code, but we don't want to pick up the printed error messages. -->
<Exec
Command="./eng/build.sh --only-build-repo-tasks -bl $(_AdditionalRepoTaskBuildArgs) $(InnerBuildArgs)"
Copy link
Member

Choose a reason for hiding this comment

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

@wtgodbe - IIRC this option was added to support this scenario. If that is the case perhaps this option should be cleaned up to help simplify the script. I'll let you follow-up as necessary.

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.

Thanks for getting this done. A big UX improvement.

ViktorHofer added a commit that referenced this pull request May 7, 2025
Follow-up on #176

Also noticed that the YML was wrong. I tested the change in SBRP and the syntax now works.

Rename PrebuiltUsage to TrackPrebuiltUsage property names and the file itself.

Fix the NuGetPackageRoot cache defines in RepoLayout.props. They need to be in sync with the ones in tools.sh / tools.ps1.
Source-only builds should use the repo local cache unless the NUGET_PACKAGES env var is explicitly set.
@ViktorHofer
Copy link
Member Author

Here's the follow-up PR: #423

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants
0