-
Notifications
You must be signed in to change notification settings - Fork 125
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
Show VMR commit hash under dotnet --info for source-built SDKs #3643
Comments
Is there some way to get the local commit sha inside the VMR? I know in a git repo we can run |
We do fake out some .git files when running in a tarball scenario for source-link. See https://github.com/dotnet/dotnet/blob/main/build.sh#L294. |
Thanks, that build.sh trick is what I meant by |
It looks like the I can get things to look like this, when building the VMR commit 7cf74ae48c8bb032adf0b10cf106938f5692b7a0 with some changes:
I have opened PRs to make this change, but please let me know if |
This defines a new environment variable `DotNetGitCommitHash` which contains the commit hash of the VMR. Individual repositories can use this to find the VMR's commit hash and then embed/use it as appropriate. Contributes to dotnet/source-build#3643
This puts the VMR's commit hash, provided by the VMR as the property DotNetGitCommitHash, in the .version file. Contributes to dotnet/source-build#3643
This defines a new environment variable `DotNetGitCommitHash` which contains the commit hash of the VMR. Individual repositories can use this to find the VMR's commit hash and then embed/use it as appropriate. It then uses this hash when generating the SDK's .version file, so dotnet --info shows this as the SDK version. Contributes to dotnet/source-build#3643
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
This defines a new environment variable `DotNetGitCommitHash` which contains the commit hash of the VMR. Individual repositories can use this to find the VMR's commit hash and then embed/use it as appropriate. It then uses this hash when generating the SDK's .version file, so dotnet --info shows this as the SDK version. Contributes to dotnet/source-build#3643
Various repos use commit hashes different ways:
When building the VMR in .NET 9+, do we want all of them to be the VMR hashes? Is there any reason for any of them to be the per-repo hash? |
On dotnet/installer#18941, @ViktorHofer said:
|
This puts the VMR's commit hash, provided by the VMR as the property DotNetGitCommitHash, in the .version file. Contributes to dotnet/source-build#3643
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 installer and sdk repos use the VMR's commit hash and show that in `dotnet --info`. This works for both when building the VMR out of git, as well as when building it from a tarball/archive thanks to sourcelink's support for minimal git metadata [1]. [1] https://github.com/dotnet/sourcelink/tree/main/docs#minimal-git-repository-metadata Fixes: dotnet/source-build#3643
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 installer and sdk repos use the VMR's commit hash and show that in `dotnet --info`. This works for both when building the VMR out of git, as well as when building it from a tarball/archive thanks to sourcelink's support for minimal git metadata [1]. [1] https://github.com/dotnet/sourcelink/tree/main/docs#minimal-git-repository-metadata Fixes: dotnet/source-build#3643
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
Describe the Problem
Currently, a source-built .NET SDK displays the commit hash of the installer repo -- the one in
prereqs/git-info/installer.props
-- when you run the commanddotnet --info
, e.g.Describe the Solution
It would probably make more sense to display the VMR repo commit hash equivalent to the source-tree that generated said SDK when the user types in
dotnet --info
.Additional Context
This issue was a result of question #3642.
The text was updated successfully, but these errors were encountered: