Skip to content

Commit

Permalink
Merge pull request #17774 from dotnet/merges/main-to-lsp
Browse files Browse the repository at this point in the history
Merge main to lsp
  • Loading branch information
abonie authored Sep 23, 2024
2 parents 812a30a + 767b5ec commit c1486be
Show file tree
Hide file tree
Showing 112 changed files with 2,830 additions and 1,304 deletions.
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<RepoRoot Condition="'$(RepoRoot)' == ''">$(MSBuildThisFileDirectory)</RepoRoot>
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
<FSharpNetCoreProductDefaultTargetFramework>net9.0</FSharpNetCoreProductDefaultTargetFramework>
<IgnoreMibc Condition="'$(IgnoreMibc)' == ''">$(DotNetBuildFromSource)</IgnoreMibc>
<IgnoreMibc Condition="'$(IgnoreMibc)' == ''">$(DotNetBuildSourceOnly)</IgnoreMibc>
</PropertyGroup>

<!--
Expand Down Expand Up @@ -73,7 +73,7 @@
we should also support $(NetPrevious) for all releases.
This will likely include FCS and FSharp.Core as well as shipped products.
Right now, it only covers products we ship (FSC and FSI), not NuGet packages. -->
<When Condition="'$(DotNetBuildFromSource)' == 'true' AND '$(DotNetBuildFromSourceFlavor)' == 'Product'">
<When Condition="'$(DotNetBuildSourceOnly)' == 'true' AND '$(DotNetBuildOrchestrator)' == 'true'">
<PropertyGroup>
<FSharpNetCoreProductTargetFramework>$(NetCurrent)</FSharpNetCoreProductTargetFramework>
</PropertyGroup>
Expand Down
28 changes: 1 addition & 27 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
When .NET gets built from source, make the SDK aware there are bootstrap packages
for Microsoft.NETCore.App.Runtime.<rid> and Microsoft.NETCore.App.Crossgen2.<rid>.
-->
<ItemGroup Condition="'$(DotNetBuildFromSource)' == 'true'">
<ItemGroup Condition="'$(DotNetBuildSourceOnly)' == 'true'">
<KnownRuntimePack Update="Microsoft.NETCore.App">
<RuntimePackRuntimeIdentifiers
Condition="'%(TargetFramework)' == '$(NetCurrent)'">%(RuntimePackRuntimeIdentifiers);$(NETCoreSdkRuntimeIdentifier)</RuntimePackRuntimeIdentifiers>
Expand All @@ -51,30 +51,4 @@
RemoveProperties="TargetFramework"
StopOnFirstFailure="True" />
</Target>

<!-- BEGIN workaround for https://github.com/dotnet/sdk/issues/43339; remove after updated to VS 17.12, future 17.11 patch or when arcade ships the the same workaround -->
<Target Name="WorkaroundDotnetSdk43339" BeforeTargets="ResolvePackageAssets" Condition=" '$(MSBuildRuntimeType)' == 'Full' and $([MSBuild]::VersionLessThan($(MSBuildVersion), 17.12.0))">
<PrimeSystemTextJson804 />
</Target>
<UsingTask
TaskName="PrimeSystemTextJson804"
TaskFactory="RoslynCodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll" >
<Task>
<Code Type="Fragment" Language="cs">
<![CDATA[
try
{
System.Reflection.Assembly.LoadFrom(@"$(MicrosoftNETBuildTasksDirectoryRoot)\..\..\..\DotnetTools\dotnet-format\BuildHost-net472\System.Text.Json.dll");
}
catch
{
// Best effort: if something moves in the SDK don't break the build.
}
]]>
</Code>
</Task>
</UsingTask>
<!-- END workaround for https://github.com/dotnet/sdk/issues/43339 -->

</Project>
4 changes: 2 additions & 2 deletions FSharpBuild.Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
<EnableXlfLocalization Condition="'$(EnableXlfLocalization)' == '' AND ('$(Configuration)' == 'Proto' OR '$(MonoPackaging)' == 'true')">false</EnableXlfLocalization>
</PropertyGroup>

