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

Add SourceLink #5619

Closed
KirillOsenkov opened this issue Nov 1, 2019 · 18 comments · Fixed by #8464
Closed

Add SourceLink #5619

KirillOsenkov opened this issue Nov 1, 2019 · 18 comments · Fixed by #8464
Assignees
Labels
Area-Infrastructure Relates to build, test & run infrastructure of this repo. Resolution-Fixed The bug has been fixed, refer to the milestone to see in which release it was fixed.
Milestone

Comments

@KirillOsenkov
Copy link
Member

Microsoft.VisualStudio.ProjectSystem.Managed.dll doesn't appear to be SourceLinked. Would be super nice to add SourceLink for easier debugging.

@jmarolf
Copy link
Contributor

jmarolf commented Nov 1, 2019

@tmat can you point me to the targests in arcade that do sourcelink? I think the easiest way forward is to copy those

@tmat
Copy link
Member

tmat commented Nov 1, 2019

@jmarolf Is Project System official built done from an internal mirror in dnceng/devdiv? If not, you can just add a package reference to Microsoft.SourceLink.GitHub package. You don't need anything special.

Is there a plan to move PS to Arcade?

@jmarolf
Copy link
Contributor

jmarolf commented Nov 1, 2019

Is there a plan to move PS to Arcade?

No arcade is all about shipping as part of the .NET Core SDK and has very little support for VSIXes shipping in Visual Studio. As a VS only component 90% of arcade is noise to us

@tmat
Copy link
Member

tmat commented Nov 1, 2019

That's not quite true. We use Arcade for Interactive Window repo as well.

@tmat
Copy link
Member

tmat commented Nov 1, 2019

This repo is using RepoToolset which is no longer maintained. Arcade SDK is.

@jmarolf
Copy link
Contributor

jmarolf commented Nov 1, 2019

That's not quite true. We use Arcade for Interactive Window repo as well.

Does it build out of dnceng internal like arcade recommends?

@tmat
Copy link
Member

tmat commented Nov 1, 2019

Not currently, I was about to switch to that if possible. Whether the official builds build from devdiv or dnceng is orthogonal to Arcade though. Roslyn also builds from devdiv currently.

@jmarolf
Copy link
Contributor

jmarolf commented Nov 3, 2019

Alright, there is no easy path forward. The existing repotoolset targets set out-of-date properties that interfere with sourcelink. We either need to move off of repotoolset entirely or move to arcade.

I'll leave this decision up to @drewnoakes and @davkean and the @dotnet/project-system team to decide

@davkean
Copy link
Member

davkean commented Nov 4, 2019

The existing repotoolset targets set out-of-date properties that interfere with sourcelink. We either need to move off of repotoolset entirely or move to arcade.

Can you point me to this conclusion?

@jmarolf
Copy link
Contributor

jmarolf commented Nov 4, 2019

@davkean pull down the branch from #5620

you will get this build error

         C:\Users\vsagent\.nuget\packages\roslyntools.repotoolset\1.0.0-beta-62705-01\tools\RepositoryInfo.targets(65,5): error : SourceRoot contains duplicate items 'F:\workspace\_work\1\s\' with conflicting metadata 'SourceControl': 'git' and 'Git' [F:\workspace\_work\1\s\setup\ProjectSystemSetup\ProjectSystemSetup.csproj]
         C:\Users\vsagent\.nuget\packages\roslyntools.repotoolset\1.0.0-beta-62705-01\tools\RepositoryInfo.targets(65,5): error : SourceRoot contains duplicate items 'F:\workspace\_work\1\s\' with conflicting metadata 'SourceControl': 'git' and 'Git' [F:\workspace\_work\1\s\setup\ProjectSystemSetup\ProjectSystemSetup.csproj]

looking at the binlog (that is in spanish? I guess we have all the binlogs written to the same place?) you can see the two sourcelink targets interact.

