Skip to content

Commit d0c5ca2

Browse files
authored
Merge branch 'main' into otel
2 parents 232e03e + 58560f8 commit d0c5ca2

32 files changed

+482
-268
lines changed

.config/dotnet-tools.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,19 @@
4444
],
4545
"rollForward": true
4646
},
47-
"dotnet-ilverify": {
48-
"version": "9.0.0-rc.2.24473.5",
49-
"commands": [
50-
"ilverify"
51-
],
52-
"rollForward": true
53-
},
5447
"fantomas": {
5548
"version": "6.2.3",
5649
"commands": [
5750
"fantomas"
5851
],
5952
"rollForward": true
53+
},
54+
"dotnet-ilverify": {
55+
"version": "9.0.0",
56+
"commands": [
57+
"ilverify"
58+
],
59+
"rollForward": false
6060
}
6161
}
62-
}
62+
}

.config/feature-lsp-branch-merge.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"merge-flow-configurations": {
3+
"main": {
4+
"MergeToBranch": "feature/lsp",
5+
"ExtraSwitches": "-QuietComments"
6+
}
7+
}
8+
}

.config/service-branch-merge.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"merge-flow-configurations": {
3+
// regular branch flow
4+
"release/dev17.13": {
5+
"MergeToBranch": "main",
6+
"ExtraSwitches": "-QuietComments"
7+
},
8+
"main": {
9+
"MergeToBranch": "release/dev17.14",
10+
"ExtraSwitches": "-QuietComments"
11+
}
12+
}
13+
}

.github/workflows/branch-merge.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Merges any changes from servicing branches forward.
2+
3+
name: Flow servicing changes to main
4+
on:
5+
push:
6+
branches:
7+
- 'release/*'
8+
- 'main'
9+
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
14+
jobs:
15+
servicing-flow:
16+
uses: dotnet/arcade/.github/workflows/inter-branch-merge-base.yml@main
17+
with:
18+
configuration_file_path: '.config/service-branch-merge.json'
19+
feature-lsp-flow:
20+
uses: dotnet/arcade/.github/workflows/inter-branch-merge-base.yml@main
21+
with:
22+
configuration_file_path: '.config/feature-lsp-branch-merge.json'

DEVGUIDE.md

+10
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,16 @@ or
243243
> Please note, that by default, **Release** version of IL baseline tests will be running in CI, so when updating baseline (.bsl) files, make sure to add `-c Release` flag to the build command.
244244
245245

246+
### Parallel execution of tests
247+
248+
Tests utilizing xUnit framework by default run in parallel. If your tests depend on some shared state or are time-critical, you can add the module to predefined `NotThreadSafeResourceCollection` to prevent parallel execution.
249+
For example:
250+
```fsharp
251+
[<Collection(nameof NotThreadSafeResourceCollection)>]
252+
module TimeCritical =
253+
```
254+
255+
246256
### Updating FCS surface area baselines
247257

