-
Notifications
You must be signed in to change notification settings - Fork 59
Increment version numbers on aspnetcore.dll and aspnetcorerh.dll, remove unnecessary files #601
Conversation
jkotalik
commented
Feb 21, 2018
- The aspnetcore.dll was originally version 7.1.xxxx.0, so I needed to increment it to something larger such that the MSI will replace it. I chose 8.1.0.xxxx to somewhat match the current dotnet version.
- Currently aspnetcorerh.dll matches the aspnetcore.dll version, but I think we should make the aspnetcorerh.dll match the dotnet version. I can use the VersionPrefix defined in version.props.
- I wanted to get the AssemblyRevision from the internal SDK (https://github.com/aspnet/BuildTools/blob/5e70208f6d4862de72a3dab2aa74e82cb3b0481f/src/Internal.AspNetCore.Sdk/build/Common.props#L38) but I don't believe it is available when building vcxprojs. @pranavkm I didn't see a great way of adding AssemblyInfo for C++ projects (ex https://stackoverflow.com/questions/1126880/how-can-i-auto-increment-the-c-sharp-assembly-version-via-our-ci-platform-hudso is only for .net)
<PropertyGroup> | ||
<_TwoDigitYear>$([MSBuild]::Subtract($([System.DateTime]::UtcNow.Year), 2000))</_TwoDigitYear> | ||
<_ThreeDigitDayOfYear>$([System.DateTime]::UtcNow.DayOfYear.ToString().PadLeft(3, '0'))</_ThreeDigitDayOfYear> | ||
<AssemblyRevision>$(_TwoDigitYear)$(_ThreeDigitDayOfYear)</AssemblyRevision> |
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.
So, when we produce more than one build in the same day, won't this lead to duplicate file revisions?
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.
Yeah it does. Were we okay with doing this for other dlls because we use nuget package versions?
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.
AFAIK, we use this pattern elsewhere
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.
Where do we use this? It means our builds are not reproducible, and that two builds with different sources will have the same revision number. Although it may not be a huge problem, it's certainly not a good thing.
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 is used for all of our dlls today... I am looking at the 2.0.0 installation on my computer and the file version of the dll is exactly this.
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.
Other dotnet dlls have the file version matching the product version.
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.
Ok. This is still bad for reproducible builds. But it is bad in the same way the rest of our stack computes file version, so we can just add this to the list of offenses to be cleaned up when we fix aspnet/BuildTools#452
@@ -231,13 +231,31 @@ | |||
<ClCompile Include="outofprocess\websockethandler.cxx" /> | |||
<ClCompile Include="outofprocess\winhttphelper.cxx" /> | |||
</ItemGroup> | |||
<Target Name="CreateVersionHeader" BeforeTargets="PrepareForBuild"> |
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.
Does this break incremental compilation? I'm not sure if this is a thing in vcsproj.
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.
which build input variable is used in incremental build to control the build number?
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.
This is what used to be in the ANCM repo: https://github.com/aspnet/AspNetCoreModule/blob/e714153782a9fde9a529804efb0bcbf015af20b1/src/AspNetCore/AspNetCore.vcxproj#L193. So it is probably available.
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.
Seems ok to me. Get @natemcmaster's approval and make sure the licensing information is correct
<VersionHeaderContents Include="#define ProductVersionStr "$(AspNetCoreModuleVersionMajor).$(AspNetCoreModuleVersionMinor).$(AspNetCoreModuleVersionPatch).$(AssemblyRevision)\0"" /> | ||
<VersionHeaderContents Include="#define PlatformToolset "$(PlatformToolset)\0"" /> | ||
</ItemGroup> | ||
<WriteLinesToFile File="version.h" Lines="@(VersionHeaderContents)" OverWrite="true" /> |
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.
Consider adding WriteOnlyWhenDifferent="True"
to this. Should avoid writing it and breaking increments when the file content hasn't changed. In addition, add the file to writes
<ItemGroup>
<FileWrites Include="version.h" />
</ItemGroup>
Prevents msbuild from cleaning up the file.
<ItemGroup> | ||
<ProjectReference Include="..\CommonLib\CommonLib.vcxproj"> | ||
<Project>{55494e58-e061-4c4c-a0a8-837008e72f85}</Project> | ||
</ProjectReference> | ||
<ProjectReference Include="..\IISLib\IISLib.vcxproj"> | ||
<Project>{4787a64f-9a3e-4867-a55a-70cb4b2b2ffe}</Project> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> |
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.
Formatting
src/RequestHandler/requesthandler.rc
Outdated
VALUE "FileDescription", "IIS ASP.NET Core Module" | ||
VALUE "FileVersion", FileVersionStr | ||
VALUE "InternalName", "aspnetcorer.dll" | ||
VALUE "LegalCopyright", "Copyright (C) 2016" |
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.
Has @Eilon verified these?
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.
@Eilon these are the same as the AspNetCoreModule values except I added "Request Handler" and changed the copyright to 2018.
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.
cc/ @shirhatti @muratg for this.
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.
Yeah this doesn't look right to me. I think it should be Copyright (c) .NET Foundation
.
<PropertyGroup> | ||
<_TwoDigitYear>$([MSBuild]::Subtract($([System.DateTime]::UtcNow.Year), 2000))</_TwoDigitYear> | ||
<_ThreeDigitDayOfYear>$([System.DateTime]::UtcNow.DayOfYear.ToString().PadLeft(3, '0'))</_ThreeDigitDayOfYear> | ||
<AssemblyRevision>$(_TwoDigitYear)$(_ThreeDigitDayOfYear)</AssemblyRevision> |
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.
AFAIK, we use this pattern elsewhere
src/RequestHandler/requesthandler.rc
Outdated
VALUE "CompanyName", "Microsoft" | ||
VALUE "FileDescription", "IIS ASP.NET Core Module" | ||
VALUE "FileVersion", FileVersionStr | ||
VALUE "InternalName", "aspnetcorer.dll" |
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.
Typo: aspnetcorerh.dll
src/RequestHandler/requesthandler.rc
Outdated
VALUE "CompanyName", "Microsoft" | ||
VALUE "FileDescription", "IIS ASP.NET Core Module" | ||
VALUE "FileVersion", FileVersionStr | ||
VALUE "InternalName", "aspnetcorer.dll" |
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.
this is wrong. should be aspnetcorerh.dll
src/RequestHandler/requesthandler.rc
Outdated
BLOCK "040904b0" | ||
BEGIN | ||
VALUE "CompanyName", "Microsoft" | ||
VALUE "FileDescription", "IIS ASP.NET Core Module" |
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.
we need additional decription info instead of just copy asp.netcore module
@@ -231,13 +231,31 @@ | |||
<ClCompile Include="outofprocess\websockethandler.cxx" /> | |||
<ClCompile Include="outofprocess\winhttphelper.cxx" /> | |||
</ItemGroup> | |||
<Target Name="CreateVersionHeader" BeforeTargets="PrepareForBuild"> |
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.
which build input variable is used in incremental build to control the build number?
src/RequestHandler/requesthandler.rc
Outdated
VALUE "FileDescription", "IIS ASP.NET Core Module" | ||
VALUE "FileVersion", FileVersionStr | ||
VALUE "InternalName", "aspnetcorer.dll" | ||
VALUE "LegalCopyright", "Copyright (C) 2016" |
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 this one be changed to 2018 @shirhatti
src/RequestHandler/requesthandler.rc
Outdated
VALUE "FileDescription", "IIS ASP.NET Core Module Request Handler" | ||
VALUE "FileVersion", FileVersionStr | ||
VALUE "InternalName", "aspnetcorerh.dll" | ||
VALUE "LegalCopyright", "Copyright (C) 2018" |
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 this should be Copyright (c) .NET Foundation
or Copyright (c) Microsoft Corporation
. No date.
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 sign off on copyright stuff. Didn't read the code/build changes.