Target Name=GenerateSourceLinkFile Project=Microsoft.VisualStudio.AppDesigner.vbproj
    Target Name=InitializeSourceControlInformation Project=Microsoft.VisualStudio.AppDesigner.vbproj
        Target Name=_InitializeSourceControlInformationFromSourceControlManager Project=Microsoft.VisualStudio.AppDesigner.vbproj
            Target Name=InitializeSourceControlInformationFromSourceControlManager Project=Microsoft.VisualStudio.AppDesigner.vbproj
                Usando la tarea "Microsoft.Build.Tasks.Git.LocateRepository" del ensamblado "C:\Users\vsagent\.nuget\packages\microsoft.build.tasks.git\1.0.0-beta2-19367-01\build\..\tools\net461\Microsoft.Build.Tasks.Git.dll".
                Microsoft.Build.Tasks.Git.LocateRepository
                    Parámetro de tarea:Path=F:\workspace\_work\1\s\src\Microsoft.VisualStudio.AppDesigner
                    Propiedad de salida: _GitRepositoryId=F:\workspace\_work\1\s\.git
                    Propiedad de salida: ScmRepositoryUrl=https://github.com/dotnet/project-system
                    Elementos de salida: 
    SourceRoot=
        F:\workspace\_work\1\s\
                RevisionId=ef53af941c46faeeef456c7995013dfff835416e
                ScmRepositoryUrl=https://github.com/dotnet/project-system
                SourceControl=git
                    Propiedad de salida: SourceRevisionId=ef53af941c46faeeef456c7995013dfff835416e
                Propiedad establecida: RepositoryType=git
            Target Name=_SourceLinkHasSingleProvider Project=Microsoft.VisualStudio.AppDesigner.vbproj
                Usando la tarea "Microsoft.SourceLink.Common.SourceLinkHasSingleProvider" del ensamblado "C:\Users\vsagent\.nuget\packages\microsoft.sourcelink.common\1.0.0-beta2-19367-01\build\..\tools\net461\Microsoft.SourceLink.Common.dll".
                Microsoft.SourceLink.Common.SourceLinkHasSingleProvider
                    Parámetro de tarea:ProviderTargets=;_InitializeGitHubSourceLinkUrl
                    Propiedad de salida: SourceLinkHasSingleProvider=True
            Target Name=TranslateGitHubUrlsInSourceControlInformation Project=Microsoft.VisualStudio.AppDesigner.vbproj
                Usando la tarea "Microsoft.SourceLink.GitHub.TranslateRepositoryUrls" del ensamblado "C:\Users\vsagent\.nuget\packages\microsoft.sourcelink.github\1.0.0-beta2-19367-01\build\..\tools\net461\Microsoft.SourceLink.GitHub.dll".
                Microsoft.SourceLink.GitHub.TranslateRepositoryUrls
                    Parámetro de tarea:RepositoryUrl=https://github.com/dotnet/project-system
                    Parámetro de tarea:
    SourceRoots=
        F:\workspace\_work\1\s\
                RevisionId=ef53af941c46faeeef456c7995013dfff835416e
                ScmRepositoryUrl=https://github.com/dotnet/project-system
                SourceControl=git
                    Parámetro de tarea:
    Hosts=
        github.com
                ContentUrl=https://raw.githubusercontent.com
                    Parámetro de tarea:IsSingleProvider=True
                    Propiedad de salida: ScmRepositoryUrl=https://github.com/dotnet/project-system
                    Elementos de salida: 
    _TranslatedSourceRoot=
        F:\workspace\_work\1\s\
                RevisionId=ef53af941c46faeeef456c7995013dfff835416e
                ScmRepositoryUrl=https://github.com/dotnet/project-system
                SourceControl=git
                Elementos quitados: 
    SourceRoot=
        F:\workspace\_work\1\s\
                RevisionId=ef53af941c46faeeef456c7995013dfff835416e
                ScmRepositoryUrl=https://github.com/dotnet/project-system
                SourceControl=git
                Elementos agregados: 
    SourceRoot=
        F:\workspace\_work\1\s\
                RevisionId=ef53af941c46faeeef456c7995013dfff835416e
                ScmRepositoryUrl=https://github.com/dotnet/project-system
                SourceControl=git
            Target Name=SourceControlManagerPublishTranslatedUrls Project=Microsoft.VisualStudio.AppDesigner.vbproj
                Propiedad establecida: PrivateRepositoryUrl=https://github.com/dotnet/project-system
    Target Name=_GenerateSourceLinkFile Project=Microsoft.VisualStudio.AppDesigner.vbproj
        Target Name=InitializeSourceLinkUrl Project=Microsoft.VisualStudio.AppDesigner.vbproj
            Target Name=InitializeSourceRoot Project=Microsoft.VisualStudio.AppDesigner.vbproj
                Target Name=_InitializeSourceRootFromSourceControl Project=Microsoft.VisualStudio.AppDesigner.vbproj
                    Se omitió la tarea "Error" debido a una condición falsa (False); ('$(GitHeadSha.Length)' != '40') se evaluó como ('40' != '40').
                    Propiedad establecida: _RepositoryRawUrl=
                    Propiedad establecida: _RepositoryRawUrl=https://raw.githubusercontent.com/dotnet/project-system
                    Se omitió la tarea "Error" debido a una condición falsa (False); ('$(_RepositoryRawUrl)' == '') se evaluó como ('https://raw.githubusercontent.com/dotnet/project-system' == '').
                    Elementos agregados: 
    SourceRoot=
        F:\workspace\_work\1\s\
                SourceControl=Git
                SourceLinkUrl=https://raw.githubusercontent.com/dotnet/project-system/ef53af941c46faeeef456c7995013dfff835416e/*
                Se omitió la tarea "Error" debido a una condición falsa (False); ('@(_InvalidSourceRoot)' != '') se evaluó como ('' != '').
                Usando la tarea "MapSourceRoots" del ensamblado "C:\Users\vsagent\.nuget\packages\microsoft.net.compilers\3.3.0-beta3-19415-01\tools\Microsoft.Build.Tasks.CodeAnalysis.dll".
                MapSourceRoots
                    Parámetro de tarea:
    SourceRoots=
        F:\workspace\_work\1\s\
                RepositoryUrl=https://github.com/dotnet/project-system
                RevisionId=ef53af941c46faeeef456c7995013dfff835416e
                ScmRepositoryUrl=https://github.com/dotnet/project-system
                SourceControl=git
        F:\workspace\_work\1\s\
                SourceControl=Git
                SourceLinkUrl=https://raw.githubusercontent.com/dotnet/project-system/ef53af941c46faeeef456c7995013dfff835416e/*
                    Errors
                        C:\Users\vsagent\.nuget\packages\roslyntools.repotoolset\1.0.0-beta-62705-01\tools\RepositoryInfo.targets(65,5): SourceRoot contiene elementos duplicados "F:\workspace\_work\1\s\" con metadatos en conflicto "SourceControl": "git" y "Git" [F:\workspace\_work\1\s\src\Microsoft.VisualStudio.AppDesigner\Microsoft.VisualStudio.AppDesigner.vbproj]
                        C:\Users\vsagent\.nuget\packages\roslyntools.repotoolset\1.0.0-beta-62705-01\tools\RepositoryInfo.targets(65,5): SourceRoot contiene elementos duplicados "F:\workspace\_work\1\s\" con metadatos en conflicto "SourceControl": "git" y "Git" [F:\workspace\_work\1\s\src\Microsoft.VisualStudio.AppDesigner\Microsoft.VisualStudio.AppDesigner.vbproj]
                    Elementos de salida: 
    _MappedSourceRoot=
        F:\workspace\_work\1\s\
                MappedPath=F:\workspace\_work\1\s\
                OriginalItemSpec=F:\workspace\_work\1\s\
                RepositoryUrl=https://github.com/dotnet/project-system
                RevisionId=ef53af941c46faeeef456c7995013dfff835416e
                ScmRepositoryUrl=https://github.com/dotnet/project-system
                SourceControl=git
                SourceLinkUrl=https://raw.githubusercontent.com/dotnet/project-system/ef53af941c46faeeef456c7995013dfff835416e/*
                Elementos quitados: 
    SourceRoot=
        F:\workspace\_work\1\s\
                RepositoryUrl=https://github.com/dotnet/project-system
                RevisionId=ef53af941c46faeeef456c7995013dfff835416e
                ScmRepositoryUrl=https://github.com/dotnet/project-system
                SourceControl=git
        F:\workspace\_work\1\s\
                SourceControl=Git
                SourceLinkUrl=https://raw.githubusercontent.com/dotnet/project-system/ef53af941c46faeeef456c7995013dfff835416e/*
                Elementos agregados: 
    SourceRoot=
        F:\workspace\_work\1\s\
                MappedPath=F:\workspace\_work\1\s\
                OriginalItemSpec=F:\workspace\_work\1\s\
                RepositoryUrl=https://github.com/dotnet/project-system
                RevisionId=ef53af941c46faeeef456c7995013dfff835416e
                ScmRepositoryUrl=https://github.com/dotnet/project-system
                SourceControl=git
                SourceLinkUrl=https://raw.githubusercontent.com/dotnet/project-system/ef53af941c46faeeef456c7995013dfff835416e/*
        Compilando completamente el destino "_GenerateSourceLinkFile".
        No se especificaron archivos de entrada.
        Usando la tarea "GenerateSourceLinkFile" del ensamblado "C:\Users\vsagent\.nuget\packages\microsoft.sourcelink.common\1.0.0-beta2-19367-01\build\..\tools\net461\Microsoft.SourceLink.Common.dll".
        GenerateSourceLinkFile
            Parámetro de tarea:
    SourceRoots=
        F:\workspace\_work\1\s\
                MappedPath=F:\workspace\_work\1\s\
                OriginalItemSpec=F:\workspace\_work\1\s\
                RepositoryUrl=https://github.com/dotnet/project-system
                RevisionId=ef53af941c46faeeef456c7995013dfff835416e
                ScmRepositoryUrl=https://github.com/dotnet/project-system
                SourceControl=git
                SourceLinkUrl=https://raw.githubusercontent.com/dotnet/project-system/ef53af941c46faeeef456c7995013dfff835416e/*
            Parámetro de tarea:OutputFile=F:\workspace\_work\1\s\artifacts\Debug\obj\Microsoft.VisualStudio.AppDesigner\Microsoft.VisualStudio.AppDesigner.sourcelink.json
        Elementos agregados: FileWrites=F:\workspace\_work\1\s\artifacts\Debug\obj\Microsoft.VisualStudio.AppDesigner\Microsoft.VisualStudio.AppDesigner.sourcelink.json

