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 trimming XML files to FSharp.Core. #13853

Merged
merged 22 commits into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
bd53a55
Add ILLink xml files to FSharp.Core.
teo-tsirpanis Sep 7, 2022
768973a
Trim away the compressed blobs if they exist.
teo-tsirpanis Sep 8, 2022
7451e0e
Merge branch 'main' into illink-xmlfiles
dsyme Sep 8, 2022
93c0253
Merge branch 'main' into illink-xmlfiles
vzarytovskii Sep 9, 2022
acdf1fe
Merge branch 'main' into illink-xmlfiles
KevinRansom Sep 11, 2022
44b158b
Added a very basic test project to test trimming
vzarytovskii Sep 12, 2022
b899713
Added a very basic test project to test trimming(2)
vzarytovskii Sep 12, 2022
05ed005
Added a very basic test project to test trimming(3)
vzarytovskii Sep 12, 2022
57d3da7
Added a very basic test project to test trimming(4)
vzarytovskii Sep 12, 2022
de0e6fa
Added a very basic test project to test trimming(5)
vzarytovskii Sep 12, 2022
5301c88
Added a very basic test project to test trimming(6)
vzarytovskii Sep 13, 2022
2828dff
Merge branch 'main' into illink-xmlfiles
vzarytovskii Sep 13, 2022
d9e4656
Added a very basic test project to test trimming(7)
vzarytovskii Sep 13, 2022
0098bf8
Added a very basic test project to test trimming(8)
vzarytovskii Sep 13, 2022
f0a8719
Added a very basic test project to test trimming(9)
vzarytovskii Sep 13, 2022
2135010
Added a very basic test project to test trimming(10)
vzarytovskii Sep 13, 2022
3f980ab
Merge branch 'main' into illink-xmlfiles
vzarytovskii Sep 13, 2022
1feb0d1
Added a very basic test project to test trimming(11)
vzarytovskii Sep 13, 2022
a90e98b
Added a very basic test project to test trimming(12)
vzarytovskii Sep 13, 2022
d08ae14
Merge branch 'main' into illink-xmlfiles
vzarytovskii Sep 13, 2022
2881e80
Merge remote-tracking branch 'upstream/main' into illink-xmlfiles
vzarytovskii Sep 14, 2022
0ddaeb4
Fix trimming tests
vzarytovskii Sep 14, 2022
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
44 changes: 44 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,50 @@ stages:
DOTNET_ROLL_FORWARD_TO_PRERELEASE: 1
displayName: Regular rebuild of FSharp.Compiler.Service.sln

# Test trimming on Windows
- job: Build_And_Test_Trimming_Windows
pool:
name: NetCore-Public
demands: ImageOverride -equals $(WindowsMachineQueueName)
strategy:
maxParallel: 2
matrix:
compressed_metadata:
_kind: "-compressAllMetadata"
classic_metadata:
_kind: ""
variables:
- name: _BuildConfig
value: Release
steps:
- checkout: self
clean: true
- task: UseDotNet@2
displayName: install SDK
inputs:
packageType: sdk
useGlobalJson: true
includePreviewVersions: true
workingDirectory: $(Build.SourcesDirectory)
installationPath: $(Agent.ToolsDirectory)/dotnet
- script: dotnet --list-sdks
displayName: Report dotnet SDK versions
- script: .\Build.cmd $(_kind) -pack -c $(_BuildConfig)
displayName: Initial build and prepare packages.
- script: dotnet publish -c $(_BuildConfig) -bl:\"./bin/$(_BuildConfig)/net7.0/win-x64/publish/Trimming.binlog\"
displayName: Build and publish a trim test package.
workingDirectory: $(Build.SourcesDirectory)/tests/projects/SelfContained_Trimming_Test
- script: .\check.cmd
displayName: Check the state of the trimmed app.
workingDirectory: $(Build.SourcesDirectory)/tests/projects/SelfContained_Trimming_Test
- task: PublishPipelineArtifact@1
displayName: Publish Trim Tests Logs
inputs:
targetPath: '$(Build.SourcesDirectory)/tests/projects/SelfContained_Trimming_Test/bin/$(_BuildConfig)/net7.0/win-x64/publish'
artifactName: 'Trim Test Logs Attempt $(System.JobAttempt) Logs $(_kind)'
continueOnError: true
condition: always()

