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

[Breaking change]: Source Link is included in the .NET SDK #37674

Closed
1 of 3 tasks
baronfel opened this issue Oct 23, 2023 · 4 comments · Fixed by #37982
Closed
1 of 3 tasks

[Breaking change]: Source Link is included in the .NET SDK #37674

baronfel opened this issue Oct 23, 2023 · 4 comments · Fixed by #37982
Assignees
Labels
breaking-change Indicates a .NET Core breaking change 🏁 Release: .NET 8 Work items for the .NET 8 release 📌 seQUESTered Identifies that an issue has been imported into Quest. source incompatible Source code may encounter a breaking change in behavior when targeting the new version.

Comments

@baronfel
Copy link
Member

baronfel commented Oct 23, 2023

Description

The Source Link build tooling is included in the .NET SDK as of .NET SDK 8.0.100-preview.4, which enables packages and applications to embed information about the source control information of the built artifacts. As a side effect, by default commit information will be included in the InformationalVersion of build libraries and applications.

Version

.NET 8 Preview 6

Previous behavior

Prior to this change, the default InformationalVersion of a library or application would be the Version property.

New behavior

After this change, the default InformationalVersion of a library or application would be the Version property as well as the SourceRevisionId property.

Type of breaking change

  • Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
  • Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code may require source changes to compile successfully.
  • Behavioral change: Existing binaries may behave differently at run time.

Reason for change

Source Link enables very rich editor tooling, like go-to-definition support for non-local source files. We think this benefit is worth including by default for all artifacts.

Recommended action

If your build process or code is not expecting Source Revision information in the InformationalVersion, you can disable this behavior by setting the IncludeSourceRevisionInInformationalVersion property to false.

Feature area

SDK

Affected APIs

No response


Associated WorkItem - 177280

@rainersigwald
Copy link
Member

@baronfel isn't this "source incompatible" rather than "behavior change"? Existing binaries don't change behavior but updating the SDK and rebuilding can change a version string.

@gewarren gewarren added the 🗺️ reQUEST Triggers an issue to be imported into Quest. label Oct 31, 2023
@dotnet-bot dotnet-bot added the source incompatible Source code may encounter a breaking change in behavior when targeting the new version. label Oct 31, 2023
@github-actions github-actions bot added 📌 seQUESTered Identifies that an issue has been imported into Quest. and removed 🗺️ reQUEST Triggers an issue to be imported into Quest. labels Nov 1, 2023
@gewarren gewarren added the 🏁 Release: .NET 8 Work items for the .NET 8 release label Nov 2, 2023
arturcic added a commit to arturcic/GitVersion that referenced this issue Nov 5, 2023
The SDK version has been updated in the global.json file to "8.0.100-rc.2.23502.2", and additional properties such as "allowPrerelease" and "rollForward" have been set. In the BuildLifetime.cs file, a new property "IncludeSourceRevisionInInformationalVersion" has also been added to address a specific issue namely, 'dotnet/docs#37674'.
arturcic added a commit to arturcic/GitVersion that referenced this issue Nov 5, 2023
The SDK version has been updated in the global.json file to "8.0.100-rc.2.23502.2", and additional properties such as "allowPrerelease" and "rollForward" have been set. In the BuildLifetime.cs file, a new property "IncludeSourceRevisionInInformationalVersion" has also been added to address a specific issue namely, 'dotnet/docs#37674'.
arturcic added a commit to arturcic/GitVersion that referenced this issue Nov 6, 2023
The SDK version has been updated in the global.json file to "8.0.100-rc.2.23502.2", and additional properties such as "allowPrerelease" and "rollForward" have been set. In the BuildLifetime.cs file, a new property "IncludeSourceRevisionInInformationalVersion" has also been added to address a specific issue namely, 'dotnet/docs#37674'.
arturcic added a commit to arturcic/GitVersion that referenced this issue Nov 6, 2023
The SDK version has been updated in the global.json file to "8.0.100-rc.2.23502.2", and additional properties such as "allowPrerelease" and "rollForward" have been set. In the BuildLifetime.cs file, a new property "IncludeSourceRevisionInInformationalVersion" has also been added to address a specific issue namely, 'dotnet/docs#37674'.
arturcic added a commit to arturcic/GitVersion that referenced this issue Nov 6, 2023
Upgraded the Target Framework Moniker (TFM) from net7.0 to net8.0 in multiple configurations, project files, and script files. This includes modifying the task arguments, project configurations, constants, and GitHub workflows to reflect the changes made to accommodate the new net8.0 framework.

