Skip to content

Commit

Permalink
Merge branch 'main' into otel
Browse files Browse the repository at this point in the history
  • Loading branch information
majocha authored Jan 29, 2025
2 parents 232e03e + 58560f8 commit d0c5ca2
Show file tree
Hide file tree
Showing 32 changed files with 482 additions and 268 deletions.
16 changes: 8 additions & 8 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@
],
"rollForward": true
},
"dotnet-ilverify": {
"version": "9.0.0-rc.2.24473.5",
"commands": [
"ilverify"
],
"rollForward": true
},
"fantomas": {
"version": "6.2.3",
"commands": [
"fantomas"
],
"rollForward": true
},
"dotnet-ilverify": {
"version": "9.0.0",
"commands": [
"ilverify"
],
"rollForward": false
}
}
}
}
8 changes: 8 additions & 0 deletions .config/feature-lsp-branch-merge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"merge-flow-configurations": {
"main": {
"MergeToBranch": "feature/lsp",
"ExtraSwitches": "-QuietComments"
}
}
}
13 changes: 13 additions & 0 deletions .config/service-branch-merge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"merge-flow-configurations": {
// regular branch flow
"release/dev17.13": {
"MergeToBranch": "main",
"ExtraSwitches": "-QuietComments"
},
"main": {
"MergeToBranch": "release/dev17.14",
"ExtraSwitches": "-QuietComments"
}
}
}
22 changes: 22 additions & 0 deletions .github/workflows/branch-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Merges any changes from servicing branches forward.

name: Flow servicing changes to main
on:
push:
branches:
- 'release/*'
- 'main'

permissions:
contents: write
pull-requests: write

jobs:
servicing-flow:
uses: dotnet/arcade/.github/workflows/inter-branch-merge-base.yml@main
with:
configuration_file_path: '.config/service-branch-merge.json'
feature-lsp-flow:
uses: dotnet/arcade/.github/workflows/inter-branch-merge-base.yml@main
with:
configuration_file_path: '.config/feature-lsp-branch-merge.json'
10 changes: 10 additions & 0 deletions DEVGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,16 @@ or
> 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.

### Parallel execution of tests

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.
For example:
```fsharp
[<Collection(nameof NotThreadSafeResourceCollection)>]
module TimeCritical =
```


### Updating FCS surface area baselines

