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

Some SourceLink links point to generated files #52837

Open
mmitche opened this issue Apr 22, 2021 · 15 comments
Open

Some SourceLink links point to generated files #52837

mmitche opened this issue Apr 22, 2021 · 15 comments
Assignees
Milestone

Comments

@mmitche
Copy link
Member

mmitche commented Apr 22, 2021

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.

Validating  Microsoft.CodeAnalysis.EditorFeatures.Wpf.3.10.0-3.21216.10.symbols.nupkg ...The remote server returned an error: (404) Not Found.

	File lib/net472/Microsoft.CodeAnalysis.EditorFeatures.Wpf.pdb has broken links:
		Failed to retrieve https://raw.githubusercontent.com/dotnet/roslyn/9bfe989ad46e3f457d33ed800c3be012cec5afc6/artifacts/obj/Microsoft.CodeAnalysis.EditorFeatures.Wpf/Release/net472/InlineRename/Dashboard/Dashboard.g.cs
The remote server returned an error: (404) Not Found.
		Failed to retrieve https://raw.githubusercontent.com/dotnet/roslyn/9bfe989ad46e3f457d33ed800c3be012cec5afc6/artifacts/obj/Microsoft.CodeAnalysis.EditorFeatures.Wpf/Release/net472/.NETFramework
The remote server returned an error: (404) Not Found.
		Failed to retrieve https://raw.githubusercontent.com/dotnet/roslyn/9bfe989ad46e3f457d33ed800c3be012cec5afc6/artifacts/obj/Microsoft.CodeAnalysis.EditorFeatures.Wpf/Release/net472/Microsoft.CodeAnalysis.EditorFeatures.Wpf.InternalsVisibleTo.cs
The remote server returned an error: (404) Not Found.
		Failed to retrieve https://raw.githubusercontent.com/dotnet/roslyn/9bfe989ad46e3f457d33ed800c3be012cec5afc6/artifacts/obj/Microsoft.CodeAnalysis.EditorFeatures.Wpf/Release/net472/Microsoft.CodeAnalysis.Editor.EditorFeaturesWpfResources.cs
The remote server returned an error: (404) Not Found.
		Failed to retrieve https://raw.githubusercontent.com/dotnet/roslyn/9bfe989ad46e3f457d33ed800c3be012cec5afc6/artifacts/obj/Microsoft.CodeAnalysis.EditorFeatures.Wpf/Release/net472/Microsoft.CodeAnalysis.EditorFeatures.Wpf.AssemblyInfo.cs
D:\workspace\_work\1\a\signed\shipping\assets\symbols\Microsoft.CodeAnalysis.EditorFeatures.Wpf.3.10.0-3.21216.10.symbols.nupkg has broken SourceLink links.
##[error](NETCORE_ENGINEERING_TELEMETRY=SourceLink) D:\workspace\_work\1\a\signed\shipping\assets\symbols\Microsoft.CodeAnalysis.EditorFeatures.Wpf.3.10.0-3.21216.10.symbols.nupkg has broken SourceLink links
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 22, 2021
@jinujoseph jinujoseph removed the untriaged Issues and PRs which have not yet been triaged by a lead label Apr 28, 2021
@jinujoseph jinujoseph added the Bug label Apr 28, 2021
@jinujoseph jinujoseph added this to the 16.10.P3 milestone Apr 28, 2021
@jasonmalinowski
Copy link
Member

@tmat @dotnet/roslyn-infrastructure How is this supposed to work? Is some magic supposed to embed sources for generated files?

@jaredpar
Copy link
Member

@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.

@tmat
Copy link
Member

tmat commented Apr 28, 2021

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?

@jasonmalinowski
Copy link
Member

@tmat You would have been the one I'd ask that question to. What would it look like, what's the property name?

@tmat
Copy link
Member

tmat commented Apr 28, 2021

Trace EmbeddedFiles item group passed to the compiler.

@jasonmalinowski
Copy link
Member

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?

@jaredpar
Copy link
Member

@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.

@jasonmalinowski
Copy link
Member

@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. 😄

@clairernovotny
Copy link
Member

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.

@jasonmalinowski jasonmalinowski modified the milestones: 16.10.P3, 16.10 May 18, 2021
@jinujoseph jinujoseph modified the milestones: 16.10, 17.0 Jul 16, 2021
@jinujoseph jinujoseph modified the milestones: 17.0, 17.1 Oct 21, 2021
@jasonmalinowski jasonmalinowski modified the milestones: 17.1, 17.3 Mar 22, 2022
@jasonmalinowski jasonmalinowski removed their assignment Jul 6, 2022
@jasonmalinowski jasonmalinowski added the untriaged Issues and PRs which have not yet been triaged by a lead label Jul 6, 2022
@jasonmalinowski
Copy link
Member

Sending this back through triage -- I think this was assigned to me thinking it was related to source generators.

@vatsalyaagrawal vatsalyaagrawal removed the untriaged Issues and PRs which have not yet been triaged by a lead label Jul 8, 2022
@vatsalyaagrawal vatsalyaagrawal modified the milestones: 17.3, 17.4 Jul 8, 2022
@davidwengier
Copy link
Contributor

Confirmed this is still an issue with the latest packages

@davidwengier
Copy link
Contributor

... but of course when building locally the sources are embedded as expected. Joy.

@davidwengier
Copy link
Contributor

davidwengier commented Jul 12, 2022

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?

@RikkiGibson
Copy link
Contributor

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?

@davidwengier
Copy link
Contributor

Indeed, the binlog from the random build I linked above shows us embedding the source of these files correctly:
image

@arkalyanms arkalyanms modified the milestones: 17.4, 17.6 P3 Jan 17, 2023
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

10 participants