-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Include commit SHA in [AssemblyInformationalVersion]
value
#22649
Conversation
dougbu
commented
Sep 21, 2020
- see Standardization of runtime assembly attributes arcade#5866 discussion
/fyi @ajcvickers @bricelam @smitpatel @Pilchie this is the other 5.0 fix to use consistent "format" for our |
Note that we do expose and use |
It breaks—the column length is too small in the database |
Well, it broke when we tried this in the past anyway |
If only we had a way to update the schema... ;-) |
Do tests cover any database mapping from the |
I think it was on MySQL or Oracle or something. We should review the previous attempt before moving forward on this. |
Migrating the history table might be a bit too chicken and egg. 😐 |
Where's the previous attempt❔ Would like to get this into 5.0 RC2. We have a bit longer for the 3.1 version of this (#22650). |
Found previous attempt I think. @bricelam your comment in #14177 (the original Arcade conversion you did) says
So, what controls the length of |
@dougbu We likely need to add coverage. Is there a functional reason for making this change? |
Well, perhaps a corner case, but not including the SHA makes some Reflection introspection difficult or, in the EF case, impossible. @sebastienros pointed out inconsistent assembly metadata between aspnetcore and runtime DLLs in dotnet/arcade#5866. That led us to look at other repos and their assemblies and we noticed EF assemblies don't contain the commit SHA anywhere. We also saw Arcade documentation stressing use of this "full" If we find including the SHA in the Realize the PR validation build doesn't exercise this change; |
+1 for using |
Here's the comment (hidden by default) from last time we tried. The column length is 32.
|
@bricelam Could we update ProductInfo.cs to trim the value coming from the attribute? |
@bricelam that comment looks like a separate signing issue hit in #14177 that @JohnTortugo fixed in Arcade. But the
bit is definitely relevant. I think #14177 (comment) remains the most relevant comment in #14177. Not sure why https://dev.azure.com/dnceng/internal/_build/results?buildId=825609 isn't failing (yet❔) though. |
@ajcvickers I'd want to add a full semantic version parser as part of that. (see also dotnet/runtime#19317) |
@bricelam Consider for 6.0? |
Why not just use an AssemblyMetadata attribute instead? And do it in RC2. |
Can you link to more information about this? What, specifically, is impossible? |
@bricelam I'm still trying to figure out the actual reason for this change so that if we do that we know whether or not it fixes anything. |
Additional context: We lost this information when we moved form KoreBuild to Arcade. I thought I filed an issue to add it back, but it must've fallen through the cracks. |
See dotnet/arcade#5866 and https://github.com/dotnet/arcade/blob/master/Documentation/CorePackages/Versioning.md#assembly-informational-version-generation
Figuring out the commit SHA used when building an assembly.
and
I'm fine with this because https://dev.azure.com/dnceng/internal/_build/results?buildId=825609 was successful despite assemblies having I agree this change would need to be larger i.e. include tests and either a column width update or a parser in Any objection to making the minimal |
- see dotnet/arcade#5866 discussion - provide the commit SHA though not in usual `[AssemblyInformationalVersion]` format
fba9fd5
to
d31dbad
Compare
🆙📅 to switch approaches dotnet/aspnetcore also adds the following in its version of the same target.
But, is the lack of |
IIUC, it's only used on .NET Framework. See dotnet/arcade#1526 |
I don't believe that's true. The Servicable attribute was supposed to stay in place to enable the runtime to drop information on what assemblies have ever been loaded on a system, and that includes on Core. I don't believe this has ever changed. Put it back, unless @ericstj says hammer patching uses another mechanism. |
Serviceable assembly metadata is used by .NETFramework loader to write breadcrumbs. I believe the .NETCore host uses the serviceable metadata from the deps file. cc @agocke @vitek-karas |
Hmm, I believe this repo produces a number of assemblies usable on .NET Framework e.g. Micrsoft.Data.Sqlite as seen at
|
The nuspecs include |
Happy to add it back--that's why I filed the issue on Aracade two years ago. 🙂 (to get to the bottom of whether it was actually needed or not) |
I need lunch but will at least add the Will get this ready to go and then update the 3.1 PR. Any reason to worry about EF6's release/6.4 and master branches given how quiet that repo is❔ |
@ajcvickers is this PR still blocked❔ |
Thanks, Doug! I'm really glad we have this information back. Reverse engineering it from the build number was really painful the few times I had to do it. |
* Add `[AssemblyMetadata("CommitHash", ...)]` to all C# assemblies - see dotnet/arcade#5866 discussion - provide the commit SHA though not in usual `[AssemblyInformationalVersion]` format * Include `[AssemblyMetadata("Serviceable", "true")]` too - see dotnet/arcade#1526
…#22650) * Add `[AssemblyMetadata("CommitHash", ...)]` to all C# assemblies - see dotnet/arcade#5866 discussion - provide the commit SHA though not in usual `[AssemblyInformationalVersion]` format * Include `[AssemblyMetadata("Serviceable", "true")]` too - see dotnet/arcade#1526