```bash
Expand Down
1 change: 1 addition & 0 deletions docs/release-notes/.FSharp.Compiler.Service/9.0.300.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* 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))
* 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)==
* Set `Cancellable.token` from async computation ([Issue #18235](https://github.com/dotnet/fsharp/issues/18235), [PR #18238](https://github.com/dotnet/fsharp/pull/18238))
* Cancellable: only cancel on OCE with own token ([PR #18277](https://github.com/dotnet/fsharp/pull/18277))

### Added
* Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241))
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Checking/CheckDeclarations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5479,7 +5479,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem
and [<TailCall>] TcModuleOrNamespaceElementsNonMutRec cenv parent typeNames endm (defsSoFar, env, envAtEnd) (moreDefs: SynModuleDecl list) (ct: CancellationToken) =

if ct.IsCancellationRequested then
ValueOrCancelled.Cancelled (OperationCanceledException())
ValueOrCancelled.Cancelled(OperationCanceledException ct)
else
match moreDefs with
| [] ->
Expand Down
5 changes: 0 additions & 5 deletions src/Compiler/Service/IncrementalBuild.fs
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,6 @@ type TcInfoExtras =
member x.TcSymbolUses =
x.tcSymbolUses

module ValueOption =
let toOption = function
| ValueSome x -> Some x
| _ -> None

type private SingleFileDiagnostics = (PhasedDiagnostic * FSharpDiagnosticSeverity) array
type private TypeCheck = TcInfo * TcResultsSinkImpl * CheckedImplFile option * string * SingleFileDiagnostics

Expand Down
12 changes: 1 addition & 11 deletions src/Compiler/TypedTree/TypeProviders.fs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ let CreateTypeProvider (

// Create the TypeProviderConfig to pass to the type provider constructor
let e =
#if FSHARPCORE_USE_PACKAGE
TypeProviderConfig(systemRuntimeContainsType,
ReferencedAssemblies=getReferencedAssemblies(),
ResolutionFolder=resolutionEnvironment.ResolutionFolder,
Expand All @@ -131,16 +130,7 @@ let CreateTypeProvider (
IsInvalidationSupported=isInvalidationSupported,
IsHostedExecution= isInteractive,
SystemRuntimeAssemblyVersion = systemRuntimeAssemblyVersion)
#else
TypeProviderConfig(systemRuntimeContainsType,
ReferencedAssemblies=getReferencedAssemblies(),
ResolutionFolder=resolutionEnvironment.ResolutionFolder,
RuntimeAssembly=runtimeAssemblyPath,
TemporaryFolder=resolutionEnvironment.TemporaryFolder,
IsInvalidationSupported=isInvalidationSupported,
IsHostedExecution= isInteractive,
SystemRuntimeAssemblyVersion = systemRuntimeAssemblyVersion)
#endif

protect (fun () -> !!(Activator.CreateInstance(typeProviderImplementationType, [| box e|])) :?> ITypeProvider )

elif not(isNull(typeProviderImplementationType.GetConstructor [| |])) then
Expand Down
6 changes: 3 additions & 3 deletions src/Compiler/TypedTree/TypedTree.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2122,7 +2122,7 @@ type ModuleOrNamespaceType(kind: ModuleOrNamespaceKind, vals: QueueList<Val>, en
|> List.tryFind (fun v -> match key.TypeForLinkage with
| None -> true
| Some keyTy -> ccu.MemberSignatureEquality(keyTy, v.Type))
|> ValueOptionInternal.ofOption
|> ValueOption.ofOption

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

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

/// Get the attributes associated with the compiled property of the record field
member x.PropertyAttribs = x.RecdField.PropertyAttribs
Expand Down
6 changes: 3 additions & 3 deletions src/Compiler/TypedTree/TypedTreeOps.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3526,11 +3526,11 @@ let IsMatchingFSharpAttributeOpt g attrOpt (Attrib(tcref2, _, _, _, _, _, _)) =

[<return: Struct>]
let (|ExtractAttribNamedArg|_|) nm args =
args |> List.tryPick (function AttribNamedArg(nm2, _, _, v) when nm = nm2 -> Some v | _ -> None) |> ValueOptionInternal.ofOption
args |> List.tryPick (function AttribNamedArg(nm2, _, _, v) when nm = nm2 -> Some v | _ -> None) |> ValueOption.ofOption

[<return: Struct>]
let (|ExtractILAttributeNamedArg|_|) nm (args: ILAttributeNamedArg list) =
args |> List.tryPick (function nm2, _, _, v when nm = nm2 -> Some v | _ -> None) |> ValueOptionInternal.ofOption
args |> List.tryPick (function nm2, _, _, v when nm = nm2 -> Some v | _ -> None) |> ValueOption.ofOption

[<return: Struct>]
let (|StringExpr|_|) = function Expr.Const (Const.String n, _, _) -> ValueSome n | _ -> ValueNone
Expand Down
5 changes: 3 additions & 2 deletions src/Compiler/Utilities/Cancellable.fs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ module Cancellable =
try
use _ = Cancellable.UsingToken(ct)
oper ct
with :? OperationCanceledException as e ->
ValueOrCancelled.Cancelled(OperationCanceledException e.CancellationToken)
with
| :? OperationCanceledException as e when ct.IsCancellationRequested -> ValueOrCancelled.Cancelled e
| :? OperationCanceledException as e -> InvalidOperationException("Wrong cancellation token", e) |> raise

let fold f acc seq =
Cancellable(fun ct ->
Expand Down
12 changes: 0 additions & 12 deletions src/Compiler/Utilities/illib.fs
Original file line number Diff line number Diff line change
Expand Up @@ -715,18 +715,6 @@ module Span =

state

module ValueOptionInternal =

let inline ofOption x =
match x with
| Some x -> ValueSome x
| None -> ValueNone

let inline bind ([<InlineIfLambda>] f) x =
match x with
| ValueSome x -> f x
| ValueNone -> ValueNone

module String =
let make (n: int) (c: char) : string = String(c, n)

Expand Down
6 changes: 0 additions & 6 deletions src/Compiler/Utilities/illib.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,6 @@ module internal ResizeArray =
module internal Span =
val inline exists: predicate: ('T -> bool) -> span: Span<'T> -> bool

module internal ValueOptionInternal =

val inline ofOption: x: 'a option -> 'a voption

val inline bind: f: ('a -> 'b voption) -> x: 'a voption -> 'b voption

module internal String =

val make: n: int -> c: char -> string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,23 @@ module CustomAttributes_AttributeUsage =
|> verifyCompileAndRun
|> shouldSucceed

// SOURCE=AssemblyVersion03.fs # AssemblyVersion03.fs
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"AssemblyVersion03.fs"|])>]
let ``AssemblyVersion03_fs`` compilation =
compilation
|> withOptions ["--nowarn:52"]
|> verifyCompileAndRun
|> shouldSucceed

// SOURCE=AssemblyVersion04.fs # AssemblyVersion04.fs
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"AssemblyVersion04.fs"|])>]
let ``AssemblyVersion04_fs`` compilation =
compilation
|> withOptions ["--nowarn:52"]
|> verifyCompileAndRun
|> shouldSucceed
[<Collection(nameof NotThreadSafeResourceCollection)>]
module TimeCritical =
// SOURCE=AssemblyVersion03.fs # AssemblyVersion03.fs
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"AssemblyVersion03.fs"|])>]
let ``AssemblyVersion03_fs`` compilation =
compilation
|> withOptions ["--nowarn:52"]
|> verifyCompileAndRun
|> shouldSucceed

// SOURCE=AssemblyVersion04.fs # AssemblyVersion04.fs
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"AssemblyVersion04.fs"|])>]
let ``AssemblyVersion04_fs`` compilation =
compilation
|> withOptions ["--nowarn:52"]
|> verifyCompileAndRun
|> shouldSucceed

// SOURCE=AttributeTargetsIsCtor01.fs # AttributeTargetsIsCtor01.fs
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"AttributeTargetsIsCtor01.fs"|])>]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,15 @@ module Events =
|> verifyCompileAndRun
|> shouldSucceed

// NoMT SOURCE=SanityCheck02.fs # SanityCheck02.fs
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"SanityCheck02.fs"|])>]
let ``SanityCheck02_fs`` compilation =
compilation
|> verifyCompileAndRun
|> shouldSucceed

#if false && !NETCOREAPP && !NETSTANDARD
// SOURCE=SanityCheck02.fs PEVER=/MD # SanityCheck02.fs - /MD
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"SanityCheck02.fs"|])>]
let ``SanityCheck02_fs_peverify`` compilation =
let ``SanityCheck02`` compilation =
compilation
|> asExe
|> withOptions ["--nowarn:988"]
|> PEVerifier.verifyPEFile
|> PEVerifier.shouldSucceed
#endif
|> verifyCompileAndRun
|> shouldSucceed
|> verifyPEFileWithSystemDlls
|> withOutputContainsAllInOrderWithWildcards [
"All Classes and Methods in*SanityCheck02.exe Verified."
]
Loading

0 comments on commit d0c5ca2

Please sign in to comment.