@davkean
Copy link
Member

davkean commented Nov 4, 2019

Okay thanks, I think we can handle that without throwing the baby out with the bath water.

@davkean davkean added this to the Backlog milestone Nov 4, 2019
@davkean davkean added the Area-Infrastructure Relates to build, test & run infrastructure of this repo. label Nov 4, 2019
@jmarolf
Copy link
Contributor

jmarolf commented Nov 4, 2019

I suppose some careful over-ridding of targets could make things work. I will freely admit that is beyond me. Look forward to seeing the solution

@jjmew jjmew added the Triage-Approved Reviewed and prioritized label Jan 10, 2020
@MiYanni MiYanni removed this from the Backlog milestone Jul 27, 2022
@MiYanni MiYanni removed the Triage-Approved Reviewed and prioritized label Jul 27, 2022
@MiYanni
Copy link
Member

MiYanni commented Jul 27, 2022

Putting this back for review since it seems the work on this was being complicated by roslyn-tools. Since we don't use roslyn-tools anymore, this is likely easier to do. Personally, I don't know anything about SourceLink though.

@drewnoakes
Copy link
Member

@MiYanni I've set up source link for NuGet packages before so may be able to help if you wanted to pick this up.

https://github.com/dotnet/sourcelink#using-source-link-in-net-projects

One tip is to use NuGet Package Explorer to verify the SourceLink configuration for a .nupkg file. It will tell you if it's configured correctly, which will save a lot of time.

@KirillOsenkov
Copy link
Member Author

yeah it's pretty much

<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />

@ocallesp ocallesp self-assigned this Aug 19, 2022
@ocallesp
Copy link
Contributor

Assigning this to me since this can help ramp-up in with dotnet/sdk#1458

@AArnott
Copy link
Contributor

AArnott commented Sep 2, 2022

Yes, please do this. Debugging this assembly from outside the team is no fun without source code.

@drewnoakes drewnoakes added this to the 17.4 milestone Sep 5, 2022
@MiYanni MiYanni assigned MiYanni and unassigned ocallesp Sep 8, 2022
@MiYanni
Copy link
Member

MiYanni commented Sep 8, 2022

I've ended up figuring it out after running into an issue that Andrew actually created. dotnet/sourcelink#492
PR will be created shortly.

@ghost ghost added the Resolution-Fixed The bug has been fixed, refer to the milestone to see in which release it was fixed. label Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure Relates to build, test & run infrastructure of this repo. Resolution-Fixed The bug has been fixed, refer to the milestone to see in which release it was fixed.
Projects
None yet
10 participants