# Arcade-powered source build
# turned off until https://github.com/dotnet/source-build/issues/1795 is fixed
# - template: /eng/common/templates/jobs/jobs.yml
Expand Down
2 changes: 2 additions & 0 deletions src/FSharp.Core/FSharp.Core.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
<GeneratedModuleName>Microsoft.FSharp.Core.SR</GeneratedModuleName>
<Link>FSCore.resx</Link>
</EmbeddedResource>
<EmbeddedResource Include="ILLink.LinkAttributes.xml" LogicalName="ILLink.LinkAttributes.xml" />
<EmbeddedResource Include="ILLink.Substitutions.xml" LogicalName="ILLink.Substitutions.xml" />
<CompileBefore Include="prim-types-prelude.fsi">
<Link>Primitives/prim-types-prelude.fsi</Link>
</CompileBefore>
Expand Down
167 changes: 167 additions & 0 deletions src/FSharp.Core/ILLink.LinkAttributes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
<linker>
<!--
Attributes listed below here should be behind the 'System.AggressiveAttributeTrimming' feature switch, which
is only enabled by default on app models that need as much size savings as possible.
-->
<assembly fullname="FSharp.Core" feature="System.AggressiveAttributeTrimming" featurevalue="true">
<!-- Microsoft.FSharp.Core -->
<type fullname="Microsoft.FSharp.Core.AbstractClassAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.AutoOpenAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.AutoSerializableAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.ClassAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.CLIEventAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.CLIMutableAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.ComparisonConditionalOnAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.CompilationArgumentCountsAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.CompilationSourceNameAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.CompiledNameAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.CompilerMessageAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.CustomComparisonAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.CustomEqualityAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.CustomOperationAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.DefaultAugmentationAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.DefaultValueAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.EntryPointAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.EqualityConditionalOnAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.ExperimentalAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.GeneralizableValueAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.InlineIfLambdaAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.FSharpInterfaceDataVersionLiteralAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.MeasureAnnotatedAbbreviationAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.MeasureAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.NoComparisonAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.NoDynamicInvocationAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.NoEqualityAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.OptionalArgumentAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.ProjectionParameterAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.ReferenceEqualityAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.ReflectedDefinitionAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.RequireQualifiedAccessAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.RequiresExplicitTypeArgumentsAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.SealedAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.StructAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.StructuralComparisonAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.StructuralEqualityAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.UnverifiableAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.ValueAsStaticPropertyAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.VolatileFieldAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>

<!-- The following attributes are accessed by FSharp.Core at runtime.
Removing them would cause behavior changes but the feature switch allows them. -->
<type fullname="Microsoft.FSharp.Core.AllowNullLiteralAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.CompilationMappingAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.CompilationRepresentationAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.StructuredFormatDisplayAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>

<!-- Microsoft.FSharp.Core.CompilerServices -->
<type fullname="Microsoft.FSharp.Core.CompilerServices.NoEagerConstraintApplicationAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.CompilerServices.TypeProviderAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.CompilerServices.TypeProviderEditorHideMethodsAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="Microsoft.FSharp.Core.CompilerServices.TypeProviderXmlDocAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
</assembly>
</linker>
8 changes: 8 additions & 0 deletions src/FSharp.Core/ILLink.Substitutions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<linker>
<assembly fullname="FSharp.Core">
<resource name="FSharpOptimizationCompressedData.FSharp.Core" action="remove" />
<resource name="FSharpOptimizationInfo.FSharp.Core" action="remove" />
<resource name="FSharpSignatureCompressedData.FSharp.Core" action="remove" />
<resource name="FSharpSignatureInfo.FSharp.Core" action="remove" />
</assembly>
</linker>
16 changes: 16 additions & 0 deletions tests/projects/SelfContained_Trimming_Test/NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<packageSources>
<clear />
<add key="localPackages" value="../../../artifacts/packages/Release/Release"/>
</packageSources>
<disabledPackageSources>
<clear />
</disabledPackageSources>
<fallbackPackageFolders>
<clear />
</fallbackPackageFolders>
</configuration>
Loading