Skip to content

Commit

Permalink
Merge branch 'main' into fix-17501
Browse files Browse the repository at this point in the history
  • Loading branch information
vzarytovskii authored Sep 30, 2024
2 parents f5047d8 + aa6fd83 commit f95583d
Show file tree
Hide file tree
Showing 102 changed files with 242 additions and 1,141 deletions.
8 changes: 1 addition & 7 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,10 @@
<FsYaccPath>$(ArtifactsDir)/bin/fsyacc/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/$(NETCoreSdkPortableRuntimeIdentifier)/fsyacc.dll</FsYaccPath>
</PropertyGroup>

<ItemGroup Condition="'$(UnitTestType)' == 'nunit'">
<PackageReference Include="NUnit" Version="$(NUnitVersion)" />
<PackageReference Include="NUnit3TestAdapter" Version="$(NUnit3TestAdapterVersion)" />
<PackageReference Include="NunitXml.TestLogger" Version="$(NunitXmlTestLoggerVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(UnitTestType)' == 'xunit'">
<PackageReference Include="xunit" Version="$(XUnitVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XUnitRunnerVersion)" />
<PackageReference Include="NunitXml.TestLogger" Version="$(NunitXmlTestLoggerVersion)" />
<PackageReference Include="XunitXml.TestLogger" Version="$(XunitXmlTestLoggerVersion)" />
</ItemGroup>

<!--
Expand Down
6 changes: 3 additions & 3 deletions azure-pipelines-PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ stages:
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFormat: 'NUnit'
testResultsFormat: 'XUnit'
testResultsFiles: '*.xml'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)'
continueOnError: true
Expand Down Expand Up @@ -557,7 +557,7 @@ stages:
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFormat: 'NUnit'
testResultsFormat: 'XUnit'
testResultsFiles: '*.xml'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
continueOnError: true
Expand Down Expand Up @@ -600,7 +600,7 @@ stages:
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFormat: 'NUnit'
testResultsFormat: 'XUnit'
testResultsFiles: '*.xml'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
continueOnError: true
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ extends:
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFormat: 'NUnit'
testResultsFormat: 'XUnit'
testResultsFiles: '*.xml'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
continueOnError: true
Expand Down
13 changes: 0 additions & 13 deletions docs/builder-caches.md

This file was deleted.

6 changes: 6 additions & 0 deletions docs/release-notes/.FSharp.Compiler.Service/9.0.200.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
### Fixed

