-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Use the VMR commit hash for dotnet --info #41190
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
Conversation
Remove the logic that overrides the git commit info for each repo. Let each repo infer the VMR's git commit (via sourcelink). That will let the sdk, runtime, aspnetcore (and other) repos use the VMR's commit hash and show that in dotnet --info. This works for both when building the VMR directly in a git repository, as well as when building it from a git-archive tarball thanks to sourcelink's support for minimal git metadata [1]. This is a port of dotnet/installer#18941 to dotnet/sdk since the installer was merged into sdk. [1] https://github.com/dotnet/sourcelink/tree/main/docs#minimal-git-repository-metadata Fixes: dotnet/source-build#3643
This is a port of dotnet/installer#18941 Please see dotnet/installer#18941 (comment) for the last set of testing I did for this PR. I am happy to do any other testing that might help minimize the risk of this change. |
Looks good to me, I think given the .version files are updated in the shared frameworks we should be good. You could also disassemble the managed .dll's and check the AssemblyInformationalVersionAttribute, we embed the git sha there too (in previews).
Do I understand correctly that it won't work with the existing way we publish tarballs since they don't have |
Sorry I wasn't clearer. The short version is that this is all already working. There's nothing further that needs to be done. The longer version: When building from a tarball, it is required for the user to pass a dotnet/source-build#4290 only makes the source archive tarballs bit-by-bit identical (that is, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Just got around to it. I used this as to extract the version attribute: https://gist.github.com/omajid/c82f19c1850ac3349b3c1641fe214c4b Scanning all the .dll files in dotnet-sdk-bf3357462de7ef82156db43bfc54581d9db88c49 confirms that all the files contain the AssemblyInformationalVersionAttribute including a |
Perfect, thanks for the verification! |
Remove the logic that overrides the git commit info for each repo. Let each repo infer the VMR's git commit (via sourcelink).
That will let the sdk, runtime, aspnetcore (and other) repos use the VMR's commit hash and show that in dotnet --info.
This works for both when building the VMR directly in a git repository, as well as when building it from a git-archive tarball thanks to sourcelink's support for minimal git metadata [1].
This is a port of dotnet/installer#18941 to dotnet/sdk since the installer was merged into sdk.
[1] https://github.com/dotnet/sourcelink/tree/main/docs#minimal-git-repository-metadata
Fixes: dotnet/source-build#3643