<!-- source build -->
<PropertyGroup Condition="'$(DotNetBuildFromSource)' == 'true' OR '$(ArcadeBuildFromSource)' == 'true'">
<!-- Do not publish in source-only modes. This switch is present in both inner and outer builds. -->
<PropertyGroup Condition="'$(DotNetBuildSourceOnly)' == 'true'">
<PublishWindowsPdb>false</PublishWindowsPdb>
</PropertyGroup>

Expand Down
2 changes: 0 additions & 2 deletions buildtools/fsyacc/fsyaccdriver.fs
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ let writeSpecToFile (generatorState: GeneratorState) (spec: ParserSpec) (compile
writer.WriteLineInterface "module %s" s;

writer.WriteLine "#nowarn \"64\";; // turn off warnings that type variables used in production annotations are instantiated to concrete type";
writer.WriteLine "#nowarn \"1182\" // the generated code often has unused variable 'parseState'"
writer.WriteLine "#nowarn \"3261\" // the generated code would need to properly annotate nulls, e.g. changing System.Object to `obj|null`";

for s in generatorState.opens do
writer.WriteLine "open %s" s;
Expand Down
10 changes: 8 additions & 2 deletions docs/release-notes/.FSharp.Compiler.Service/9.0.100.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
### Fixed

* Fix a bug in the interaction between ``#line` and `#nowarn` directives ([PR #17649](https://github.com/dotnet/fsharp/pull/17649))
* Fix wrong TailCall warning ([Issue #17604](https://github.com/dotnet/fsharp/issues/17604), [PR #17637](https://github.com/dotnet/fsharp/pull/17637))
* Compiler hangs when compiling inline recursive invocation ([Issue #17376](https://github.com/dotnet/fsharp/issues/17376), [PR #17394](https://github.com/dotnet/fsharp/pull/17394))
* Fix reporting IsFromComputationExpression only for CE builder type constructors and let bindings. ([PR #17375](https://github.com/dotnet/fsharp/pull/17375))
Expand All @@ -16,8 +15,12 @@
* Add missing byte chars notations, enforce limits in decimal notation in byte char & string (Issues [#15867](https://github.com/dotnet/fsharp/issues/15867), [#15868](https://github.com/dotnet/fsharp/issues/15868), [#15869](https://github.com/dotnet/fsharp/issues/15869), [PR #15898](https://github.com/dotnet/fsharp/pull/15898))
* Parentheses analysis: keep extra parentheses around unit & tuples in method definitions. ([PR #17618](https://github.com/dotnet/fsharp/pull/17618))
* Fix IsUnionCaseTester throwing for non-methods/properties [#17301](https://github.com/dotnet/fsharp/pull/17634)
* Fix xmlc doc tooltip display for nullable types [#17741](https://github.com/dotnet/fsharp/pull/17741)
* Consider `open type` used when the type is an enum and any of the enum cases is used unqualified. ([PR #17628](https://github.com/dotnet/fsharp/pull/17628))
* Guard for possible StackOverflowException when typechecking non recursive modules and namespaces ([PR #17654](https://github.com/dotnet/fsharp/pull/17654))
* Nullable - fix for processing System.Nullable types with nesting ([PR #17736](https://github.com/dotnet/fsharp/pull/17736))
* Fixes for the optimization of simple mappings in array and list comprehensions. ([Issue #17708](https://github.com/dotnet/fsharp/issues/17708), [PR #17711](https://github.com/dotnet/fsharp/pull/17711))


### Added

Expand All @@ -33,6 +36,8 @@
* Enable LanguageFeature.EnforceAttributeTargets in F# 9.0. ([Issue #17514](https://github.com/dotnet/fsharp/issues/17558), [PR #17516](https://github.com/dotnet/fsharp/pull/17558))
* Parser: better recovery for unfinished patterns ([PR #17231](https://github.com/dotnet/fsharp/pull/17231), [PR #17232](https://github.com/dotnet/fsharp/pull/17232)))
* Enable consuming generic arguments defined as `allows ref struct` in C# ([Issue #17597](https://github.com/dotnet/fsharp/issues/17597)
* Trivia for SynTypeConstraint.WhereTyparNotSupportsNull. ([Issue #17721](https://github.com/dotnet/fsharp/issues/17721), [PR #17745](https://github.com/dotnet/fsharp/pull/17745))
* Trivia for SynType.WithNull. ([Issue #17720](https://github.com/dotnet/fsharp/issues/17720), [PR #17745](https://github.com/dotnet/fsharp/pull/17745))

### Changed

Expand All @@ -47,7 +52,8 @@
* Better CE error reporting when using `use!` with `and!` ([PR #17671](https://github.com/dotnet/fsharp/pull/17671))
* Better error reporting for let bindings. ([PR #17601](https://github.com/dotnet/fsharp/pull/17601))
* Optimize ILTypeDef interface impls reading from metadata. ([PR #17382](https://github.com/dotnet/fsharp/pull/17382))
* Make ILTypeDef interface impls calculation lazy. ([PR #17392](https://github.com/dotnet/fsharp/pull/17392))
* Better error reporting for active patterns. ([PR #17666](https://github.com/dotnet/fsharp/pull/17666))

* Multiple fsi sessions use separate temporary directories ([PR #17760](https://github.com/dotnet/fsharp/pull/17760))

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


### Added


### Changed

* Make ILTypeDef interface impls calculation lazy. ([PR #17392](https://github.com/dotnet/fsharp/pull/17392))

### Breaking Changes
2 changes: 1 addition & 1 deletion docs/release-notes/About.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: About

# About

The release notes for the [F\# language](./Language.md), [FSharp.Core](./FSharp.Core.md) and [FSharp.Compiler.Service](./FSharp.Compiler.Service.md) are based on the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format.
The release notes for the [F\# language](./Language.html), [FSharp.Core](./FSharp.Core.html) and [FSharp.Compiler.Service](./FSharp.Compiler.Service.html) are based on the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format.
The target audience of these release notes are the respective end-users.

## Writing a changelog entry
Expand Down
6 changes: 5 additions & 1 deletion docs/release-notes/Language.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ Directory.EnumerateFiles(path, "*.md")
| "preview", "preview" -> 0
| "preview", _ -> -1
| _, "preview" -> 1
| _, _ -> compare (int b) (int a))
| _, _ ->
match System.Decimal.TryParse(b), System.Decimal.TryParse(b) with
| (true, a) , ( true, b) -> compare (int b) (int a)
| _ -> failwithf "Cannot compare %s with %s" b a
)
|> Seq.map (fun file ->
let version = Path.GetFileNameWithoutExtension(file)
let version = if version = "preview" then "Preview" else version
Expand Down
4 changes: 3 additions & 1 deletion eng/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ function BuildSolution([string] $solutionName, $nopack) {
# Do not set the property to true explicitly, since that would override value projects might set.
$suppressExtensionDeployment = if (!$deployExtensions) { "/p:DeployExtension=false" } else { "" }

$sourceBuildArgs = if ($sourceBuild) { "/p:DotNetBuildSourceOnly=true /p:DotNetBuildRepo=true" } else { "" }

$BUILDING_USING_DOTNET_ORIG = $env:BUILDING_USING_DOTNET

$env:BUILDING_USING_DOTNET="false"
Expand All @@ -314,10 +316,10 @@ function BuildSolution([string] $solutionName, $nopack) {
/p:QuietRestore=$quietRestore `
/p:QuietRestoreBinaryLog=$binaryLog `
/p:TestTargetFrameworks=$testTargetFrameworks `
/p:DotNetBuildFromSource=$sourceBuild `
/p:CompressAllMetadata=$CompressAllMetadata `
/p:BuildNoRealsig=$buildnorealsig `
/v:$verbosity `
$sourceBuildArgs `
$suppressExtensionDeployment `
@properties

Expand Down
8 changes: 4 additions & 4 deletions eng/SourceBuild.props → eng/DotNetBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
-->
<Target Name="ConfigureInnerBuildArg"
BeforeTargets="GetSourceBuildCommandConfiguration"
Condition="'$(ArcadeBuildFromSource)' == 'true' or '$(DotNetBuildSourceOnly)' == 'true'">
Condition="'$(DotNetBuildSourceOnly)' == 'true'">
<PropertyGroup>
<InnerBuildArgs>$(InnerBuildArgs) /p:Projects="$(InnerSourceBuildRepoRoot)\Microsoft.FSharp.Compiler.sln"</InnerBuildArgs>
</PropertyGroup>
Expand All @@ -26,7 +26,7 @@
<Target Name="BuildBootstrap"
DependsOnTargets="PrepareInnerSourceBuildRepoRoot"
BeforeTargets="RunInnerSourceBuildCommand"
Condition="'$(ArcadeBuildFromSource)' == 'true' or '$(DotNetBuildSourceOnly)' == 'true'">
Condition="'$(DotNetBuildSourceOnly)' == 'true'">

<PropertyGroup>
<SourceBuildBootstrapTfmArg Condition="$(SourceBuildBootstrapTfm) != ''">--tfm $(SourceBuildBootstrapTfm)</SourceBuildBootstrapTfmArg>
Expand All @@ -41,9 +41,9 @@
-bl enables the binlogs for the tools and Proto builds, which make debugging failures here easier
-->
<Exec
Command="./build.sh --bootstrap --skipBuild -bl $(SourceBuildBootstrapTfmArg) /p:SourceBuildUseMonoRuntime=$(SourceBuildUseMonoRuntime)"
Command="./build.sh --bootstrap --skipBuild -bl $(SourceBuildBootstrapTfmArg) /p:SourceBuildUseMonoRuntime=$(SourceBuildUseMonoRuntime) /p:DotNetBuildSourceOnly=true /p:DotNetBuildInnerRepo=true /p:DotNetBuildRepo=true /p:DotNetBuildOrchestrator=$(DotNetBuildOrchestrator)"
WorkingDirectory="$(InnerSourceBuildRepoRoot)"
EnvironmentVariables="@(InnerBuildEnv);DotNetBuildFromSource=true" />
EnvironmentVariables="@(InnerBuildEnv)" />
</Target>

</Project>
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.24459.6">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.24462.3">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>65260b148c869ada772a5843863c54737cd2361e</Sha>
<Sha>91b9734abbad751d575c002b30778c88d978993c</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.24459.6">
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.24462.3">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>65260b148c869ada772a5843863c54737cd2361e</Sha>
<Sha>91b9734abbad751d575c002b30778c88d978993c</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
<Dependency Name="optimization.windows_nt-x64.MIBC.Runtime" Version="1.0.0-prerelease.23614.4">
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<!-- F# Version components -->
<FSMajorVersion>9</FSMajorVersion>
<FSMinorVersion>0</FSMinorVersion>
<FSBuildVersion>100</FSBuildVersion>
<FSBuildVersion>200</FSBuildVersion>
<FSRevisionVersion>0</FSRevisionVersion>
<!-- -->
<!-- F# Language version -->
Expand Down
9 changes: 7 additions & 2 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,11 @@ function BuildSolution {
if [[ "$UNAME" == "Darwin" ]]; then
enable_analyzers=false
fi

local source_build_args=""
if [[ "$source_build" == true ]]; then
source_build_args="/p:DotNetBuildRepo=true /p:DotNetBuildSourceOnly=true"
fi

# NuGet often exceeds the limit of open files on Mac and Linux
# https://github.com/NuGet/Home/issues/2163
Expand Down Expand Up @@ -274,7 +279,7 @@ function BuildSolution {
fi

BuildMessage="Error building tools"
local args=" publish $repo_root/proto.proj $blrestore $bltools /p:Configuration=Proto /p:ArcadeBuildFromSource=$source_build $properties"
local args=" publish $repo_root/proto.proj $blrestore $bltools /p:Configuration=Proto $source_build_args $properties"
echo $args
"$DOTNET_INSTALL_DIR/dotnet" $args #$args || exit $?
fi
Expand All @@ -296,8 +301,8 @@ function BuildSolution {
/p:ContinuousIntegrationBuild=$ci \
/p:QuietRestore=$quiet_restore \
/p:QuietRestoreBinaryLog="$binary_log" \
/p:ArcadeBuildFromSource=$source_build \
/p:BuildNoRealsig=$buildnorealsig \
$source_build_args \
$properties
fi
}
Expand Down
25 changes: 25 additions & 0 deletions eng/common/internal/Tools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,31 @@
<AutomaticallyUseReferenceAssemblyPackages>false</AutomaticallyUseReferenceAssemblyPackages>
<BuildWithNetFrameworkHostedCompiler>false</BuildWithNetFrameworkHostedCompiler>
</PropertyGroup>
<!-- BEGIN workaround for https://github.com/dotnet/sdk/issues/43339; remove after updated to VS 17.12, future 17.11 patch or when arcade ships the the same workaround -->
<Target Name="WorkaroundDotnetSdk43339" BeforeTargets="ResolvePackageAssets" Condition=" '$(MSBuildRuntimeType)' == 'Full' and $([MSBuild]::VersionLessThan($(MSBuildVersion), 17.12.0))">
<PrimeSystemTextJson804 />
</Target>
<UsingTask
TaskName="PrimeSystemTextJson804"
TaskFactory="RoslynCodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll" >
<Task>
<Code Type="Fragment" Language="cs">
<![CDATA[
try
{
System.Reflection.Assembly.LoadFrom(@"$(MicrosoftNETBuildTasksDirectoryRoot)\..\..\..\DotnetTools\dotnet-format\BuildHost-net472\System.Text.Json.dll");
}
catch
{
// Best effort: if something moves in the SDK don't break the build.
}
]]>
</Code>
</Task>
</UsingTask>
<!-- END workaround for https://github.com/dotnet/sdk/issues/43339 -->

<ItemGroup>
<!-- Clear references, the SDK may add some depending on UsuingToolXxx settings, but we only want to restore the following -->
<PackageReference Remove="@(PackageReference)"/>
Expand Down
2 changes: 1 addition & 1 deletion eng/test-determinism.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function Run-Build([string]$rootDir, [string]$increment) {
/p:ContinuousIntegrationBuild=false `
/p:OfficialBuildId="" `
/p:QuietRestore=false `
/p:DotNetBuildFromSource=false `
/p:DotNetBuildSourceOnly=false `
/p:Deterministic=true `
/p:DebugDeterminism=true `
/p:Features="debug-determinism" `
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"perl": "5.38.2.2"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24459.6",
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24462.3",
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2"
}
}
6 changes: 4 additions & 2 deletions proto.proj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
<RootDir Condition="'$(RootDir)'==''">Bootstrap</RootDir>
</PropertyGroup>

<!-- Skip on sourcebuild -->
<ItemGroup Condition="'$(ArcadeBuildFromSource)'!='true'">
<!-- This needs to be built only in the inner VMR build proto invocation, but not the outer VMR build invocation.
The project does not import Arcade targets so we only have the properties that were passed in, rather than
calculated properties like DotNetBuildPhase. -->
<ItemGroup Condition="'$(DotNetBuildSourceOnly)'!='true' or '$(DotNetBuildInnerRepo)' == 'true'">
<Projects Include="buildtools\fslex\fslex.fsproj" />
<Projects Include="buildtools\fsyacc\fsyacc.fsproj" />
<Projects Include="buildtools\AssemblyCheck\AssemblyCheck.fsproj" />
Expand Down
2 changes: 1 addition & 1 deletion setup/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<IntermediateOutputPath>$(ArtifactsDir)\VSSetup.obj\$(Configuration)\$(MSBuildProjectName)</IntermediateOutputPath>
<VsixBuildLocation>$(SetupRootFolder)..\artifacts\VSSetup\$(Configuration)</VsixBuildLocation>
<InsertionDir>$(SetupRootFolder)..\artifacts\VSSetup\$(Configuration)\Insertion</InsertionDir>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
<ExcludeFromSourceOnlyBuild>true</ExcludeFromSourceOnlyBuild>
<SetupProductArch>Neutral</SetupProductArch>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion setup/Swix/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<Target Name="Build"
DependsOnTargets="ResolveProjectReferences"
Condition="'$(DotNetBuildFromSource)' != 'true' AND '$(ArcadeBuildFromSource)' != 'true'">
Condition="'$(DotNetBuildSourceOnly)' != 'true'">
<MakeDir Directories="$(IntermediateOutputPath)" ContinueOnError="True"/>
</Target>

Expand Down
Loading

0 comments on commit c1486be

Please sign in to comment.