Skip to content

Commit eb206ff

Browse files
committed
Merge branch 'for-loop-optimization' of https://github.com/albert-du/fsharp into for-loop-optimization
2 parents 76f22df + 90154f1 commit eb206ff

File tree

113 files changed

+2228
-1175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+2228
-1175
lines changed

FSharpBuild.Directory.Build.props

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
<DisableAutoSetFscCompilerPath>true</DisableAutoSetFscCompilerPath>
1414
</PropertyGroup>
1515

16+
<PropertyGroup Condition="'$(Configuration)' == 'Proto'">
17+
<FSCoreVersion>$(FSCoreShippedVersion)</FSCoreVersion>
18+
</PropertyGroup>
19+
1620
<PropertyGroup>
1721
<FSharpSourcesRoot>$(RepoRoot)src</FSharpSourcesRoot>
1822
<FSharpTestsRoot>$(RepoRoot)tests</FSharpTestsRoot>
@@ -21,6 +25,7 @@
2125
<ValueTupleImplicitPackageVersion>4.4.0</ValueTupleImplicitPackageVersion>
2226
<WarningsAsErrors>1182;0025;$(WarningsAsErrors)</WarningsAsErrors>
2327
<OtherFlags>$(OtherFlags) --nowarn:3384</OtherFlags>
28+
<OtherFlags>$(OtherFlags) --times --nowarn:75</OtherFlags>
2429
</PropertyGroup>
2530

2631
<!-- nuget -->
@@ -79,6 +84,16 @@
7984
<DefineConstants>$(DefineConstants);TESTING_ON_LINUX</DefineConstants>
8085
</PropertyGroup>
8186

87+
88+
<!-- CompressAllMetadata is a switch set by the CI to do a test pass where we compress the metadata for the assemblies -->
89+
<!-- We don't compress the proto-compiler yet, because no shipped compiler, and the arcade compiler don't yet support compression -->
90+
<PropertyGroup Condition="'$(Configuration)' == 'Proto' or '$(CompressAllMetadata)' != 'true'">
91+
<CompressMetadata>false</CompressMetadata>
92+
</PropertyGroup>
93+
<PropertyGroup Condition="'$(Configuration)' != 'Proto' and '$(CompressAllMetadata)' == 'true'">
94+
<CompressMetadata>true</CompressMetadata>
95+
</PropertyGroup>
96+
8297
<!-- SDK targets override -->
8398
<PropertyGroup Condition="'$(Configuration)' != 'Proto' AND '$(DisableCompilerRedirection)'!='true' AND Exists('$(ProtoOutputPath)')">
8499
<FSharpTargetsPath>$(ProtoOutputPath)\fsc\Microsoft.FSharp.Targets</FSharpTargetsPath>

azure-pipelines.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,64 @@ stages:
334334
continueOnError: true
335335
condition: failed()
336336

337+
# Windows With Compressed Metadata
338+
- job: WindowsCompressedMetadata
339+
pool:
340+
# The PR build definition sets this variable:
341+
# WindowsMachineQueueName=Windows.vs2022.amd64.open
342+
# and there is an alternate build definition that sets this to a queue that is always scouting the
343+
# next preview of Visual Studio.
344+
name: NetCore1ESPool-Public
345+
demands: ImageOverride -equals $(WindowsMachineQueueName)
346+
timeoutInMinutes: 120
347+
strategy:
348+
maxParallel: 4
349+
matrix:
350+
desktop_release:
351+
_configuration: Release
352+
_testKind: testDesktop
353+
coreclr_release:
354+
_configuration: Release
355+
_testKind: testCoreclr
356+
fsharpqa_release:
357+
_configuration: Release
358+
_testKind: testFSharpQA
359+
vs_release:
360+
_configuration: Release
361+
_testKind: testVs
362+
steps:
363+
- checkout: self
364+
clean: true
365+
- script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind)
366+
displayName: Build / Test
367+
- task: PublishTestResults@2
368+
displayName: Publish Test Results
369+
inputs:
370+
testResultsFormat: 'NUnit'
371+
testResultsFiles: '*.xml'
372+
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)'
373+
continueOnError: true
374+
condition: ne(variables['_testKind'], 'testFSharpQA')
375+
- task: PublishBuildArtifacts@1
376+
displayName: Publish Test Logs
377+
inputs:
378+
PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\$(_configuration)'
379+
ArtifactName: 'Windows $(_configuration) $(_testKind) test logs'
380+
publishLocation: Container
381+
continueOnError: true
382+
condition: failed()
383+
- script: dotnet build $(Build.SourcesDirectory)/eng/DumpPackageRoot/DumpPackageRoot.csproj
384+
displayName: Dump NuGet cache contents
385+
condition: failed()
386+
- task: PublishBuildArtifacts@1
387+
displayName: Publish NuGet cache contents
388+
inputs:
389+
PathtoPublish: '$(Build.SourcesDirectory)\artifacts\NugetPackageRootContents'
390+
ArtifactName: 'NuGetPackageContents Windows $(_testKind)'
391+
publishLocation: Container
392+
continueOnError: true
393+
condition: failed()
394+
337395
# Mock official build
338396
- job: MockOfficial
339397
pool:

