Skip to content
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

Bump tasks assembly and file versions automatically with every nightly build #488

Closed
nguerrera opened this issue Dec 13, 2016 · 5 comments
Closed
Assignees
Milestone

Comments

@nguerrera
Copy link
Contributor

Currently both are hard-coded to 1.0.0.0.

We keep running in to issues where there is a build-to-build break in the SDK and an msbuild process can't SxS load two SDK task assemblies with the same name.

I think we can bump both with every daily build number. It's a simple fix and since the tasks assembly is not designed to have any exchange types, SxS loading any two different builds should be acceptable.

cc @davkean @rainersigwald @dsplaisted

@nguerrera nguerrera added this to the 1.0 RC3 milestone Dec 13, 2016
@srivatsn srivatsn added the Bug label Dec 21, 2016
@srivatsn
Copy link
Contributor

@mavasani your recent PR (that was rolled back) did this right? Can we resurrect just that part of it? Without this when users upgrade to RC3, if they have the old msbuild instance running, there could be weirdness.

@srivatsn srivatsn assigned mavasani and unassigned basoundr Jan 11, 2017
@mavasani
Copy link
Contributor

@srivatsn That commit caused Microbuild failure with the below MSBuild error:

2017-01-10T01:15:24.2998766Z E:\A\_work\15\s\Common.props(32,5): error MSB4186: Invalid static method invocation syntax: "[MSBuild]::Subtract($(BuildNumber.Split('.')[0].Substring(3).Trim()), 8800)". Input string was not in a correct format. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)).  [E:\A\_work\15\s\build\build.proj]
2017-01-10T01:15:24.4717498Z Failed to build

This passed fine locally if I set BUILD_BUILDNUMBER, which forces this invocation and also generates correct build numbers. I tried both on a machine with just Dev14 as well as one with just Dev15 and locally it works fine. We use the exact same syntax in Roslyn too and it works fine: https://github.com/dotnet/roslyn/blob/master/build/Targets/Versions.props#L43. @srivatsn you know if there is anything special about the microbuild machine for SDK repo?

@rainersigwald you have any suggestions how to address this failure?

@mavasani
Copy link
Contributor

So, I identified that my commit above by itself is not sufficient to implement this. Roslyn and Roslyn project system repos have GenerateAssemblyInfo.targets that actually consume these version related properties and generate the assembly info. This targets file is imported in the common Targets file (https://github.com/dotnet/roslyn/blob/e509b57971474c4d5937bb9a7434839ee8e2c31b/build/Targets/Imports.targets#L332) that is imported by every project in the repo.

SDK repo on the other hand doesn't have concept of such a common Targets that is imported by every single project (it just has a Common.Props). We will first need to create such a common Imports.Targets, make sure every project imports it, and then import GenerateAssemblyInfo.targets in this targets file.

@nguerrera
Copy link
Contributor Author

nguerrera commented Jan 11, 2017

SDK builds with SDK, which has built in support for this. We disable it because at the time we had a chicken and egg problem with the feature coming online. We can actually just set $(FileVersion) and $(AssemblyVersion) and stop setting $(GenerateAssemblyInfo) to false. :)

@mavasani
Copy link
Contributor

mavasani commented Jan 13, 2017

Setting GenerateAssemblyInfo to true for Microsoft.NET.Build.Tasks.csproj gives the following errors:

C:\sdk\bin\obj\Microsoft.NET.Build.Tasks\Debug\netstandard1.3\Microsoft.NET.Build.Tasks.AssemblyInfo.cs(6,12): error CS0579: Duplicate 'System.Reflection.AssemblyConfigurationAttribute' attribute [C:\sdk\src\Tasks\Microsoft.NET.Build.Tasks\Microsoft.NET.Build.Tasks.csproj]
C:\sdk\bin\obj\Microsoft.NET.Build.Tasks\Debug\netstandard1.3\Microsoft.NET.Build.Tasks.AssemblyInfo.cs(7,12): error CS0579: Duplicate 'System.Reflection.AssemblyCopyrightAttribute' attribute [C:\sdk\src\Tasks\Microsoft.NET.Build.Tasks\Microsoft.NET.Build.Tasks.csproj]
C:\sdk\bin\obj\Microsoft.NET.Build.Tasks\Debug\netstandard1.3\Microsoft.NET.Build.Tasks.AssemblyInfo.cs(8,12): error CS0579: Duplicate 'System.Reflection.AssemblyDescriptionAttribute' attribute [C:\sdk\src\Tasks\Microsoft.NET.Build.Tasks\Microsoft.NET.Build.Tasks.csproj]
C:\sdk\bin\obj\Microsoft.NET.Build.Tasks\Debug\netstandard1.3\Microsoft.NET.Build.Tasks.AssemblyInfo.cs(9,12): error CS0579: Duplicate 'System.Reflection.AssemblyFileVersionAttribute' attribute [C:\sdk\src\Tasks\Microsoft.NET.Build.Tasks\Microsoft.NET.Build.Tasks.csproj]
C:\sdk\bin\obj\Microsoft.NET.Build.Tasks\Debug\netstandard1.3\Microsoft.NET.Build.Tasks.AssemblyInfo.cs(11,12): error CS0579: Duplicate 'System.Reflection.AssemblyProductAttribute' attribute [C:\sdk\src\Tasks\Microsoft.NET.Build.Tasks\Microsoft.NET.Build.Tasks.csproj]
C:\sdk\bin\obj\Microsoft.NET.Build.Tasks\Debug\netstandard1.3\Microsoft.NET.Build.Tasks.AssemblyInfo.cs(12,12): error CS0579: Duplicate 'System.Reflection.AssemblyTitleAttribute' attribute [C:\sdk\src\Tasks\Microsoft.NET.Build.Tasks\Microsoft.NET.Build.Tasks.csproj]
C:\sdk\bin\obj\Microsoft.NET.Build.Tasks\Debug\netstandard1.3\Microsoft.NET.Build.Tasks.AssemblyInfo.cs(13,12): error CS0579: Duplicate 'System.Reflection.AssemblyVersionAttribute' attribute [C:\sdk\src\Tasks\Microsoft.NET.Build.Tasks\Microsoft.NET.Build.Tasks.csproj]
C:\sdk\bin\obj\Microsoft.NET.Build.Tasks\Debug\netstandard1.3\Microsoft.NET.Build.Tasks.AssemblyInfo.cs(14,12): error CS0579: Duplicate 'System.Resources.NeutralResourcesLanguage' attribute [C:\sdk\src\Tasks\Microsoft.NET.Build.Tasks\Microsoft.NET.Build.Tasks.csproj]

Additionally, it seems none of the template assemblies generated in the output dir, i.e. Microsoft.VisualStudio.ProjectSystem.XXX.Templates.dll, respect this flag and always have all versions 0.0.0.0.

I have pushed all the changes I made locally to https://github.com/mavasani/sdk/blob/BuildVersion/Common.props. @nguerrera I am moving over the bug to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants