Skip to content

Commit ea4b847

Browse files
authored
Merge branch 'release/dev17.5' into merges/main-to-release/dev17.5
2 parents 33f9cf8 + 49a0e2e commit ea4b847

File tree

67 files changed

+665
-479
lines changed

Some content is hidden

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

67 files changed

+665
-479
lines changed

azure-pipelines.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ stages:
8484
# Signed build #
8585
#-------------------------------------------------------------------------------------------------------------------#
8686
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
87-
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.3') }}:
87+
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.5') }}:
8888
- template: /eng/common/templates/job/onelocbuild.yml
8989
parameters:
9090
MirrorRepo: fsharp
91-
MirrorBranch: release/dev17.3
91+
MirrorBranch: release/dev17.5
9292
LclSource: lclFilesfromPackage
9393
LclPackageId: 'LCL-JUNO-PROD-FSHARP'
9494
- template: /eng/common/templates/jobs/jobs.yml
@@ -104,7 +104,7 @@ stages:
104104
jobs:
105105
- job: Full_Signed
106106
pool:
107-
name: NetCore1ESPool-Internal
107+
name: NetCore1ESPool-Svc-Internal
108108
demands: ImageOverride -equals windows.vs2022.amd64
109109
timeoutInMinutes: 300
110110
variables:
@@ -727,8 +727,8 @@ stages:
727727
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
728728
- template: eng/release/insert-into-vs.yml
729729
parameters:
730-
componentBranchName: refs/heads/release/dev17.3
731-
insertTargetBranch: rel/d17.3
730+
componentBranchName: refs/heads/release/dev17.5
731+
insertTargetBranch: main
732732
insertTeamEmail: [email protected]
733733
insertTeamName: 'F#'
734734
completeInsertion: 'auto'

eng/Versions.props

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<!-- F# Version components -->
1616
<FSMajorVersion>7</FSMajorVersion>
1717
<FSMinorVersion>0</FSMinorVersion>
18-
<FSBuildVersion>0</FSBuildVersion>
18+
<FSBuildVersion>1</FSBuildVersion>
1919
<FSRevisionVersion>0</FSRevisionVersion>
2020
<!-- -->
2121
<!-- F# Language version -->
@@ -33,7 +33,7 @@
3333
<!-- FSharp.Compiler.Service version -->
3434
<FCSMajorVersion>42</FCSMajorVersion>
3535
<FCSMinorVersion>7</FCSMinorVersion>
36-
<FCSBuildVersion>100</FCSBuildVersion>
36+
<FCSBuildVersion>200</FCSBuildVersion>
3737
<FCSRevisionVersion>$(FSRevisionVersion)</FCSRevisionVersion>
3838
<FSharpCompilerServicePackageVersion>$(FCSMajorVersion).$(FCSMinorVersion).$(FCSBuildVersion)</FSharpCompilerServicePackageVersion>
3939
<FSharpCompilerServiceVersion>$(FCSMajorVersion).$(FCSMinorVersion).$(FCSBuildVersion).$(FCSRevisionVersion)</FSharpCompilerServiceVersion>
@@ -47,16 +47,19 @@
4747
<!-- -->
4848
<!-- FSharp tools for Visual Studio version number -->
4949
<FSToolsMajorVersion>12</FSToolsMajorVersion>
50-
<FSToolsMinorVersion>0</FSToolsMinorVersion>
51-
<FSToolsBuildVersion>5</FSToolsBuildVersion>
50+
51+
<FSToolsMinorVersion>5</FSToolsMinorVersion>
52+
<FSToolsBuildVersion>0</FSToolsBuildVersion>
5253
<FSToolsRevisionVersion>$(FSRevisionVersion)</FSToolsRevisionVersion>
5354
<FSProductVersionPrefix>$(FSToolsMajorVersion).$(FSToolsMinorVersion).$(FSToolsBuildVersion)</FSProductVersionPrefix>
5455
<FSProductVersionReleaseNotesVersion>$(FSToolsMajorVersion)-$(FSToolsMinorVersion)-$(FSToolsBuildVersion)</FSProductVersionReleaseNotesVersion>
5556
<FSProductVersion>$(FSToolsMajorVersion).$(FSToolsMinorVersion).$(FSToolsBuildVersion).$(FSToolsRevisionVersion)</FSProductVersion>
5657
</PropertyGroup>
5758
<PropertyGroup>
5859
<VSMajorVersion>17</VSMajorVersion>
59-
<VSMinorVersion>3</VSMinorVersion>
60+
61+
<VSMinorVersion>5</VSMinorVersion>
62+
6063
<VSGeneralVersion>$(VSMajorVersion).0</VSGeneralVersion>
6164
<VSAssemblyVersionPrefix>$(VSMajorVersion).$(VSMinorVersion).0</VSAssemblyVersionPrefix>
6265
<VSAssemblyVersion>$(VSAssemblyVersionPrefix).0</VSAssemblyVersion>
@@ -107,7 +110,6 @@
107110
<MicrosoftCodeAnalysisEditorFeaturesWpfVersion>$(RoslynVersion)</MicrosoftCodeAnalysisEditorFeaturesWpfVersion>
108111
<MicrosoftCodeAnalysisExternalAccessFSharpVersion>$(RoslynVersion)</MicrosoftCodeAnalysisExternalAccessFSharpVersion>
109112
<MicrosoftCodeAnalysisVersion>$(RoslynVersion)</MicrosoftCodeAnalysisVersion>
110-
<MicrosoftCodeAnalysisWorkspacesCommonVersion>$(RoslynVersion)</MicrosoftCodeAnalysisWorkspacesCommonVersion>
111113
<MicrosoftCodeAnalysisCSharpVersion>$(RoslynVersion)</MicrosoftCodeAnalysisCSharpVersion>
112114
<MicrosoftVisualStudioLanguageServicesVersion>$(RoslynVersion)</MicrosoftVisualStudioLanguageServicesVersion>
113115
<MicrosoftCodeAnalysisTestResourcesProprietaryVersion>2.0.28</MicrosoftCodeAnalysisTestResourcesProprietaryVersion>

