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

Merge master to nullness #6568

Merged
3 commits merged into from
Apr 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<ProductDependencies>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19210.7">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19217.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>4f645e4a5385eb96cad3f72f5ded239761c7d075</Sha>
<Sha>4e21d52dabbb9f5705a90f097acb1465a0354c0d</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
134 changes: 134 additions & 0 deletions eng/common/CheckSymbols.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
param(
[Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where NuGet packages to be checked are stored
[Parameter(Mandatory=$true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation
[Parameter(Mandatory=$true)][string] $SymbolToolPath # Full path to directory where dotnet symbol-tool was installed
)

Add-Type -AssemblyName System.IO.Compression.FileSystem

function FirstMatchingSymbolDescriptionOrDefault {
param(
[string] $FullPath, # Full path to the module that has to be checked
[string] $TargetServerParam # Parameter to pass to `Symbol Tool` indicating the server to lookup for symbols
)

$FileName = [System.IO.Path]::GetFileName($FullPath)
$Extension = [System.IO.Path]::GetExtension($FullPath)

# Those below are potential symbol files that the `dotnet symbol` might
# return. Which one will be returned depend on the type of file we are
# checking and which type of file was uploaded.

# The file itself is returned
$SymbolPath = $SymbolsPath + "\" + $FileName

# PDB file for the module
$PdbPath = $SymbolPath.Replace($Extension, ".pdb")

# PDB file for R2R module (created by crossgen)
$NGenPdb = $SymbolPath.Replace($Extension, ".ni.pdb")

# DBG file for a .so library
$SODbg = $SymbolPath.Replace($Extension, ".so.dbg")

# DWARF file for a .dylib
$DylibDwarf = $SymbolPath.Replace($Extension, ".dylib.dwarf")

.\dotnet-symbol.exe --symbols --modules $TargetServerParam $FullPath -o $SymbolsPath -d | Out-Null

if (Test-Path $PdbPath) {
return "PDB"
}
elseif (Test-Path $NGenPdb) {
return "NGen PDB"
}
elseif (Test-Path $SODbg) {
return "DBG for SO"
}
elseif (Test-Path $DylibDwarf) {
return "Dwarf for Dylib"
}
elseif (Test-Path $SymbolPath) {
return "Module"
}
else {
return $null
}
}

function CountMissingSymbols {
param(
[string] $PackagePath # Path to a NuGet package
)

# Ensure input file exist
if (!(Test-Path $PackagePath)) {
throw "Input file does not exist: $PackagePath"
}

# Extensions for which we'll look for symbols
$RelevantExtensions = @(".dll", ".exe", ".so", ".dylib")

# How many files are missing symbol information
$MissingSymbols = 0

$PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath)
$ExtractPath = $ExtractPath + $PackageId;
$SymbolsPath = $ExtractPath + $PackageId + ".Symbols";

[System.IO.Compression.ZipFile]::ExtractToDirectory($PackagePath, $ExtractPath)

# Makes easier to reference `symbol tool`
Push-Location $SymbolToolPath

Get-ChildItem -Recurse $ExtractPath |
Where-Object {$RelevantExtensions -contains $_.Extension} |
ForEach-Object {
Write-Host -NoNewLine "`t Checking file" $_.FullName "... "

$SymbolsOnMSDL = FirstMatchingSymbolDescriptionOrDefault $_.FullName "--microsoft-symbol-server"
$SymbolsOnSymWeb = FirstMatchingSymbolDescriptionOrDefault $_.FullName "--internal-server"

if ($SymbolsOnMSDL -ne $null -and $SymbolsOnSymWeb -ne $null) {
Write-Host "Symbols found on MSDL (" $SymbolsOnMSDL ") and SymWeb (" $SymbolsOnSymWeb ")"
}
else {
$MissingSymbols++

if ($SymbolsOnMSDL -eq $null -and $SymbolsOnSymWeb -eq $null) {
Write-Host "No symbols found on MSDL or SymWeb!"
}
else {
if ($SymbolsOnMSDL -eq $null) {
Write-Host "No symbols found on MSDL!"
}
else {
Write-Host "No symbols found on SymWeb!"
}
}
}
}

Pop-Location

return $MissingSymbols
}

function CheckSymbolsAvailable {
if (Test-Path $ExtractPath) {
Remove-Item -recurse $ExtractPath
}

Get-ChildItem "$InputPath\*.nupkg" |
ForEach-Object {
$FileName = $_.Name
Write-Host "Validating $FileName "
$Status = CountMissingSymbols "$InputPath\$FileName"

if ($Status -ne 0) {
Write-Error "Missing symbols for $Status modules in the package $FileName"
}
}
}

CheckSymbolsAvailable
8 changes: 6 additions & 2 deletions eng/common/internal/Tools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@
<PackageReference Include="Drop.App" Version="$(DropAppVersion)" ExcludeAssets="all" Condition="'$(UsingToolVisualStudioIbcTraining)' == 'true'"/>
</ItemGroup>
<PropertyGroup>
<RestoreSources>
https://devdiv.pkgs.visualstudio.com/_packaging/8f470c7e-ac49-4afe-a6ee-cf784e438b93/nuget/v3/index.json;
<RestoreSources></RestoreSources>
<RestoreSources Condition="'$(UsingToolIbcOptimization)' == 'true'">
https://devdiv.pkgs.visualstudio.com/_packaging/dotnet-core-internal-tooling/nuget/v3/index.json;
</RestoreSources>
<RestoreSources Condition="'$(UsingToolVisualStudioIbcTraining)' == 'true'">
$(RestoreSources);
https://devdiv.pkgs.visualstudio.com/_packaging/VS/nuget/v3/index.json;
</RestoreSources>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19210.7",
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19217.1",
"Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2"
}
}
8 changes: 8 additions & 0 deletions vsintegration/Vsix/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" />

<Target Name="GetVSGeneralVersion" Returns="$(VSGeneralVersion)">
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<MoreInfo>https://docs.microsoft.com/en-us/dotnet/articles/fsharp/</MoreInfo>
</Metadata>
<Installation Experimental="true">
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[|%CurrentProject%;GetVSGeneralVersion|]" />
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[|%CurrentProject%;GetVSGeneralVersion|,)" />
</Installation>
<Installer>
<Actions>
Expand Down
2 changes: 0 additions & 2 deletions vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,4 @@
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
</ItemGroup>

<Target Name="GetVSGeneralVersion" Returns="$(VSGeneralVersion)" />

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<MoreInfo>https://docs.microsoft.com/en-us/dotnet/articles/fsharp/</MoreInfo>
</Metadata>
<Installation Experimental="true">
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[15.0]" />
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[|%CurrentProject%;GetVSGeneralVersion|,)" />
</Installation>
<Dependencies>
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.6,)" />
Expand All @@ -21,7 +21,7 @@
<Asset Type="Microsoft.VisualStudio.ProjectTemplate" d:Source="Project" Path="ProjectTemplates" d:TargetPath="|LibraryProject;TemplateProjectOutputGroup|" d:ProjectName="LibraryProject" d:VsixSubPath="ProjectTemplates" />
</Assets>
<Prerequisites>
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,16.0)" DisplayName="Visual Studio core editor" />
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[|%CurrentProject%;GetVSGeneralVersion|,)" DisplayName="Visual Studio core editor" />
</Prerequisites>

</PackageManifest>
Expand Down