* Fix internal error when calling 'AddSingleton' and other overloads only differing in generic arity ([PR #17804](https://github.com/dotnet/fsharp/pull/17804))
* Fix extension methods support for non-reference system assemblies ([PR #17799](https://github.com/dotnet/fsharp/pull/17799))
* Ensure `frameworkTcImportsCache` mutations are threadsafe. ([PR #17795](https://github.com/dotnet/fsharp/pull/17795))


### Added


### Changed

* Make ILTypeDef interface impls calculation lazy. ([PR #17392](https://github.com/dotnet/fsharp/pull/17392))
* Remove non-functional useSyntaxTreeCache option. ([PR #17768](https://github.com/dotnet/fsharp/pull/17768))
* Better ranges for CE `let!` and `use!` error reporting. ([PR #17712](https://github.com/dotnet/fsharp/pull/17712))
* Better ranges for CE `do!` error reporting. ([PR #17779](https://github.com/dotnet/fsharp/pull/17779))
* Better ranges for CE `match!`. ([PR #17789](https://github.com/dotnet/fsharp/pull/17789))

### Breaking Changes
1 change: 1 addition & 0 deletions docs/release-notes/.VisualStudio/17.12.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

### Changed
* Fix unwanted navigation on hover [PR #17592](https://github.com/dotnet/fsharp/pull/17592))
* Remove non-functional useSyntaxTreeCache option. ([PR #17768](https://github.com/dotnet/fsharp/pull/17768))


### Breaking Changes
Expand Down
6 changes: 3 additions & 3 deletions eng/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ param (
[switch]$sourceBuild,
[switch]$skipBuild,
[switch]$compressAllMetadata,
[switch]$buildnorealsig,
[switch]$buildnorealsig = $true,
[switch]$verifypackageshipstatus = $false,
[parameter(ValueFromRemainingArguments = $true)][string[]]$properties)

Expand Down Expand Up @@ -368,7 +368,7 @@ function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [str
$projectName = [System.IO.Path]::GetFileNameWithoutExtension($testProject)
$testLogPath = "$ArtifactsDir\TestResults\$configuration\${projectName}_$targetFramework.xml"
$testBinLogPath = "$LogDir\${projectName}_$targetFramework.binlog"
$args = "test $testProject -c $configuration -f $targetFramework -v n --test-adapter-path $testadapterpath --logger ""nunit;LogFilePath=$testLogPath"" /bl:$testBinLogPath"
$args = "test $testProject -c $configuration -f $targetFramework -v n --test-adapter-path $testadapterpath --logger ""xunit;LogFilePath=$testLogPath"" /bl:$testBinLogPath"
$args += " --blame --results-directory $ArtifactsDir\TestResults\$configuration -p:vstestusemsbuildoutput=false"

if (-not $noVisualStudio -or $norestore) {
Expand All @@ -383,7 +383,7 @@ function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [str
Write-Host("Starting on the background: $args")
Write-Host("------------------------------------")
$bgJob = Start-Job -ScriptBlock {
& $using:dotnetExe test $using:testProject -c $using:configuration -f $using:targetFramework -v n --test-adapter-path $using:testadapterpath --logger "nunit;LogFilePath=$using:testLogPath" /bl:$using:testBinLogPath --blame --results-directory $using:ArtifactsDir\TestResults\$using:configuration
& $using:dotnetExe test $using:testProject -c $using:configuration -f $using:targetFramework -v n --test-adapter-path $using:testadapterpath --logger "xunit;LogFilePath=$using:testLogPath" /bl:$using:testBinLogPath --blame --results-directory $using:ArtifactsDir\TestResults\$using:configuration
if ($LASTEXITCODE -ne 0) {
throw "Command failed to execute with exit code $($LASTEXITCODE): $using:dotnetExe $using:args"
}
Expand Down
5 changes: 1 addition & 4 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,12 @@
<MicrosoftNETCoreILAsmVersion>5.0.0-preview.7.20364.11</MicrosoftNETCoreILAsmVersion>
<MicrosoftNETTestSdkVersion>17.4.0</MicrosoftNETTestSdkVersion>
<NewtonsoftJsonVersion>13.0.3</NewtonsoftJsonVersion>
<NUnitVersion>3.13.2</NUnitVersion>
<NUnit3TestAdapterVersion>4.1.0</NUnit3TestAdapterVersion>
<NUnitLiteVersion>3.11.0</NUnitLiteVersion>
<NunitXmlTestLoggerVersion>2.1.80</NunitXmlTestLoggerVersion>
<RoslynToolsSignToolVersion>1.0.0-beta2-dev3</RoslynToolsSignToolVersion>
<StreamJsonRpcVersion>2.18.48</StreamJsonRpcVersion>
<NerdbankStreamsVersion>2.10.69</NerdbankStreamsVersion>
<XUnitVersion>2.9.0</XUnitVersion>
<XUnitRunnerVersion>2.8.2</XUnitRunnerVersion>
<XunitXmlTestLoggerVersion>3.1.17</XunitXmlTestLoggerVersion>
<FluentAssertionsVersion>5.10.3</FluentAssertionsVersion>
<HumanizerCoreVersion>2.2.0</HumanizerCoreVersion>
<!-- -->
Expand Down
4 changes: 2 additions & 2 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ skip_analyzers=false
skip_build=false
prepare_machine=false
source_build=false
buildnorealsig=false
buildnorealsig=true
properties=""

docker=false
Expand Down Expand Up @@ -214,7 +214,7 @@ function Test() {
projectname=$(basename -- "$testproject")
projectname="${projectname%.*}"
testlogpath="$artifacts_dir/TestResults/$configuration/${projectname}_$targetframework.xml"
args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"nunit;LogFilePath=$testlogpath\" --blame --results-directory $artifacts_dir/TestResults/$configuration -p:vstestusemsbuildoutput=false"
args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"xunit;LogFilePath=$testlogpath\" --blame --results-directory $artifacts_dir/TestResults/$configuration -p:vstestusemsbuildoutput=false"
"$DOTNET_INSTALL_DIR/dotnet" $args || exit $?
}

Expand Down
1 change: 1 addition & 0 deletions src/Compiler/AbstractIL/il.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5700,6 +5700,7 @@ let resolveILMethodRefWithRescope r (td: ILTypeDef) (mref: ILMethodRef) =
mref.CallingConv = md.CallingConv
&& (md.Parameters, argTypes)
||> List.lengthsEqAndForall2 (fun p1 p2 -> r p1.Type = p2)
&& md.GenericParams.Length = mref.GenericArity
&&
// REVIEW: this uses equality on ILType. For CMOD_OPTIONAL this is not going to be correct
r md.Return.Type = retType)
Expand Down
14 changes: 3 additions & 11 deletions src/Compiler/AbstractIL/ilread.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2144,11 +2144,6 @@ and typeDefReader ctxtH : ILTypeDefStored =
else
let mutable attrIdx = attrsStartIdx

let looksLikeSystemAssembly =
ctxt.fileName.EndsWith("System.Runtime.dll")
|| ctxt.fileName.EndsWith("mscorlib.dll")
|| ctxt.fileName.EndsWith("netstandard.dll")

while attrIdx <= attrsEndIdx && not containsExtensionMethods do
let mutable addr = ctxt.rowAddr TableNames.CustomAttribute attrIdx
// skip parentIndex to read typeIndex
Expand All @@ -2159,12 +2154,9 @@ and typeDefReader ctxtH : ILTypeDefStored =
let name =
if attrTypeIndex.tag = cat_MethodDef then
// the ExtensionAttribute constructor can be cat_MethodDef if the metadata is read from the assembly
// in which the corresponding attribute is defined -- from the system library
if not looksLikeSystemAssembly then
""
else
let _, (_, nameIdx, namespaceIdx, _, _, _) = seekMethodDefParent ctxt attrCtorIdx
readBlobHeapAsTypeName ctxt (nameIdx, namespaceIdx)
// in which the corresponding attribute is defined
let _, (_, nameIdx, namespaceIdx, _, _, _) = seekMethodDefParent ctxt attrCtorIdx
readBlobHeapAsTypeName ctxt (nameIdx, namespaceIdx)
else
let mutable addr = ctxt.rowAddr TableNames.MemberRef attrCtorIdx
let mrpTag = seekReadMemberRefParentIdx ctxt mdv &addr
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Checking/Expressions/CheckExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6005,7 +6005,7 @@ and TcExprUndelayed (cenv: cenv) (overallTy: OverallTy) env tpenv (synExpr: SynE
error(Error(FSComp.SR.tcConstructRequiresSequenceOrComputations(), m))

| SynExpr.DoBang (trivia = { DoBangKeyword = m })
| SynExpr.MatchBang (range = m)
| SynExpr.MatchBang (trivia = { MatchBangKeyword = m })
| SynExpr.WhileBang (range = m)
| SynExpr.LetOrUseBang (trivia = { LetOrUseBangKeyword = m }) ->
error(Error(FSComp.SR.tcConstructRequiresComputationExpression(), m))
Expand Down
6 changes: 2 additions & 4 deletions src/Compiler/Service/BackgroundCompiler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,7 @@ type internal BackgroundCompiler
parallelReferenceResolution,
captureIdentifiersWhenParsing,
getSource: (string -> Async<ISourceText option>) option,
useChangeNotifications,
useSyntaxTreeCache
useChangeNotifications
) as self =

let beforeFileChecked = Event<string * FSharpProjectOptions>()
Expand Down Expand Up @@ -403,8 +402,7 @@ type internal BackgroundCompiler
parallelReferenceResolution,
captureIdentifiersWhenParsing,
getSource,
useChangeNotifications,
useSyntaxTreeCache
useChangeNotifications
)

match builderOpt with
Expand Down
3 changes: 1 addition & 2 deletions src/Compiler/Service/BackgroundCompiler.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@ type internal BackgroundCompiler =
parallelReferenceResolution: ParallelReferenceResolution *
captureIdentifiersWhenParsing: bool *
getSource: (string -> Async<ISourceText option>) option *
useChangeNotifications: bool *
useSyntaxTreeCache: bool ->
useChangeNotifications: bool ->
BackgroundCompiler

static member ActualCheckFileCount: int
Expand Down
17 changes: 7 additions & 10 deletions src/Compiler/Service/IncrementalBuild.fs
Original file line number Diff line number Diff line change
Expand Up @@ -507,10 +507,12 @@ type FrameworkImportsCache(size) =
let frameworkTcImportsCache = AgedLookup<AnyCallerThreadToken, FrameworkImportsCacheKey, GraphNode<TcGlobals * TcImports>>(size, areSimilar=(fun (x, y) -> x = y))

/// Reduce the size of the cache in low-memory scenarios
member _.Downsize() = frameworkTcImportsCache.Resize(AnyCallerThread, newKeepStrongly=0)
member _.Downsize() = lock gate <| fun () ->
frameworkTcImportsCache.Resize(AnyCallerThread, newKeepStrongly=0)

/// Clear the cache
member _.Clear() = frameworkTcImportsCache.Clear AnyCallerThread
member _.Clear() = lock gate <| fun () ->
frameworkTcImportsCache.Clear AnyCallerThread

/// This function strips the "System" assemblies from the tcConfig and returns a age-cached TcImports for them.
member _.GetNode(tcConfig: TcConfig, frameworkDLLs: AssemblyResolution list, nonFrameworkResolutions: AssemblyResolution list) =
Expand Down Expand Up @@ -887,7 +889,6 @@ type IncrementalBuilderInitialState =
defaultTimeStamp: DateTime
mutable isImportsInvalidated: bool
useChangeNotifications: bool
useSyntaxTreeCache: bool
}

static member Create
Expand All @@ -909,8 +910,7 @@ type IncrementalBuilderInitialState =
#endif
allDependencies,
defaultTimeStamp: DateTime,
useChangeNotifications: bool,
useSyntaxTreeCache
useChangeNotifications: bool
) =

let initialState =
Expand All @@ -936,7 +936,6 @@ type IncrementalBuilderInitialState =
defaultTimeStamp = defaultTimeStamp
isImportsInvalidated = false
useChangeNotifications = useChangeNotifications
useSyntaxTreeCache = useSyntaxTreeCache
}
#if !NO_TYPEPROVIDERS
importsInvalidatedByTypeProvider.Publish.Add(fun () -> initialState.isImportsInvalidated <- true)
Expand Down Expand Up @@ -1408,8 +1407,7 @@ type IncrementalBuilder(initialState: IncrementalBuilderInitialState, state: Inc
parallelReferenceResolution,
captureIdentifiersWhenParsing,
getSource,
useChangeNotifications,
useSyntaxTreeCache
useChangeNotifications
) =

let useSimpleResolutionSwitch = "--simpleresolution"
Expand Down Expand Up @@ -1651,8 +1649,7 @@ type IncrementalBuilder(initialState: IncrementalBuilderInitialState, state: Inc
#endif
allDependencies,
defaultTimeStamp,
useChangeNotifications,
useSyntaxTreeCache
useChangeNotifications
)

let builder = IncrementalBuilder(initialState, IncrementalBuilderState.Create(initialState))
Expand Down
3 changes: 1 addition & 2 deletions src/Compiler/Service/IncrementalBuild.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,7 @@ type internal IncrementalBuilder =
parallelReferenceResolution: ParallelReferenceResolution *
captureIdentifiersWhenParsing: bool *
getSource: (string -> Async<ISourceText option>) option *
useChangeNotifications: bool *
useSyntaxTreeCache: bool ->
useChangeNotifications: bool ->
Async<IncrementalBuilder option * FSharpDiagnostic[]>

/// Generalized Incremental Builder. This is exposed only for unit testing purposes.
Expand Down
6 changes: 2 additions & 4 deletions src/Compiler/Service/TransparentCompiler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,7 @@ type internal TransparentCompiler
parallelReferenceResolution,
captureIdentifiersWhenParsing,
getSource: (string -> Async<ISourceText option>) option,
useChangeNotifications,
useSyntaxTreeCache
useChangeNotifications
) as self =

let documentSource =
Expand Down Expand Up @@ -374,8 +373,7 @@ type internal TransparentCompiler
parallelReferenceResolution,
captureIdentifiersWhenParsing,
getSource,
useChangeNotifications,
useSyntaxTreeCache
useChangeNotifications
)
:> IBackgroundCompiler

Expand Down
3 changes: 1 addition & 2 deletions src/Compiler/Service/TransparentCompiler.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ type internal TransparentCompiler =
parallelReferenceResolution: ParallelReferenceResolution *
captureIdentifiersWhenParsing: bool *
getSource: (string -> Async<ISourceText option>) option *
useChangeNotifications: bool *
useSyntaxTreeCache: bool ->
useChangeNotifications: bool ->
TransparentCompiler

member FindReferencesInFile:
Expand Down
11 changes: 2 additions & 9 deletions src/Compiler/Service/service.fs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ type FSharpChecker
captureIdentifiersWhenParsing,
getSource,
useChangeNotifications,
useSyntaxTreeCache,
useTransparentCompiler
) =

Expand All @@ -144,8 +143,7 @@ type FSharpChecker
parallelReferenceResolution,
captureIdentifiersWhenParsing,
getSource,
useChangeNotifications,
useSyntaxTreeCache
useChangeNotifications
)
:> IBackgroundCompiler
else
Expand All @@ -162,8 +160,7 @@ type FSharpChecker
parallelReferenceResolution,
captureIdentifiersWhenParsing,
getSource,
useChangeNotifications,
useSyntaxTreeCache
useChangeNotifications
)
:> IBackgroundCompiler

Expand Down Expand Up @@ -209,7 +206,6 @@ type FSharpChecker
?parallelReferenceResolution: bool,
?captureIdentifiersWhenParsing: bool,
?documentSource: DocumentSource,
?useSyntaxTreeCache: bool,
?useTransparentCompiler: bool
) =

Expand Down Expand Up @@ -238,8 +234,6 @@ type FSharpChecker
| Some(DocumentSource.Custom _) -> true
| _ -> false

let useSyntaxTreeCache = defaultArg useSyntaxTreeCache true

if keepAssemblyContents && enablePartialTypeChecking then
invalidArg "enablePartialTypeChecking" "'keepAssemblyContents' and 'enablePartialTypeChecking' cannot be both enabled."

Expand All @@ -261,7 +255,6 @@ type FSharpChecker
| Some(DocumentSource.Custom f) -> Some f
| _ -> None),
useChangeNotifications,
useSyntaxTreeCache,
useTransparentCompiler
)

Expand Down
Loading

0 comments on commit f95583d

Please sign in to comment.