248258
```bash

docs/release-notes/.FSharp.Compiler.Service/9.0.300.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Fix Realsig+ generates nested closures with incorrect Generic ([Issue #17797](https://github.com/dotnet/fsharp/issues/17797), [PR #17877](https://github.com/dotnet/fsharp/pull/17877))
33
* Fix internal error when missing measure attribute in an unsolved measure typar. ([Issue #7491](https://github.com/dotnet/fsharp/issues/7491), [PR #18234](https://github.com/dotnet/fsharp/pull/18234)==
44
* Set `Cancellable.token` from async computation ([Issue #18235](https://github.com/dotnet/fsharp/issues/18235), [PR #18238](https://github.com/dotnet/fsharp/pull/18238))
5+
* Cancellable: only cancel on OCE with own token ([PR #18277](https://github.com/dotnet/fsharp/pull/18277))
56

67
### Added
78
* Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241))

src/Compiler/Checking/CheckDeclarations.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5479,7 +5479,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem
54795479
and [<TailCall>] TcModuleOrNamespaceElementsNonMutRec cenv parent typeNames endm (defsSoFar, env, envAtEnd) (moreDefs: SynModuleDecl list) (ct: CancellationToken) =
54805480

54815481
if ct.IsCancellationRequested then
5482-
ValueOrCancelled.Cancelled (OperationCanceledException())
5482+
ValueOrCancelled.Cancelled(OperationCanceledException ct)
54835483
else
54845484
match moreDefs with
54855485
| [] ->

src/Compiler/Service/IncrementalBuild.fs

-5
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,6 @@ type TcInfoExtras =
229229
member x.TcSymbolUses =
230230
x.tcSymbolUses
231231

232-
module ValueOption =
233-
let toOption = function
234-
| ValueSome x -> Some x
235-
| _ -> None
236-
237232
type private SingleFileDiagnostics = (PhasedDiagnostic * FSharpDiagnosticSeverity) array
238233
type private TypeCheck = TcInfo * TcResultsSinkImpl * CheckedImplFile option * string * SingleFileDiagnostics
239234

src/Compiler/TypedTree/TypeProviders.fs

+1-11
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ let CreateTypeProvider (
122122

123123
// Create the TypeProviderConfig to pass to the type provider constructor
124124
let e =
125-
#if FSHARPCORE_USE_PACKAGE
126125
TypeProviderConfig(systemRuntimeContainsType,
127126
ReferencedAssemblies=getReferencedAssemblies(),
128127
ResolutionFolder=resolutionEnvironment.ResolutionFolder,
@@ -131,16 +130,7 @@ let CreateTypeProvider (
131130
IsInvalidationSupported=isInvalidationSupported,
132131
IsHostedExecution= isInteractive,
133132
SystemRuntimeAssemblyVersion = systemRuntimeAssemblyVersion)
134-
#else
135-
TypeProviderConfig(systemRuntimeContainsType,
136-
ReferencedAssemblies=getReferencedAssemblies(),
137-
ResolutionFolder=resolutionEnvironment.ResolutionFolder,
138-
RuntimeAssembly=runtimeAssemblyPath,
139-
TemporaryFolder=resolutionEnvironment.TemporaryFolder,
140-
IsInvalidationSupported=isInvalidationSupported,
141-
IsHostedExecution= isInteractive,
142-
SystemRuntimeAssemblyVersion = systemRuntimeAssemblyVersion)
143-
#endif
133+
144134
protect (fun () -> !!(Activator.CreateInstance(typeProviderImplementationType, [| box e|])) :?> ITypeProvider )
145135

146136
elif not(isNull(typeProviderImplementationType.GetConstructor [| |])) then

src/Compiler/TypedTree/TypedTree.fs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2122,7 +2122,7 @@ type ModuleOrNamespaceType(kind: ModuleOrNamespaceKind, vals: QueueList<Val>, en
21222122
|> List.tryFind (fun v -> match key.TypeForLinkage with
21232123
| None -> true
21242124
| Some keyTy -> ccu.MemberSignatureEquality(keyTy, v.Type))
2125-
|> ValueOptionInternal.ofOption
2125+
|> ValueOption.ofOption
21262126

21272127
/// Get a table of values indexed by logical name
21282128
member _.AllValsByLogicalName =
@@ -4237,7 +4237,7 @@ type UnionCaseRef =
42374237
/// Try to dereference the reference
42384238
member x.TryUnionCase =
42394239
x.TyconRef.TryDeref
4240-
|> ValueOptionInternal.bind (fun tcref -> tcref.GetUnionCaseByName x.CaseName |> ValueOptionInternal.ofOption)
4240+
|> ValueOption.bind (fun tcref -> tcref.GetUnionCaseByName x.CaseName |> ValueOption.ofOption)
42414241

42424242
/// Get the attributes associated with the union case
42434243
member x.Attribs = x.UnionCase.Attribs
@@ -4300,7 +4300,7 @@ type RecdFieldRef =
43004300
/// Try to dereference the reference
43014301
member x.TryRecdField =
43024302
x.TyconRef.TryDeref
4303-
|> ValueOptionInternal.bind (fun tcref -> tcref.GetFieldByName x.FieldName |> ValueOptionInternal.ofOption)
4303+
|> ValueOption.bind (fun tcref -> tcref.GetFieldByName x.FieldName |> ValueOption.ofOption)
43044304

43054305
/// Get the attributes associated with the compiled property of the record field
43064306
member x.PropertyAttribs = x.RecdField.PropertyAttribs

src/Compiler/TypedTree/TypedTreeOps.fs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3526,11 +3526,11 @@ let IsMatchingFSharpAttributeOpt g attrOpt (Attrib(tcref2, _, _, _, _, _, _)) =
35263526

35273527
[<return: Struct>]
35283528
let (|ExtractAttribNamedArg|_|) nm args =
3529-
args |> List.tryPick (function AttribNamedArg(nm2, _, _, v) when nm = nm2 -> Some v | _ -> None) |> ValueOptionInternal.ofOption
3530-
3529+
args |> List.tryPick (function AttribNamedArg(nm2, _, _, v) when nm = nm2 -> Some v | _ -> None) |> ValueOption.ofOption
3530+
35313531
[<return: Struct>]
35323532
let (|ExtractILAttributeNamedArg|_|) nm (args: ILAttributeNamedArg list) =
3533-
args |> List.tryPick (function nm2, _, _, v when nm = nm2 -> Some v | _ -> None) |> ValueOptionInternal.ofOption
3533+
args |> List.tryPick (function nm2, _, _, v when nm = nm2 -> Some v | _ -> None) |> ValueOption.ofOption
35343534

35353535
[<return: Struct>]
35363536
let (|StringExpr|_|) = function Expr.Const (Const.String n, _, _) -> ValueSome n | _ -> ValueNone

src/Compiler/Utilities/Cancellable.fs

+3-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ module Cancellable =
6868
try
6969
use _ = Cancellable.UsingToken(ct)
7070
oper ct
71-
with :? OperationCanceledException as e ->
72-
ValueOrCancelled.Cancelled(OperationCanceledException e.CancellationToken)
71+
with
72+
| :? OperationCanceledException as e when ct.IsCancellationRequested -> ValueOrCancelled.Cancelled e
73+
| :? OperationCanceledException as e -> InvalidOperationException("Wrong cancellation token", e) |> raise
7374

7475
let fold f acc seq =
7576
Cancellable(fun ct ->

src/Compiler/Utilities/illib.fs

-12
Original file line numberDiff line numberDiff line change
@@ -715,18 +715,6 @@ module Span =
715715

716716
state
717717

718-
module ValueOptionInternal =
719-
720-
let inline ofOption x =
721-
match x with
722-
| Some x -> ValueSome x
723-
| None -> ValueNone
724-
725-
let inline bind ([<InlineIfLambda>] f) x =
726-
match x with
727-
| ValueSome x -> f x
728-
| ValueNone -> ValueNone
729-
730718
module String =
731719
let make (n: int) (c: char) : string = String(c, n)
732720

src/Compiler/Utilities/illib.fsi

-6
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,6 @@ module internal ResizeArray =
243243
module internal Span =
244244
val inline exists: predicate: ('T -> bool) -> span: Span<'T> -> bool
245245

246-
module internal ValueOptionInternal =
247-
248-
val inline ofOption: x: 'a option -> 'a voption
249-
250-
val inline bind: f: ('a -> 'b voption) -> x: 'a voption -> 'b voption
251-
252246
module internal String =
253247

254248
val make: n: int -> c: char -> string

tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs

+17-15
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,23 @@ module CustomAttributes_AttributeUsage =
3434
|> verifyCompileAndRun
3535
|> shouldSucceed
3636

37-
// SOURCE=AssemblyVersion03.fs # AssemblyVersion03.fs
38-
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"AssemblyVersion03.fs"|])>]
39-
let ``AssemblyVersion03_fs`` compilation =
40-
compilation
41-
|> withOptions ["--nowarn:52"]
42-
|> verifyCompileAndRun
43-
|> shouldSucceed
44-
45-
// SOURCE=AssemblyVersion04.fs # AssemblyVersion04.fs
46-
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"AssemblyVersion04.fs"|])>]
47-
let ``AssemblyVersion04_fs`` compilation =
48-
compilation
49-
|> withOptions ["--nowarn:52"]
50-
|> verifyCompileAndRun
51-
|> shouldSucceed
37+
[<Collection(nameof NotThreadSafeResourceCollection)>]
38+
module TimeCritical =
39+
// SOURCE=AssemblyVersion03.fs # AssemblyVersion03.fs
40+
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"AssemblyVersion03.fs"|])>]
41+
let ``AssemblyVersion03_fs`` compilation =
42+
compilation
43+
|> withOptions ["--nowarn:52"]
44+
|> verifyCompileAndRun
45+
|> shouldSucceed
46+
47+
// SOURCE=AssemblyVersion04.fs # AssemblyVersion04.fs
48+
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"AssemblyVersion04.fs"|])>]
49+
let ``AssemblyVersion04_fs`` compilation =
50+
compilation
51+
|> withOptions ["--nowarn:52"]
52+
|> verifyCompileAndRun
53+
|> shouldSucceed
5254

5355
// SOURCE=AttributeTargetsIsCtor01.fs # AttributeTargetsIsCtor01.fs
5456
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"AttributeTargetsIsCtor01.fs"|])>]

tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/Events/Basic/Basic.fs

+7-12
Original file line numberDiff line numberDiff line change
@@ -80,20 +80,15 @@ module Events =
8080
|> verifyCompileAndRun
8181
|> shouldSucceed
8282

83-
// NoMT SOURCE=SanityCheck02.fs # SanityCheck02.fs
84-
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"SanityCheck02.fs"|])>]
85-
let ``SanityCheck02_fs`` compilation =
86-
compilation
87-
|> verifyCompileAndRun
88-
|> shouldSucceed
89-
90-
#if false && !NETCOREAPP && !NETSTANDARD
9183
// SOURCE=SanityCheck02.fs PEVER=/MD # SanityCheck02.fs - /MD
9284
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"SanityCheck02.fs"|])>]
93-
let ``SanityCheck02_fs_peverify`` compilation =
85+
let ``SanityCheck02`` compilation =
9486
compilation
9587
|> asExe
9688
|> withOptions ["--nowarn:988"]
97-
|> PEVerifier.verifyPEFile
98-
|> PEVerifier.shouldSucceed
99-
#endif
89+
|> verifyCompileAndRun
90+
|> shouldSucceed
91+
|> verifyPEFileWithSystemDlls
92+
|> withOutputContainsAllInOrderWithWildcards [
93+
"All Classes and Methods in*SanityCheck02.exe Verified."
94+
]

0 commit comments

Comments
 (0)