-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Show the VMR commit hash in dotnet --info #99482
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
The VMR defines DotNetGitCommitHash when building runtime. Use that to populate the .version file and corehost's commit hash. That results in showing the VMR's commit hash in the `dotnet --info` output. Contributes to dotnet/source-build#3643
| <_CoreHostUnixTargetOS>$(TargetOS)</_CoreHostUnixTargetOS> | ||
| <_CoreHostUnixTargetOS Condition="'$(TargetsLinuxBionic)' == 'true'">linux-bionic</_CoreHostUnixTargetOS> | ||
| <BuildArgs>$(Configuration) $(TargetArchitecture) -commithash "$([MSBuild]::ValueOrDefault('$(SourceRevisionId)', 'N/A'))" -os $(_CoreHostUnixTargetOS)</BuildArgs> | ||
| <BuildArgs>$(Configuration) $(TargetArchitecture) -commithash "$(CommitHash)" -os $(_CoreHostUnixTargetOS)</BuildArgs> |
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.
There is another use of SourcerevisionId at later in this file: https://github.com/dotnet/runtime/pull/99482/files#diff-165e4dabf2097f79d2ed18244f5a9762cfc4fe25a69f9be5e8585f61fc871523R146 . Should it get the same treatment?
Would it be better to set SourcerevisionId globally?
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.
Should it get the same treatment?
I think it should. It does the same thing as this, except for Windows, right? I think we want the Unified Behaviour to be the same: show VMR hash with dotnet --info.
Would it be better to set SourcerevisionId globally?
Probably not. That's used by sourcelink, which we prefer to point to the indvidual repos (though I am not sure why).
@NikolaMilosavljevic , any thoughts?
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.
I think it should. It does the same thing as this, except for Windows, right?
Yes, same thing, except for Windows. Agree it should have the same behaviour.
|
/cc @elinor-fung |
| <CommitHash Condition="('$(CommitHash)' == '') and ('$(DotNetGitCommitHash)' != '')">$(DotNetGitCommitHash)</CommitHash> | ||
| <CommitHash Condition="('$(CommitHash)' == '') and ('$(SourcerevisionId)' != '')">$(SourceRevisionId)</CommitHash> |
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.
nit: I find it easier to read when the property just gets set based on being empty and the order indicates the precedence.
| <CommitHash Condition="('$(CommitHash)' == '') and ('$(DotNetGitCommitHash)' != '')">$(DotNetGitCommitHash)</CommitHash> | |
| <CommitHash Condition="('$(CommitHash)' == '') and ('$(SourcerevisionId)' != '')">$(SourceRevisionId)</CommitHash> | |
| <CommitHash Condition="'$(CommitHash)' == ''">$(DotNetGitCommitHash)</CommitHash> | |
| <CommitHash Condition="'$(CommitHash)' == ''">$(SourceRevisionId)</CommitHash> |
|
Based on the feedback I got at dotnet/installer#18941, I am going to discard this PR. It seems we can get all the benefits of this change without any code changes (and even reduce infra/maintenance). |
The VMR defines DotNetGitCommitHash when building runtime. Use that to populate the .version file and corehost's commit hash. That results in showing the VMR's commit hash in the
dotnet --infooutput.Contributes to dotnet/source-build#3643