Skip to content

Conversation

@mjcheetham
Copy link
Member

Since .NET SDK 8, the Informational Version attribute includes the commit ID of the current HEAD at build time. The product code relies on this value to be System.Version-compliant, so we should opt out of this new behaviour.

https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/8.0/source-link

Since .NET SDK 8, the Informational Version attribute includes the
commit ID of the current HEAD at build time. The product code relies on
this value to be System.Version-compliant, so we should opt out of this
new behaviour.

https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/8.0/source-link

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! This should fix the report where gvfs version includes the commit SHA (and the version checks during gvfs clone fail, as a consequence).

@mjcheetham mjcheetham merged commit 0ab1c7d into microsoft:master Sep 18, 2025
49 checks passed
dscho added a commit that referenced this pull request Sep 18, 2025
…when-revision-is-included

Fix `gvfs clone` version check when revision is included in the version string

As reported by Tyrie Vella, `gvfs clone` would fail with https://github.com/microsoft/VFSForGit/releases/tag/v1.0.25260.1 when the repository to clone specifies a minimal VFSforGit version in its `gvfs/config` endpoint. The reason is that with the version bump from .NET SDK v3 to v9, the version string included in the assembly now contains the suffix `+<commit-SHA>`, which cannot be parsed by `System.Version`:

```
Cannot clone @ C:\path: System.FormatException: Input string was not in a correct format.
   at System.Version.VersionResult.SetFailure(ParseFailureKind failure, String argument)
   at System.Version.TryParseComponent(String component, String componentName, VersionResult& result, Int32& parsedComponent)
   at System.Version.TryParseVersion(String version, VersionResult& result)
   at System.Version.Parse(String input)
   at System.Version..ctor(String version)
   at GVFS.CommandLine.GVFSVerb.TryValidateGVFSVersion(GVFSEnlistment enlistment, ITracer tracer, ServerGVFSConfig config, String& errorMessage, Boolean& errorIsFatal)
   at GVFS.CommandLine.GVFSVerb.ValidateClientVersions(ITracer tracer, GVFSEnlistment enlistment, ServerGVFSConfig gvfsConfig, Boolean showWarnings)
   at GVFS.CommandLine.CloneVerb.Execute()
```

Matthew Cheetham provided a quick work-around in #1870 to opt out of the new behavior and report the version _without_ that suffix again; Here is a PR that prepares the code to handle such versions gracefully, to open up the door to opt back in to the new behavior (and let `gvfs version` report an even more informative output than right now).
@mjcheetham mjcheetham mentioned this pull request Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants