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

Please add SourceLink data to the nupkg/pdbs #2016

Closed
shueybubbles opened this issue Apr 24, 2023 · 9 comments
Closed

Please add SourceLink data to the nupkg/pdbs #2016

shueybubbles opened this issue Apr 24, 2023 · 9 comments

Comments

@shueybubbles
Copy link

To simplify debugging of SqlClient issues in the wild, having source links in the package and PDBs would be very helpful. See https://github.com/dotnet/sourcelink

@cheenamalhotra
Copy link
Member

We used to have sourcelinked symbols in SqlClient (you can find them until 4.0.0-preview2 - after that they went missing)
Missing since https://www.nuget.org/packages/Microsoft.Data.SqlClient/4.0.0-preview3.21293.2 🤔

@JRahnama JRahnama added the 🆕 Triage Needed For new issues, not triaged yet. label Apr 24, 2023
@paulomorgado
Copy link

Collect a binlog of the build (https://aka.ms/msbuildlog) and see why source linking is not being lost.

@JRahnama
Copy link
Contributor

the only related change I can see is PR #1325 between 4.0.0-preview2 and 4.0.0-preview3. I will look into it.

@cheenamalhotra
Copy link
Member

'BuildForRelease' should be enabled in pipelines, you may wanna review that.

You can also test locally with /p:BuildForRelease=true specified it source links are available in PDBs.. but for .NET Core I see it's not source-linking even with enabled flag on latest main (it used to until 4.0.0-p2), so that seems like another issue.

@JRahnama JRahnama removed the 🆕 Triage Needed For new issues, not triaged yet. label Apr 25, 2023
@paulomorgado
Copy link

Tried to build with msbuild -bl -restore -t:rebuild -p:BuildForRelease=true .\Microsoft.Data.SqlClient.sln and got these errors:

"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient.sln" (rebuild target) (1:2) ->
"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj.metaproj" (Rebuild target) (26) ->
"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" (Rebuild target) (6:14) ->
"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" (Build target) (6:17) ->
"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\add-ons\AzureKeyVaultProvider\Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.cspr
oj" (default target) (15:27) ->
"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\netcore\src\Microsoft.Data.SqlClient.csproj" (GetTargetPath target) (7:53) ->
  C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\netcore\src\Microsoft.Data.SqlClient.csproj : error MSB4057: The target "GetTargetPath" does not
 exist in the project.


"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient.sln" (rebuild target) (1:2) ->
"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj.metaproj" (Rebuild target) (26) ->
"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" (Rebuild target) (6:14) ->
"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" (Build target) (6:17) ->
"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\add-ons\AzureKeyVaultProvider\Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.cspr
oj" (default target) (15:27) ->
"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\netcore\ref\Microsoft.Data.SqlClient.csproj" (GetTargetPath target) (13:18) ->
  C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\netcore\ref\Microsoft.Data.SqlClient.csproj : error MSB4057: The target "GetTargetPath" does not
 exist in the project.


"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient.sln" (rebuild target) (1:2) ->
"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj.metaproj" (Rebuild target) (26) ->
"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" (Rebuild target) (6:14) ->
"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" (Build target) (6:18) ->
"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\add-ons\AzureKeyVaultProvider\Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.cspr
oj" (default target) (15:28) ->
"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\netcore\ref\Microsoft.Data.SqlClient.csproj" (GetTargetPath target) (13:19) ->
  C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\netcore\ref\Microsoft.Data.SqlClient.csproj : error MSB4057: The target "GetTargetPath" does not
 exist in the project.


"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient.sln" (rebuild target) (1:2) ->
"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\Docker\DockerLinuxTest\Microsoft.Data.SqlClient.DockerLinuxTest.csproj" (Rebuild target) (2
1:6) ->
(CoreCompile target) ->
  C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\Docker\DockerLinuxTest\Program.cs(19,20): error CS0246: The type or namespace name 'SqlCon
nection' could not be found (are you missing a using directive or an assembly reference?) [C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\D
ocker\DockerLinuxTest\Microsoft.Data.SqlClient.DockerLinuxTest.csproj]
  C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\Docker\DockerLinuxTest\Program.cs(19,54): error CS0246: The type or namespace name 'SqlCon
nection' could not be found (are you missing a using directive or an assembly reference?) [C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\D
ocker\DockerLinuxTest\Microsoft.Data.SqlClient.DockerLinuxTest.csproj]


"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient.sln" (rebuild target) (1:2) ->
"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\PerformanceTests\Microsoft.Data.SqlClient.PerformanceTests.csproj" (Rebuild target) (22:10)
 ->
"C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\PerformanceTests\Microsoft.Data.SqlClient.PerformanceTests.csproj" (Build target) (22:12) -
>
  C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\PerformanceTests\DBFramework\DbUtils.cs(26,58): error CS0246: The type or namespace name '
