Open mmitche opened 3 years ago
@tmat @dotnet/roslyn-infrastructure How is this supposed to work? Is some magic supposed to embed sources for generated files?
@clairernovotny
To my understanding that shouldn't be happening because the generated files should be embedded in the PDB here and hence excluded from source link.
The sources are not embedded into the PDB for some reason. Isn't there a workaround for WPF projects somewhere in our targets that disables source embedding because of WPF bug?
@tmat You would have been the one I'd ask that question to. What would it look like, what's the property name?
Trace EmbeddedFiles
item group passed to the compiler.
So I see no use of EmbeddedFiles in any of the MSBuild anywhere in Roslyn, other than of course the stuff in src/Compilers/Core/MSBuildTask which just the stuff we ship to customers. So this bug is elsewhere -- where to move to next?
@jasonmalinowski did you look at a binlog from an official or CI build? IIRC we only leverage source link in those situations and I don't think it would show up in a local build.
@jaredpar I just did "git grep" on our repo and didn't see anything that way. I presume if there is a hack it's from arcade or the SDK or something external, at which point an actual expert in that will need to figure this out. I'm not even sure why this bug is assigned to me. :smile:
Have you tried setting IncludePackageReferencesDuringMarkupCompilation
to true
? That was added in 5.0.200 to enable PackageReferences, including Source Link, to work with the WPF markup compiler pass. It's currently off by default in the SDK.
Sending this back through triage -- I think this was assigned to me thinking it was related to source generators.
Confirmed this is still an issue with the latest packages
... but of course when building locally the sources are embedded as expected. Joy.
Confirmed this is still an issue with the latest packages
Actually I take that back, I downloaded a random recent build and it looks like the files are embedded in the PDB, they're just also part of the source link map. I know for Go To Definition i'm checking for embedded source, before source link. Is that the expectation @tmat? Or is it an issue that the files are part of the map (ie, they have the same prefix as the other source)?
@mmitche Does the validation that produced the log above look for embedded source, or does it just validate the source link map directly?
Shouldn't the binlog from the official build tell us if we have these settings right? Should we adjust that job to publish the binlog on a success?
Indeed, the binlog from the random build I linked above shows us embedding the source of these files correctly:
The package Microsoft.CodeAnalysis.EditorFeatures.Wpf version 3.10.0-3.21216.10 has generated files in its source links. These files don't exist on GitHub and so the source link info is broken.