eng/Build.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ param (
6262
[switch]$noVisualStudio,
6363
[switch]$sourceBuild,
6464
[switch]$skipBuild,
65-
65+
[switch]$compressAllMetadata,
6666
[parameter(ValueFromRemainingArguments = $true)][string[]]$properties)
6767

6868
Set-StrictMode -version 2.0
@@ -116,6 +116,7 @@ function Print-Usage() {
116116
Write-Host " -noVisualStudio Only build fsc and fsi as .NET Core applications. No Visual Studio required. '-configuration', '-verbosity', '-norestore', '-rebuild' are supported."
117117
Write-Host " -sourceBuild Simulate building for source-build."
118118
Write-Host " -skipbuild Skip building product"
119+
Write-Host " -compressAllMetadata Build product with compressed metadata"
119120
Write-Host ""
120121
Write-Host "Command line arguments starting with '/p:' are passed through to MSBuild."
121122
}
@@ -170,6 +171,10 @@ function Process-Arguments() {
170171
$script:binaryLog = $False;
171172
}
172173

174+
if ($compressAllMetadata) {
175+
$script:compressAllMetadata = $True;
176+
}
177+
173178
foreach ($property in $properties) {
174179
if (!$property.StartsWith("/p:", "InvariantCultureIgnoreCase")) {
175180
Write-Host "Invalid argument: $property"
@@ -228,6 +233,7 @@ function BuildSolution([string] $solutionName) {
228233
/p:QuietRestoreBinaryLog=$binaryLog `
229234
/p:TestTargetFrameworks=$testTargetFrameworks `
230235
/p:DotNetBuildFromSource=$sourceBuild `
236+
/p:CompressAllMetadata=$CompressAllMetadata `
231237
/v:$verbosity `
232238
$suppressExtensionDeployment `
233239
@properties

eng/Versions.props

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
<PropertyGroup>
1414
<PreReleaseVersionLabel>beta</PreReleaseVersionLabel>
1515
<!-- F# Version components -->
16-
<FSMajorVersion>6</FSMajorVersion>
16+
<FSMajorVersion>7</FSMajorVersion>
1717
<FSMinorVersion>0</FSMinorVersion>
18-
<FSBuildVersion>6</FSBuildVersion>
18+
<FSBuildVersion>0</FSBuildVersion>
1919
<FSRevisionVersion>0</FSRevisionVersion>
2020
<!-- -->
2121
<!-- F# Language version -->
@@ -28,26 +28,27 @@
2828
<FSCoreReleaseNotesVersion>$(FSMajorVersion)-$(FSMinorVersion)-$(FSBuildVersion)</FSCoreReleaseNotesVersion>
2929
<FSCoreVersionPrefix>$(FSMajorVersion).$(FSMinorVersion).$(FSBuildVersion)</FSCoreVersionPrefix>
3030
<FSCoreVersion>$(FSMajorVersion).$(FSMinorVersion).0.0</FSCoreVersion>
31+
<FSCoreShippedVersion>6.0.0.0</FSCoreShippedVersion>
3132
<!-- -->
3233
<!-- FSharp.Compiler.Service version -->
33-
<FCSMajorVersion>41</FCSMajorVersion>
34-
<FCSMinorVersion>0</FCSMinorVersion>
35-
<FCSBuildVersion>6</FCSBuildVersion>
34+
<FCSMajorVersion>42</FCSMajorVersion>
35+
<FCSMinorVersion>7</FCSMinorVersion>
36+
<FCSBuildVersion>100</FCSBuildVersion>
3637
<FCSRevisionVersion>$(FSRevisionVersion)</FCSRevisionVersion>
3738
<FSharpCompilerServicePackageVersion>$(FCSMajorVersion).$(FCSMinorVersion).$(FCSBuildVersion)</FSharpCompilerServicePackageVersion>
3839
<FSharpCompilerServiceVersion>$(FCSMajorVersion).$(FCSMinorVersion).$(FCSBuildVersion).$(FCSRevisionVersion)</FSharpCompilerServiceVersion>
3940
<FSharpCompilerServiceReleaseNotesVersion>$(FCSMajorVersion)$(FCSMinorVersion)$(FCSBuildVersion)</FSharpCompilerServiceReleaseNotesVersion>
4041
<!-- -->
4142
<!-- The current published nuget package -->
42-
<FSharpCoreShippedPackageVersionValue>6.0.3</FSharpCoreShippedPackageVersionValue>
43+
<FSharpCoreShippedPackageVersionValue>6.0.5</FSharpCoreShippedPackageVersionValue>
4344
<!-- -->
4445
<!-- The pattern for specifying the preview package -->
4546
<FSharpCorePreviewPackageVersionValue>$(FSCorePackageVersionValue)-$(PreReleaseVersionLabel).*</FSharpCorePreviewPackageVersionValue>
4647
<!-- -->
4748
<!-- FSharp tools for Visual Studio version number -->
4849
<FSToolsMajorVersion>12</FSToolsMajorVersion>
4950
<FSToolsMinorVersion>0</FSToolsMinorVersion>
50-
<FSToolsBuildVersion>4</FSToolsBuildVersion>
51+
<FSToolsBuildVersion>5</FSToolsBuildVersion>
5152
<FSToolsRevisionVersion>$(FSRevisionVersion)</FSToolsRevisionVersion>
5253
<FSProductVersionPrefix>$(FSToolsMajorVersion).$(FSToolsMinorVersion).$(FSToolsBuildVersion)</FSProductVersionPrefix>
5354
<FSProductVersionReleaseNotesVersion>$(FSToolsMajorVersion)-$(FSToolsMinorVersion)-$(FSToolsBuildVersion)</FSProductVersionReleaseNotesVersion>

src/Compiler/Checking/NicePrint.fs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2326,12 +2326,10 @@ module InferredSigPrinting =
23262326
let outerPath = mspec.CompilationPath.AccessPath
23272327

23282328
let denv =
2329-
innerPath
2330-
|> List.choose (fun (path, kind) ->
2331-
match kind with
2332-
| ModuleOrNamespaceKind.Namespace false -> None
2333-
| _ -> Some path)
2334-
|> denv.AddOpenPath
2329+
if not (isConcreteNamespace def) then
2330+
denv
2331+
else
2332+
denv.AddOpenPath (List.map fst innerPath)
23352333

23362334
if mspec.IsImplicitNamespace then
23372335
// The current mspec is a namespace that belongs to the `def` child (nested) module(s).

src/Compiler/Driver/CompilerConfig.fs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ type TcConfigBuilder =
458458
mutable metadataVersion: string option
459459
mutable standalone: bool
460460
mutable extraStaticLinkRoots: string list
461+
mutable compressMetadata: bool
461462
mutable noSignatureData: bool
462463
mutable onlyEssentialOptimizationData: bool
463464
mutable useOptimizationDataFile: bool
@@ -682,6 +683,7 @@ type TcConfigBuilder =
682683
metadataVersion = None
683684
standalone = false
684685
extraStaticLinkRoots = []
686+
compressMetadata = false
685687
noSignatureData = false
686688
onlyEssentialOptimizationData = false
687689
useOptimizationDataFile = false
@@ -1230,6 +1232,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) =
12301232
member _.metadataVersion = data.metadataVersion
12311233
member _.standalone = data.standalone
12321234
member _.extraStaticLinkRoots = data.extraStaticLinkRoots
1235+
member _.compressMetadata = data.compressMetadata
12331236
member _.noSignatureData = data.noSignatureData
12341237
member _.onlyEssentialOptimizationData = data.onlyEssentialOptimizationData
12351238
member _.useOptimizationDataFile = data.useOptimizationDataFile

src/Compiler/Driver/CompilerConfig.fsi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,8 @@ type TcConfigBuilder =
331331

332332
mutable extraStaticLinkRoots: string list
333333

334+
mutable compressMetadata: bool
335+
334336
mutable noSignatureData: bool
335337

336338
mutable onlyEssentialOptimizationData: bool
@@ -647,6 +649,8 @@ type TcConfig =
647649

648650
member extraStaticLinkRoots: string list
649651

652+
member compressMetadata: bool
653+
650654
member noSignatureData: bool
651655

652656
member onlyEssentialOptimizationData: bool

0 commit comments

Comments
 (0)