Skip to content

Remove deprecated engine code #8826

@danmoseley

Description

@danmoseley

Backward compatibility note

Please use Visual Studio version 17.12 and lower to upgrade pre-msbuild project format.

Context

About 15 years ago a new MSBuild engine and API was created and the previous code was deprecated with very high servicing bar.
Keeping the code around (and publishing the packages) is a nontrivial liability especially as we try to model and improve our security.

Business justification

Maintanance cost

  • Slashing significant portion of the code that is kept in repository, translated into the production binaries and hence having some form of support/maintanance cost. The LoC proportion of production code (excluding tests) targetting to be removed: 39% (76k/272k)
  • Removing the legacy binaries that we'd otherwise need to security-fix

Engineering culture

  • Improving engineering efficiency - the deprecated code had duplicated and diverging code - so IDE and GH code searching often returns multitude of irrelevant results. There were cases of engineers accidentaly editing the functionality in the deprecated engine instead of in the new one.
  • Community friendliness - our code base will be more lightweight and understandable

Risks

External customers breaking

The packages are published on nuget (Microsoft.Build.Engine, Microsoft.Build.Conversion.Core) with nontrivial download count.

Mitigation(s):

  • Early 2022 a readme for nuget.org landing page for the 2 packages was added explicitly warning the users the package is deprecated and they should move to the new API.
  • The entrypoint classes of the API have been marked as obsolete decade ago, with information about the new API. The notice is exposed on learn.microsoft page: https://learn.microsoft.com/en-us/dotnet/api/microsoft.build.buildengine.engine
  • In 17.11 we added xml doc comments to all members of the public surface of the deprecated packages and the notices are being propagated to learn.microsoft page
  • We'll eventually stop publishing new versions of the package (likely with 17.12 or beyond) - sending a signal that the package is not maintained anymore
  • We might choose to add a vulnerability metadata (or even backfill on already published packages) to make the message even more explicit

Internal customers breaking

We have identified 7 groups of usages accross partner teams:

  • 2 usages in VS legacy project upgrade wizards
  • 4 usages accross the VS codebase in various components and tooling
  • 1 usage in project sytstem tools VS extension

Mitigation(s):

Close cooperation with all affected partner teams:

  • Had the dead code removed (3 cases)
  • Helping them to onboard to a new API (2 cases)
  • Agreeing and documenting breaking change (2 cases) - discontinuing support for upgrading .NET 1.0 and older (pre-MSBuild) project files

Course of action

Removal PRs:

After actions

Background - Original ticket content

This was deprecated about 15 years ago and changes have long been at a high servicing bar. Can the code be removed from main now and serviced out of older branches? (This is done in runtime repo for some packages.) This would simplify the repo, speed up build and tests, and reduce risk of inadvertent changes to it. Likely it would make it easier to switch on new analyzers and warnings in the repo as the old code wouldn't need to be excluded.

Metadata

Metadata

Assignees

Labels

Area: EngineIssues impacting the core execution of targets and tasks.Priority:2Work that is important, but not critical for the releasebacklogtriaged

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions