From d20a1773a59a628c7c782621ddd4f30392d9719b Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Sat, 9 Mar 2024 09:47:38 -0500 Subject: [PATCH] Show the VMR commit hash in dotnet --info 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 https://github.com/dotnet/source-build/issues/3643 --- .../Microsoft.NETCore.App.Runtime.props | 6 +++++- src/native/corehost/corehost.proj | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props index c8ca3be5fd6965..432b804ced5252 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props @@ -164,8 +164,12 @@ <_VersionFile Include="$(IntermediateOutputPath).version" TargetPath="shared/$(SharedFrameworkName)/$(Version)/" /> + + $(DotNetGitCommitHash) + $(SourceRevisionId) + diff --git a/src/native/corehost/corehost.proj b/src/native/corehost/corehost.proj index 026cff6928567d..e8f754e2375f58 100644 --- a/src/native/corehost/corehost.proj +++ b/src/native/corehost/corehost.proj @@ -74,9 +74,13 @@ $(IntermediateOutputRootPath)corehost\cmake\ $([MSBuild]::NormalizePath('$(MSBuildThisFileDirectory)', 'build.sh')) + $(DotNetGitCommitHash) + $(SourceRevisionId) + N/A + <_CoreHostUnixTargetOS>$(TargetOS) <_CoreHostUnixTargetOS Condition="'$(TargetsLinuxBionic)' == 'true'">linux-bionic - $(Configuration) $(TargetArchitecture) -commithash "$([MSBuild]::ValueOrDefault('$(SourceRevisionId)', 'N/A'))" -os $(_CoreHostUnixTargetOS) + $(Configuration) $(TargetArchitecture) -commithash "$(CommitHash)" -os $(_CoreHostUnixTargetOS) $(BuildArgs) -cmakeargs "-DVERSION_FILE_PATH=$(NativeVersionFile)" $(BuildArgs) -configureonly $(BuildArgs) -portablebuild=false