The SDK version has been updated in the global.json file to "8.0.100-rc.2.23502.2", and additional properties such as "allowPrerelease" and "rollForward" have been set. In the BuildLifetime.cs file, a new property "IncludeSourceRevisionInInformationalVersion" has also been added to address a specific issue namely, 'dotnet/docs#37674'.
arturcic added a commit to arturcic/GitVersion that referenced this issue Nov 6, 2023
Upgraded the Target Framework Moniker (TFM) from net7.0 to net8.0 in multiple configurations, project files, and script files. This includes modifying the task arguments, project configurations, constants, and GitHub workflows to reflect the changes made to accommodate the new net8.0 framework.

The SDK version has been updated in the global.json file to "8.0.100-rc.2.23502.2", and additional properties such as "allowPrerelease" and "rollForward" have been set. In the BuildLifetime.cs file, a new property "IncludeSourceRevisionInInformationalVersion" has also been added to address a specific issue namely, 'dotnet/docs#37674'.
arturcic added a commit to arturcic/GitVersion that referenced this issue Nov 6, 2023
Upgraded the Target Framework Moniker (TFM) from net7.0 to net8.0 in multiple configurations, project files, and script files. This includes modifying the task arguments, project configurations, constants, and GitHub workflows to reflect the changes made to accommodate the new net8.0 framework.

The SDK version has been updated in the global.json file to "8.0.100-rc.2.23502.2", and additional properties such as "allowPrerelease" and "rollForward" have been set. In the BuildLifetime.cs file, a new property "IncludeSourceRevisionInInformationalVersion" has also been added to address a specific issue namely, 'dotnet/docs#37674'.
arturcic added a commit to arturcic/GitVersion that referenced this issue Nov 6, 2023
Upgraded the Target Framework Moniker (TFM) from net7.0 to net8.0 in multiple configurations, project files, and script files. This includes modifying the task arguments, project configurations, constants, and GitHub workflows to reflect the changes made to accommodate the new net8.0 framework.

The SDK version has been updated in the global.json file to "8.0.100-rc.2.23502.2", and additional properties such as "allowPrerelease" and "rollForward" have been set. In the BuildLifetime.cs file, a new property "IncludeSourceRevisionInInformationalVersion" has also been added to address a specific issue namely, 'dotnet/docs#37674'.
arturcic added a commit to arturcic/GitVersion that referenced this issue Nov 6, 2023
Upgraded the Target Framework Moniker (TFM) from net7.0 to net8.0 in multiple configurations, project files, and script files. This includes modifying the task arguments, project configurations, constants, and GitHub workflows to reflect the changes made to accommodate the new net8.0 framework.

The SDK version has been updated in the global.json file to "8.0.100-rc.2.23502.2", and additional properties such as "allowPrerelease" and "rollForward" have been set. In the BuildLifetime.cs file, a new property "IncludeSourceRevisionInInformationalVersion" has also been added to address a specific issue namely, 'dotnet/docs#37674'.
@ghost ghost added the in-pr This issue will be closed (fixed) by an active pull request. label Nov 8, 2023
@gewarren gewarren moved this from 🔖 Ready to 👀 In review in dotnet/docs November 2023 sprint Nov 8, 2023
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in dotnet/docs November 2023 sprint Nov 8, 2023
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in .NET 8.0 work items Nov 8, 2023
@ghost ghost removed the in-pr This issue will be closed (fixed) by an active pull request. label Nov 8, 2023
@DalekBaldwin
Copy link

It would help to also document the SuppressImplicitGitSourceLink property. As it is now, in a repo with no mention of SourceLink, after you execute git commands that should leave up-to-dateness unchanged, net8.0 considers all projects to be marked for rebuilding.

@adurmus
Copy link

adurmus commented Dec 20, 2023

Imagine your CI/CD relies on Product Version. Suddenly whole CI/CD operations fail because the ProductVersion cannot be parsed anymore with System.Version. Well done.

@Vermis0
Copy link

Vermis0 commented Jan 18, 2024

This also affects calls to these methods (possibly others) since they are using the ProductVersion as part of the path ("Base Path\CompanyName\ProductName\ProductVersion"):

System.Windows.Forms.Application.UserAppDataPath
System.Windows.Forms.Application.LocalUserAppDataPath
System.Windows.Forms.Application.UserAppDataRegistry

Having the data paths change after every commit instead of when the version was changed was unexpected behavior and disruptive during active development. I don't imagine a typical developer will expect to "lose" their user data on next application launch/debug just by committing a code change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Indicates a .NET Core breaking change 🏁 Release: .NET 8 Work items for the .NET 8 release 📌 seQUESTered Identifies that an issue has been imported into Quest. source incompatible Source code may encounter a breaking change in behavior when targeting the new version.
Projects
No open projects
Status: Done
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

7 participants