SqlConnection' could not be found (are you missing a using directive or an assembly reference?) [C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\t
ests\PerformanceTests\Microsoft.Data.SqlClient.PerformanceTests.csproj::TargetFramework=net6.0]
  C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\PerformanceTests\DBFramework\Table.cs(123,34): error CS0246: The type or namespace name 'S
qlConnection' could not be found (are you missing a using directive or an assembly reference?) [C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\te
sts\PerformanceTests\Microsoft.Data.SqlClient.PerformanceTests.csproj::TargetFramework=net6.0]
  C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\PerformanceTests\BenchmarkRunners\DataTypeReaderRunner.cs(12,24): error CS0246: The type o
r namespace name 'SqlConnection' could not be found (are you missing a using directive or an assembly reference?) [C:\Projects\GH\dotnet\SqlClient\src\Microsof
t.Data.SqlClient\tests\PerformanceTests\Microsoft.Data.SqlClient.PerformanceTests.csproj::TargetFramework=net6.0]
  C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\PerformanceTests\DBFramework\Table.cs(141,52): error CS0246: The type or namespace name 'S
qlConnection' could not be found (are you missing a using directive or an assembly reference?) [C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\te
sts\PerformanceTests\Microsoft.Data.SqlClient.PerformanceTests.csproj::TargetFramework=net6.0]
  C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\PerformanceTests\DBFramework\Table.cs(154,31): error CS0246: The type or namespace name 'S
qlConnection' could not be found (are you missing a using directive or an assembly reference?) [C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\te
sts\PerformanceTests\Microsoft.Data.SqlClient.PerformanceTests.csproj::TargetFramework=net6.0]
  C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\PerformanceTests\BenchmarkRunners\SqlBulkCopyRunner.cs(99,17): error CS0246: The type or n
amespace name 'SqlBulkCopy' could not be found (are you missing a using directive or an assembly reference?) [C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Dat
a.SqlClient\tests\PerformanceTests\Microsoft.Data.SqlClient.PerformanceTests.csproj::TargetFramework=net6.0]
  C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\PerformanceTests\BenchmarkRunners\SqlBulkCopyRunner.cs(19,24): error CS0246: The type or n
amespace name 'SqlConnection' could not be found (are you missing a using directive or an assembly reference?) [C:\Projects\GH\dotnet\SqlClient\src\Microsoft.D
ata.SqlClient\tests\PerformanceTests\Microsoft.Data.SqlClient.PerformanceTests.csproj::TargetFramework=net6.0]
  C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\PerformanceTests\BenchmarkRunners\SqlCommandRunner.cs(13,24): error CS0246: The type or na
mespace name 'SqlConnection' could not be found (are you missing a using directive or an assembly reference?) [C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Da
ta.SqlClient\tests\PerformanceTests\Microsoft.Data.SqlClient.PerformanceTests.csproj::TargetFramework=net6.0]
  C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\PerformanceTests\BenchmarkRunners\SqlBulkCopyRunner.cs(20,24): error CS0246: The type or n
amespace name 'SqlCommand' could not be found (are you missing a using directive or an assembly reference?) [C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data
.SqlClient\tests\PerformanceTests\Microsoft.Data.SqlClient.PerformanceTests.csproj::TargetFramework=net6.0]
  C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\tests\PerformanceTests\BenchmarkRunners\SqlBulkCopyRunner.cs(21,24): error CS0246: The type or n
amespace name 'SqlDataReader' could not be found (are you missing a using directive or an assembly reference?) [C:\Projects\GH\dotnet\SqlClient\src\Microsoft.D
ata.SqlClient\tests\PerformanceTests\Microsoft.Data.SqlClient.PerformanceTests.csproj::TargetFramework=net6.0]

What's this GetTargetPath target and why is it not being found?

@paulomorgado
Copy link

Compiling with dotnet msbuild -bl -restore -t:rebuild -p:Configuration=Release -p:BuildForRelease=true C:\Projects\GH\dotnet\SqlClient\src\Microsoft.Data.SqlClient\netcore\src\Microsoft.Data.SqlClient.csproj added this to the PDBs:

{
  "documents" : {
    "C:\\Projects\\GH\\dotnet\\SqlClient\\*" : "https://raw.githubusercontent.com/dotnet/SqlClient/4657311f9b3f308233bd8682d462351e35bc333e/*"
  }
}

The source linking information seems to be added to the PDBs.

I find the whole repo and build overly complex and hard to follow.

@shueybubbles
Copy link
Author

I concur on the complexity being too much. It's reflected in the nuget package - why do we need separate ref assemblies from the lib assemblies? Why is there a copy of the netfx binary in both runtimes and lib\net462 folder when they are identical? This build would be easier to maintain with fewer outputs and a simpler package. Developers would like package size reductions for faster builds anyway.

@paulomorgado
Copy link

@shueybubbles, ref assemblies are good for design-time, because they are smaller and require less design-time resources.

@David-Engel
Copy link
Contributor

Done in #2137

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

No branches or pull requests

5 participants