Skip to content

Commit

Permalink
Merge release/dev17.5 to main (#14577)
Browse files Browse the repository at this point in the history
* Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 1997730 (#13925) (#14041)

Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com>

* Merge main to release/dev17.5 (#14043)

Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com>
Co-authored-by: Don Syme <dsyme@users.noreply.github.com>
Co-authored-by: Tomas Grosup <tomasgrosup@microsoft.com>
Co-authored-by: Edgar Gonzalez <edgar.gonzalez@fundourselves.com>
Co-authored-by: Eugene Auduchinok <eugene.auduchinok@jetbrains.com>
Co-authored-by: Chet Husk <baronfel@users.noreply.github.com>
Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Florian Verdonck <florian.verdonck@outlook.com>
Co-authored-by: Petr <psfinaki@users.noreply.github.com>
Co-authored-by: Petr Pokorny <petrpokorny@microsoft.com>
Co-authored-by: Theodore Tsirpanis <teo@tsirpanis.gr>

* Update FSharp.Editor.fsproj

I believe a bad merge happened, this line is not in main.  And the file does not exist in either branch.

* Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2014480 (#14049)

* Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2016907

* Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2016985

* XLF

* Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2017073

* Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2017391

* Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2017391

* Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2018131 (#14089)

* Bugfix: Ref assemblies contained .property definitions at the wrong type in generated IL (#14093)

* Bugfix: Ref assemblies contained property definitions at the wrong type

* Better comment

* Update versions for dev17.4 (#14102)

* Update versions for dev17.5 (#14100)

* Merge main to release/dev17.5 (#14098)

* Add SynType.Or. (#14058)

* Add SynType.Or for generic constrains in the form (^A or ^B):...

* Change ty1.Equals(ty2) to call static op_Equality (#13028)

Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com>
Co-authored-by: Don Syme <dsyme@users.noreply.github.com>

Co-authored-by: Florian Verdonck <florian.verdonck@outlook.com>
Co-authored-by: Rustam <rstm.sf@gmail.com>
Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com>
Co-authored-by: Don Syme <dsyme@users.noreply.github.com>

* Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2023680 (#14133)

* Disable ref assemblies in e2e tests (#14135)

Disable reference assemblies for e2e test of type providers

Co-authored-by: Adam Boniecki <adboniec@microsoft.com>
Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com>

* Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2024009 (#14139)

* Downgrade SDK, rc2 is failing signing (#14146)

* Generate SBOM for Fsharp (#14029) (#14169)

* Generate Sbom

* pass ci flag

* update

* Sbom generation

* Fix for trimming tests: Added nuget.org source + explicit source mapping for FSharp.Core

* Update Build.ps1

Tweaks to handle useGlobalNugetCache

Co-authored-by: Kevin Ransom (msft) <codecutter@hotmail.com>
Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com>
Co-authored-by: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com>

Co-authored-by: Epsitha Ananth <47157394+epananth@users.noreply.github.com>
Co-authored-by: Kevin Ransom (msft) <codecutter@hotmail.com>
Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com>
Co-authored-by: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com>

* Update Arcade & Put automated pool provider usage functionality into Dev17.4 branch (similar to PR in main now but will not be backported here) (#14177)

* [release/dev17.4] fix metadata failure due to double integration of signature (#14190)

* fix metadata failure due to double duplication

* fix metadata failure due to double duplication

Co-authored-by: Don Syme <dsyme@users.noreply.github.com>

* Global.json

* [release/dev17.4] Don't emit IsReadOnlyAttribute if not available. (#14281)

Co-authored-by: nojaf <florian.verdonck@outlook.com>

* Fixed package versions to publicly available (#14291)

* Fixed package versions to publicly available

* Update Versions.props

Microsoft.Build.* to 17.4.0

Co-authored-by: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com>

* Update Versions.props

* Prefer nullable over other conversions, fixes #14302

* Replace ROSpan for DateTimeOffset as op_Implicit target, ROSpan is not defined on all test TFMs

* [release/dev17.4] F# 7 fixes (#14322)

* WIP: Fix for calling init-only setter via srtp call + allow calling special-named functions via srtp
* Fix 14097

Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com>
Co-authored-by: Tomas Grosup <tomasgrosup@microsoft.com>
Co-authored-by: Don Syme <dsyme@users.noreply.github.com>

* Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2051937 (#14381)

* Deploy System.Diagnostics.DiagnosticSource to Tools folder (#14417)

* Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2059214 (#14427)

* Revert "IL: optimize attribute cluster reading (#13821)"

This reverts commit 179db4e.

* Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2067933 (#14472)

* Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2067933

* Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2067933

* Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2068561 (#14474)

* Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2068115

* Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2068115

Co-authored-by: Tomas Grosup <tomasgrosup@microsoft.com>

* Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2077478 (#14533)

* Revert "Merge branch 'release/dev17.5' of https://github.com/dotnet/fsharp into release/dev17.5"

This reverts commit 4d222de, reversing
changes made to 2e92791.

* Update azure-pipelines.yml

* Merge main to release/dev17.5 (#14562)

Co-authored-by: Petr <psfinaki@users.noreply.github.com>
Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com>

Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com>
Co-authored-by: Don Syme <dsyme@users.noreply.github.com>
Co-authored-by: Tomas Grosup <tomasgrosup@microsoft.com>
Co-authored-by: Edgar Gonzalez <edgar.gonzalez@fundourselves.com>
Co-authored-by: Eugene Auduchinok <eugene.auduchinok@jetbrains.com>
Co-authored-by: Chet Husk <baronfel@users.noreply.github.com>
Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Florian Verdonck <florian.verdonck@outlook.com>
Co-authored-by: Petr <psfinaki@users.noreply.github.com>
Co-authored-by: Petr Pokorny <petrpokorny@microsoft.com>
Co-authored-by: Theodore Tsirpanis <teo@tsirpanis.gr>
Co-authored-by: Kevin Ransom (msft) <codecutter@hotmail.com>
Co-authored-by: Rustam <rstm.sf@gmail.com>
Co-authored-by: Adam Boniecki <20281641+abonie@users.noreply.github.com>
Co-authored-by: Adam Boniecki <adboniec@microsoft.com>
Co-authored-by: Epsitha Ananth <47157394+epananth@users.noreply.github.com>
Co-authored-by: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com>
Co-authored-by: Matt Galbraith <MattGal@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nino Floris <mail@ninofloris.com>
  • Loading branch information
21 people authored Jan 11, 2023
1 parent bd6acfb commit f1ec7d7
Show file tree
Hide file tree
Showing 80 changed files with 1,467 additions and 1,283 deletions.
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ stages:
# Signed build #
#-------------------------------------------------------------------------------------------------------------------#
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.3') }}:
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.5') }}:
- template: /eng/common/templates/job/onelocbuild.yml
parameters:
MirrorRepo: fsharp
MirrorBranch: release/dev17.3
MirrorBranch: release/dev17.5
LclSource: lclFilesfromPackage
LclPackageId: 'LCL-JUNO-PROD-FSHARP'
- template: /eng/common/templates/jobs/jobs.yml
Expand Down Expand Up @@ -666,8 +666,8 @@ stages:
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- template: eng/release/insert-into-vs.yml
parameters:
componentBranchName: refs/heads/release/dev17.3
insertTargetBranch: rel/d17.3
componentBranchName: refs/heads/release/dev17.5
insertTargetBranch: rel/d17.5
insertTeamEmail: fsharpteam@microsoft.com
insertTeamName: 'F#'
completeInsertion: 'auto'
12 changes: 6 additions & 6 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<!-- F# Version components -->
<FSMajorVersion>7</FSMajorVersion>
<FSMinorVersion>0</FSMinorVersion>
<FSBuildVersion>0</FSBuildVersion>
<FSBuildVersion>1</FSBuildVersion>
<FSRevisionVersion>0</FSRevisionVersion>
<!-- -->
<!-- F# Language version -->
Expand All @@ -33,7 +33,7 @@
<!-- FSharp.Compiler.Service version -->
<FCSMajorVersion>43</FCSMajorVersion>
<FCSMinorVersion>7</FCSMinorVersion>
<FCSBuildVersion>102</FCSBuildVersion>
<FCSBuildVersion>200</FCSBuildVersion>
<FCSRevisionVersion>$(FSRevisionVersion)</FCSRevisionVersion>
<FSharpCompilerServicePackageVersion>$(FCSMajorVersion).$(FCSMinorVersion).$(FCSBuildVersion)</FSharpCompilerServicePackageVersion>
<FSharpCompilerServiceVersion>$(FCSMajorVersion).$(FCSMinorVersion).$(FCSBuildVersion).$(FCSRevisionVersion)</FSharpCompilerServiceVersion>
Expand All @@ -47,16 +47,17 @@
<!-- -->
<!-- FSharp tools for Visual Studio version number -->
<FSToolsMajorVersion>12</FSToolsMajorVersion>
<FSToolsMinorVersion>0</FSToolsMinorVersion>
<FSToolsBuildVersion>5</FSToolsBuildVersion>

<FSToolsMinorVersion>5</FSToolsMinorVersion>
<FSToolsBuildVersion>0</FSToolsBuildVersion>
<FSToolsRevisionVersion>$(FSRevisionVersion)</FSToolsRevisionVersion>
<FSProductVersionPrefix>$(FSToolsMajorVersion).$(FSToolsMinorVersion).$(FSToolsBuildVersion)</FSProductVersionPrefix>
<FSProductVersionReleaseNotesVersion>$(FSToolsMajorVersion)-$(FSToolsMinorVersion)-$(FSToolsBuildVersion)</FSProductVersionReleaseNotesVersion>
<FSProductVersion>$(FSToolsMajorVersion).$(FSToolsMinorVersion).$(FSToolsBuildVersion).$(FSToolsRevisionVersion)</FSProductVersion>
</PropertyGroup>
<PropertyGroup>
<VSMajorVersion>17</VSMajorVersion>
<VSMinorVersion>3</VSMinorVersion>
<VSMinorVersion>5</VSMinorVersion>
<VSGeneralVersion>$(VSMajorVersion).0</VSGeneralVersion>
<VSAssemblyVersionPrefix>$(VSMajorVersion).$(VSMinorVersion).0</VSAssemblyVersionPrefix>
<VSAssemblyVersion>$(VSAssemblyVersionPrefix).0</VSAssemblyVersion>
Expand Down Expand Up @@ -108,7 +109,6 @@
<MicrosoftCodeAnalysisEditorFeaturesWpfVersion>$(RoslynVersion)</MicrosoftCodeAnalysisEditorFeaturesWpfVersion>
<MicrosoftCodeAnalysisExternalAccessFSharpVersion>$(RoslynVersion)</MicrosoftCodeAnalysisExternalAccessFSharpVersion>
<MicrosoftCodeAnalysisVersion>$(RoslynVersion)</MicrosoftCodeAnalysisVersion>
<MicrosoftCodeAnalysisWorkspacesCommonVersion>$(RoslynVersion)</MicrosoftCodeAnalysisWorkspacesCommonVersion>
<MicrosoftCodeAnalysisCSharpVersion>$(RoslynVersion)</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftVisualStudioLanguageServicesVersion>$(RoslynVersion)</MicrosoftVisualStudioLanguageServicesVersion>
<MicrosoftCodeAnalysisTestResourcesProprietaryVersion>2.0.28</MicrosoftCodeAnalysisTestResourcesProprietaryVersion>
Expand Down
2 changes: 1 addition & 1 deletion eng/release/insert-into-vs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ stages:
jobs:
- job: Insert_VS
pool:
name: NetCore1ESPool-Internal
name: NetCore1ESPool-Svc-Internal
demands: ImageOverride -equals windows.vs2019.amd64
variables:
- group: DotNet-VSTS-Infra-Access
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22554.2",
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22554.2"
}
}
}
9 changes: 6 additions & 3 deletions src/Compiler/AbstractIL/ilwrite.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ let canGenPropertyDef cenv (prop: ILPropertyDef) =
// If we have GetMethod or SetMethod set (i.e. not None), try and see if we have MethodDefs for them.
// NOTE: They can be not-None and missing MethodDefs if we skip generating them for reference assembly in the earlier pass.
// Only generate property if we have at least getter or setter, otherwise, we skip.
[| prop.GetMethod; prop.SetMethod |]
[| prop.GetMethod; prop.SetMethod |]
|> Array.choose id
|> Array.map (TryGetMethodRefAsMethodDefIdx cenv)
|> Array.exists (function | Ok _ -> true | _ -> false)
Expand Down Expand Up @@ -1302,11 +1302,14 @@ and GenTypeDefPass2 pidx enc cenv (tdef: ILTypeDef) =
// Now generate or assign index numbers for tables referenced by the maps.
// Don't yet generate contents of these tables - leave that to pass3, as
// code may need to embed these entries.
tdef.Implements |> List.iter (GenImplementsPass2 cenv env tidx)
props |> List.iter (GenPropertyDefPass2 cenv tidx)
tdef.Implements |> List.iter (GenImplementsPass2 cenv env tidx)
events |> List.iter (GenEventDefPass2 cenv tidx)
tdef.Fields.AsList() |> List.iter (GenFieldDefPass2 tdef cenv tidx)
tdef.Methods |> Seq.iter (GenMethodDefPass2 tdef cenv tidx)
// Generation of property definitions for **ref assemblies** is checking existence of generated method definitions.
// Therefore, due to mutable state within "cenv", order of operations matters.
// Who could have thought that using shared mutable state can bring unexpected bugs...?
props |> List.iter (GenPropertyDefPass2 cenv tidx)
tdef.NestedTypes.AsList() |> GenTypeDefsPass2 tidx (enc@[tdef.Name]) cenv
with exn ->
failwith ("Error in pass2 for type "+tdef.Name+", error: " + exn.Message)
Expand Down
61 changes: 52 additions & 9 deletions src/Compiler/Driver/FxResolver.fs
Original file line number Diff line number Diff line change
Expand Up @@ -382,16 +382,16 @@ type internal FxResolver

let tryGetNetCoreRefsPackDirectoryRoot () = tryNetCoreRefsPackDirectoryRoot.Force()

let getTfmNumber (v: string) =
let arr = v.Split([| '.' |], 3)
arr[0] + "." + arr[1]

// Tries to figure out the tfm for the compiler instance.
// On coreclr it uses the deps.json file
//
// On-demand because (a) some FxResolver are ephemeral (b) we want to avoid recomputation
let tryGetRunningTfm =
let tryGetRunningTfm () =
let runningTfmOpt =
let getTfmNumber (v: string) =
let arr = v.Split([| '.' |], 3)
arr[0] + "." + arr[1]

// Compute TFM from System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription
// System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription;;
// val it: string = ".NET 6.0.7"
Expand Down Expand Up @@ -548,6 +548,24 @@ type internal FxResolver
assemblyReferences |> List.iter traverseDependencies
assemblies

let tryGetTfmFromSdkDir (sdkDir: string) =
let dotnetConfigFile = Path.Combine(sdkDir, "dotnet.runtimeconfig.json")

try
use stream = FileSystem.OpenFileForReadShim(dotnetConfigFile)
let dotnetConfig = stream.ReadAllText()
let pattern = "\"tfm\": \""

let startPos =
dotnetConfig.IndexOf(pattern, StringComparison.OrdinalIgnoreCase)
+ pattern.Length

let endPos = dotnetConfig.IndexOf("\"", startPos)
let tfm = dotnetConfig[startPos .. endPos - 1]
tfm
with _ ->
tryGetRunningTfm ()

// This list is the default set of references for "non-project" files.
//
// These DLLs are
Expand Down Expand Up @@ -799,12 +817,37 @@ type internal FxResolver
RequireFxResolverLock(fxtok, "assuming all member require lock")
tryGetSdkDir () |> replayWarnings)

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

let runningTfm = tryGetRunningTfm
// Interactive processes read their own configuration to find the running tfm
let targetTfm =
if isInteractive then
tryGetRunningTfm ()
else
let sdkDir = tryGetSdkDir () |> replayWarnings

match sdkDir with
| Some dir -> tryGetTfmFromSdkDir dir
| None -> tryGetRunningTfm ()

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

runningTfm, runningRid)
targetTfm, runningRid)

static member ClearStaticCaches() =
desiredDotNetSdkVersionForDirectoryCache.Clear()
Expand All @@ -878,7 +921,7 @@ type internal FxResolver
let defaultReferences =
if assumeDotNetFramework then
getDotNetFrameworkDefaultReferences useFsiAuxLib, assumeDotNetFramework
else if useSdkRefs then
elif useSdkRefs then
// Go fetch references
let sdkDir = tryGetSdkRefsPackDirectory () |> replayWarnings

Expand Down
Loading

0 comments on commit f1ec7d7

Please sign in to comment.