From 755a54de5fec18d1ce94af4f6b03a29a76711052 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 5 Dec 2023 11:50:20 +0100 Subject: [PATCH 1/3] nullness-related aggressive trimming of FSharp.Core --- src/FSharp.Core/ILLink.LinkAttributes.xml | 6 ++++++ src/FSharp.Core/ILLink.Substitutions.xml | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/FSharp.Core/ILLink.LinkAttributes.xml b/src/FSharp.Core/ILLink.LinkAttributes.xml index 70eba54ff4e..47a3ff01f02 100644 --- a/src/FSharp.Core/ILLink.LinkAttributes.xml +++ b/src/FSharp.Core/ILLink.LinkAttributes.xml @@ -169,5 +169,11 @@ + + + + + + diff --git a/src/FSharp.Core/ILLink.Substitutions.xml b/src/FSharp.Core/ILLink.Substitutions.xml index 42d44a0b4c4..13ceee32a14 100644 --- a/src/FSharp.Core/ILLink.Substitutions.xml +++ b/src/FSharp.Core/ILLink.Substitutions.xml @@ -4,5 +4,10 @@ + + + + + From abdcb0ea34af1458755e4c6b23372ed0cedf9ed9 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 5 Dec 2023 12:31:09 +0100 Subject: [PATCH 2/3] decreasing size thanks to new settings --- tests/AheadOfTime/Trimming/check.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/AheadOfTime/Trimming/check.ps1 b/tests/AheadOfTime/Trimming/check.ps1 index add84fdd2df..3074fad2710 100644 --- a/tests/AheadOfTime/Trimming/check.ps1 +++ b/tests/AheadOfTime/Trimming/check.ps1 @@ -40,7 +40,7 @@ function CheckTrim($root, $tfm, $outputfile, $expected_len) { # NOTE: Trimming now errors out on desktop TFMs, as shown below: # error NETSDK1124: Trimming assemblies requires .NET Core 3.0 or higher. $compressAllMetadata = $env:_kind -eq "-compressAllMetadata" -$expectedForSelfContained = if ($compressAllMetadata) {300032} else {288256} +$expectedForSelfContained = if ($compressAllMetadata) {288256} else {288256} # Check net7.0 trimmed assemblies CheckTrim -root "SelfContained_Trimming_Test" -tfm "net8.0" -outputfile "FSharp.Core.dll" -expected_len $expectedForSelfContained From e2967d7259d46b623762afe9d82a32b0068b51db Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 5 Dec 2023 13:16:25 +0100 Subject: [PATCH 3/3] Simplify trimcheck, compressed and normal should be the same --- tests/AheadOfTime/Trimming/check.ps1 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/AheadOfTime/Trimming/check.ps1 b/tests/AheadOfTime/Trimming/check.ps1 index 3074fad2710..d67d9c3ac88 100644 --- a/tests/AheadOfTime/Trimming/check.ps1 +++ b/tests/AheadOfTime/Trimming/check.ps1 @@ -1,7 +1,6 @@ function CheckTrim($root, $tfm, $outputfile, $expected_len) { Write-Host "Publish and Execute: ${tfm} - ${root}" Write-Host "Expecting ${expected_len}" - Write-Host "CompressAllMetadata value: ${compressAllMetadata}" $cwd = Get-Location Set-Location (Join-Path $PSScriptRoot "${root}") @@ -39,11 +38,9 @@ function CheckTrim($root, $tfm, $outputfile, $expected_len) { # NOTE: Trimming now errors out on desktop TFMs, as shown below: # error NETSDK1124: Trimming assemblies requires .NET Core 3.0 or higher. -$compressAllMetadata = $env:_kind -eq "-compressAllMetadata" -$expectedForSelfContained = if ($compressAllMetadata) {288256} else {288256} # Check net7.0 trimmed assemblies -CheckTrim -root "SelfContained_Trimming_Test" -tfm "net8.0" -outputfile "FSharp.Core.dll" -expected_len $expectedForSelfContained +CheckTrim -root "SelfContained_Trimming_Test" -tfm "net8.0" -outputfile "FSharp.Core.dll" -expected_len 288256 # Check net7.0 trimmed assemblies CheckTrim -root "StaticLinkedFSharpCore_Trimming_Test" -tfm "net8.0" -outputfile "StaticLinkedFSharpCore_Trimming_Test.dll" -expected_len 8821760