eng/release/insert-into-vs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ stages:
1414
jobs:
1515
- job: Insert_VS
1616
pool:
17-
name: NetCore1ESPool-Internal
17+
name: NetCore1ESPool-Svc-Internal
1818
demands: ImageOverride -equals windows.vs2019.amd64
1919
variables:
2020
- group: DotNet-VSTS-Infra-Access

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"sdk": {
3-
"version": "7.0.100-rc.2.22477.23",
3+
"version": "7.0.100-rc.1.22431.12",
44
"allowPrerelease": true,
55
"rollForward": "latestPatch"
66
},
77
"tools": {
8-
"dotnet": "7.0.100-rc.2.22477.23",
8+
"dotnet": "7.0.100-rc.1.22431.12",
99
"vs": {
1010
"version": "17.2",
1111
"components": [

src/Compiler/AbstractIL/ilwrite.fs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ let canGenPropertyDef cenv (prop: ILPropertyDef) =
11921192
// If we have GetMethod or SetMethod set (i.e. not None), try and see if we have MethodDefs for them.
11931193
// NOTE: They can be not-None and missing MethodDefs if we skip generating them for reference assembly in the earlier pass.
11941194
// Only generate property if we have at least getter or setter, otherwise, we skip.
1195-
[| prop.GetMethod; prop.SetMethod |]
1195+
[| prop.GetMethod; prop.SetMethod |]
11961196
|> Array.choose id
11971197
|> Array.map (TryGetMethodRefAsMethodDefIdx cenv)
11981198
|> Array.exists (function | Ok _ -> true | _ -> false)
@@ -1304,11 +1304,14 @@ and GenTypeDefPass2 pidx enc cenv (tdef: ILTypeDef) =
13041304
// Now generate or assign index numbers for tables referenced by the maps.
13051305
// Don't yet generate contents of these tables - leave that to pass3, as
13061306
// code may need to embed these entries.
1307-
tdef.Implements |> List.iter (GenImplementsPass2 cenv env tidx)
1308-
props |> List.iter (GenPropertyDefPass2 cenv tidx)
1307+
tdef.Implements |> List.iter (GenImplementsPass2 cenv env tidx)
13091308
events |> List.iter (GenEventDefPass2 cenv tidx)
13101309
tdef.Fields.AsList() |> List.iter (GenFieldDefPass2 tdef cenv tidx)
13111310
tdef.Methods |> Seq.iter (GenMethodDefPass2 tdef cenv tidx)
1311+
// Generation of property definitions for **ref assemblies** is checking existence of generated method definitions.
1312+
// Therefore, due to mutable state within "cenv", order of operations matters.
1313+
// Who could have thought that using shared mutable state can bring unexpected bugs...?
1314+
props |> List.iter (GenPropertyDefPass2 cenv tidx)
13121315
tdef.NestedTypes.AsList() |> GenTypeDefsPass2 tidx (enc@[tdef.Name]) cenv
13131316
with exn ->
13141317
failwith ("Error in pass2 for type "+tdef.Name+", error: " + exn.Message)

src/Compiler/Driver/FxResolver.fs

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -382,16 +382,16 @@ type internal FxResolver
382382

383383
let tryGetNetCoreRefsPackDirectoryRoot () = tryNetCoreRefsPackDirectoryRoot.Force()
384384

385+
let getTfmNumber (v: string) =
386+
let arr = v.Split([| '.' |], 3)
387+
arr[0] + "." + arr[1]
388+
385389
// Tries to figure out the tfm for the compiler instance.
386390
// On coreclr it uses the deps.json file
387391
//
388392
// On-demand because (a) some FxResolver are ephemeral (b) we want to avoid recomputation
389-
let tryGetRunningTfm =
393+
let tryGetRunningTfm () =
390394
let runningTfmOpt =
391-
let getTfmNumber (v: string) =
392-
let arr = v.Split([| '.' |], 3)
393-
arr[0] + "." + arr[1]
394-
395395
// Compute TFM from System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription
396396
// System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription;;
397397
// val it: string = ".NET 6.0.7"
@@ -548,6 +548,24 @@ type internal FxResolver
548548
assemblyReferences |> List.iter traverseDependencies
549549
assemblies
550550

551+
let tryGetTfmFromSdkDir (sdkDir: string) =
552+
let dotnetConfigFile = Path.Combine(sdkDir, "dotnet.runtimeconfig.json")
553+
554+
try
555+
use stream = FileSystem.OpenFileForReadShim(dotnetConfigFile)
556+
let dotnetConfig = stream.ReadAllText()
557+
let pattern = "\"tfm\": \""
558+
559+
let startPos =
560+
dotnetConfig.IndexOf(pattern, StringComparison.OrdinalIgnoreCase)
561+
+ pattern.Length
562+
563+
let endPos = dotnetConfig.IndexOf("\"", startPos)
564+
let tfm = dotnetConfig[startPos .. endPos - 1]
565+
tfm
566+
with _ ->
567+
tryGetRunningTfm ()
568+
551569
// This list is the default set of references for "non-project" files.
552570
//
553571
// These DLLs are
@@ -799,12 +817,37 @@ type internal FxResolver
799817
RequireFxResolverLock(fxtok, "assuming all member require lock")
800818
tryGetSdkDir () |> replayWarnings)
801819

802-
/// Gets the selected target framework moniker, e.g netcore3.0, net472, and the running rid of the current machine
820+
/// Gets
821+
/// 1. The Target Framework Moniker (TFM) used for scripting (e.g netcore3.0, net472)
822+
/// 2. The running RID of the current machine (e.g. win-x64)
823+
///
824+
/// When analyzing scripts for editing, this is **not** necessarily the running TFM. Rather, it is the TFM to use for analysing
825+
/// a script.
826+
///
827+
/// Summary:
828+
/// - When running scripts (isInteractive = true) this is identical to the running TFM.
829+
///
830+
/// - When analyzing .NET Core scripts (isInteractive = false, tryGetSdkDir is Some),
831+
/// the scripting TFM is determined from dotnet.runtimeconfig.json in the SDK directory
832+
///
833+
/// - Otherwise, the running TFM is used. That is, if editing with .NET Framework/Core-based tooling a script is assumed
834+
/// to be .NET Framework/Core respectively.
835+
///
836+
/// The RID returned is always the RID of the running machine.
803837
member _.GetTfmAndRid() =
804838
fxlock.AcquireLock(fun fxtok ->
805839
RequireFxResolverLock(fxtok, "assuming all member require lock")
806840

807-
let runningTfm = tryGetRunningTfm
841+
// Interactive processes read their own configuration to find the running tfm
842+
let targetTfm =
843+
if isInteractive then
844+
tryGetRunningTfm ()
845+
else
846+
let sdkDir = tryGetSdkDir () |> replayWarnings
847+
848+
match sdkDir with
849+
| Some dir -> tryGetTfmFromSdkDir dir
850+
| None -> tryGetRunningTfm ()
808851

809852
// Coreclr has mechanism for getting rid
810853
// System.Runtime.InteropServices.RuntimeInformation.RuntimeIdentifier
@@ -855,7 +898,7 @@ type internal FxResolver
855898
| Architecture.Arm64 -> baseRid + "-arm64"
856899
| _ -> baseRid + "-arm"
857900

858-
runningTfm, runningRid)
901+
targetTfm, runningRid)
859902

860903
static member ClearStaticCaches() =
861904
desiredDotNetSdkVersionForDirectoryCache.Clear()
@@ -878,7 +921,7 @@ type internal FxResolver
878921
let defaultReferences =
879922
if assumeDotNetFramework then
880923
getDotNetFrameworkDefaultReferences useFsiAuxLib, assumeDotNetFramework
881-
else if useSdkRefs then
924+
elif useSdkRefs then
882925
// Go fetch references
883926
let sdkDir = tryGetSdkRefsPackDirectory () |> replayWarnings
884927

0 commit comments

Comments
 (0)