Port fix to make satellite generation work for VB to release/2.1.1xx#1997
Conversation
Fixes dotnet#1748. The `CoreGenerateSatelliteAssemblies` task first calls the `WriteCodeFragment` task to write a bunch of attributes to a .cs file, and then calls the `Csc` task to compile it (along with the .resource files, of course). However, the call to `WriteCodeFragment` will use the project's language to generate the source file. This means that in a VB project we'll end up generating VB code into a .cs file which we then try to compile with csc.exe. That doesn't end well. The fix here is to always pass "C#" as the language to `WriteCodeFragment`.
|
cc @weshaggard |
|
@MattGertz for servicing approval. This would go into the next 2.1.1xx / 15.6.x servicing release, not the current release in progress. However, source builds for the current release will have this patch applied. |
|
@nguerrera Approving this, but @livarcocc we should have some sort of VSO bug tracking this is it's going into a servicing release of VS assigned to 15.6.1 milestone. |
|
@nguerrera go ahead and file the VSO issue. We will need to fill out the ASK MODE template there and figure out which vehicle will carry this for 15.6. The MSRC is locked down, so, it will have to be a servicing after that. |
|
Holding merge until VSO issues is filed, but dealing with some other priorities first. |
|
VSO bug filed: https://devdiv.visualstudio.com/DevDiv/_queries?id=574901 |
* Move roslyn repo to branch without patches * Patch tools for SDK issue: dotnet/sdk#1997 * Add updaters to update global.json and Tools.props * Change UpdateXml to write output properly * Add patches for roslyn * Update roslyn.proj to build the source-build solution. Remove unneeded NuSpec. * Add roslyn to known-good.proj * Move roslyn sha to commit that corrects issue with SourceBuild.sln and remove temporary sln. Remove xml updater since it isn't needed. Move patch to tools-local dir and update git apply to not use --directory. * Remove UpdateJson task because it is causing a conflict with newtonsoft.json versions. Adding #409 to re-add this later.
* Move roslyn repo to branch without patches * Patch tools for SDK issue: dotnet/sdk#1997 * Add updaters to update global.json and Tools.props * Change UpdateXml to write output properly * Add patches for roslyn * Update roslyn.proj to build the source-build solution. Remove unneeded NuSpec. * Add roslyn to known-good.proj * Move roslyn sha to commit that corrects issue with SourceBuild.sln and remove temporary sln. Remove xml updater since it isn't needed. Move patch to tools-local dir and update git apply to not use --directory. * Remove UpdateJson task because it is causing a conflict with newtonsoft.json versions. Adding dotnet/source-build#409 to re-add this later.
…024.1 (#1997) [main] Update dependencies from dotnet/arcade - Coherency Updates: - Microsoft.DotNet.XliffTasks: from 1.0.0-beta.23516.1 to 1.0.0-beta.23523.1 (parent: Microsoft.DotNet.Arcade.Sdk)
Customer scenario
VB project using SDK and having satellite assemblies. Build breaks trying to compile the Assembly info for the satellite that is written out in VB instead of C# even though satellite builds in SDK always invoke the C# compiler.
2.1.1xx and 2.1.2xx SDKs cannot build themselves because Roslyn in these release branches depends on having this fix.
Bugs this fixes:
#1748 (Already fixed, but only for 2.1.300+ and this is a request to have it included in the next 2.1.1xx servicing release as well as 2.1.200.)
Workarounds, if any
Wait for 2.1.300 to be released (which already has the fix).
Copy entire target with fix into Directory.Build.targets. This is very fragile because it would shut off any future fixes to the target and tie the customer project to internal implementation details of the SDK. I would be very hesitant to recommend this.
Source build can apply a patch, but this keeps a discrepancy betweeen source and non-source-builds and adds debt. By putting this low risk fix into the next servicing release, we eliminate that debt sooner.
Risk
Low
Performance impact
None
Is this a regression from a previous update?
No. It was broken since the first release that supported VB (1.1 I believe), but Roslyn was the first customer to report it. It seems the intersection of VB sdk projects and satellite assemblies is small.
Root cause analysis:
Insufficient VB coverage.
Insufficient understanding / communication that a Roslyn branch effectively cannot depend on a CLI newer than the CLI release train it is on. Otherwise, source build will break. Moving forward, any fix we take to unblock Roslyn will need to consider the correlation between Roslyn branches and CLI branches.
How was the bug found?
Dogfooding