Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to .NET 9 rc1 #17698

Merged
merged 9 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
{
"name": "F#",
"image": "mcr.microsoft.com/dotnet/sdk:9.0.100-preview.7",
"image": "mcr.microsoft.com/dotnet/sdk:9.0.100-rc.1",
"features": {
"ghcr.io/devcontainers/features/common-utils:2.4.6": {},
"ghcr.io/devcontainers/features/common-utils:2.5.1": {},
"ghcr.io/devcontainers/features/git:1.3.2": {},
"ghcr.io/devcontainers/features/github-cli:1.0.13": {},
"ghcr.io/devcontainers/features/dotnet:2.1.2": {}
"ghcr.io/devcontainers/features/dotnet:2.1.3": {}
},
"hostRequirements": {
"cpus": 2,
Expand Down
6 changes: 5 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@

<PropertyGroup Condition="'$(BUILDING_USING_DOTNET)' == 'true'">
<DisableAutoSetFscCompilerPath>false</DisableAutoSetFscCompilerPath>
<FSHARPCORE_USE_PACKAGE Condition="'$(FSHARPCORE_USE_PACKAGE)' == ''">true</FSHARPCORE_USE_PACKAGE>

<!-- TODO(vlza): This probably should be `true` once fslib with nullness ships, since shipped library is preferred by default when building this solution. -->
<FSHARPCORE_USE_PACKAGE Condition="'$(FSHARPCORE_USE_PACKAGE)' == ''">false</FSHARPCORE_USE_PACKAGE>

Comment on lines +50 to +52
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That'd be a "workaround" to unblock plain builds, but it will by default use the project.

<DISABLE_ARCADE Condition="'$(DISABLE_ARCADE)' == ''">true</DISABLE_ARCADE>
<ArtifactsDir>$(MSBuildThisFileDirectory)artifacts/</ArtifactsDir>
<OutputPath>$(ArtifactsDir)/bin/$(MSBuildProjectName)/$(Configuration)/</OutputPath>
Expand All @@ -57,6 +60,7 @@
<FsYaccPath>$(ArtifactsDir)/bin/fsyacc/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/$(RuntimeIdentifier)/fsyacc.dll</FsYaccPath>
<DefineConstants>NO_CHECKNULLS;BUILDING_WITH_LKG;NO_NULLCHECKING_LIB_SUPPORT;$(DefineConstants)</DefineConstants>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)/eng/Versions.props" Condition="'$(DISABLE_ARCADE)' == 'true'" />

<Import Project="FSharpBuild.Directory.Build.props" Condition=" '$(FSharpTestCompilerVersion)' == '' " />
Expand Down
25 changes: 25 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,29 @@
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: 4 additions & 0 deletions FSharp.Profiles.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
<OtherFlags>$(OtherFlags) /langversion:preview</OtherFlags>
</PropertyGroup>

<PropertyGroup Condition="'$(BUILDING_USING_DOTNET)' == 'true'">
<CheckNulls>false</CheckNulls>
</PropertyGroup>

Comment on lines +25 to +28
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turning it off currently for the plain builds, so we don't get mismatches with defines we have.

<PropertyGroup Condition="'$(CheckNulls)' == 'true'">
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion eng/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ param (
[switch]$sourceBuild,
[switch]$skipBuild,
[switch]$compressAllMetadata,
[switch]$buildnorealsig,
[switch]$buildnorealsig = $true,
vzarytovskii marked this conversation as resolved.
Show resolved Hide resolved
[switch]$verifypackageshipstatus = $false,
[parameter(ValueFromRemainingArguments = $true)][string[]]$properties)

Expand Down
2 changes: 1 addition & 1 deletion eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ skip_analyzers=false
skip_build=false
prepare_machine=false
source_build=false
buildnorealsig=false
buildnorealsig=true
properties=""

docker=false
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"sdk": {
"version": "9.0.100-preview.7.24407.12",
"version": "9.0.100-rc.1.24452.12",
"allowPrerelease": true
},
"tools": {
"dotnet": "9.0.100-preview.7.24407.12",
"dotnet": "9.0.100-rc.1.24452.12",
"vs": {
"version": "17.8",
"components": [
Expand Down
6 changes: 3 additions & 3 deletions tests/FSharp.Compiler.ComponentTests/Interop/ByrefTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ open System.Collections.Generic
let myDict = ["x",1;"xyz",2] |> dict |> Dictionary
let checkIfPresent (input:ReadOnlySpan<char>) =
let altLookup = myDict.GetAlternateLookup<string,int,ReadOnlySpan<char>>()
let altLookup = myDict.GetAlternateLookup<ReadOnlySpan<char>>()
let present = altLookup.ContainsKey(input)
for c in input do
printf "%c" c
Expand All @@ -134,7 +134,7 @@ let main _args =
|> shouldSucceed
|> verifyOutputContains [|": false";"x: true";"xyz: true"|]
|> verifyIL
["call valuetype [System.Collections]System.Collections.Generic.Dictionary`2/AlternateLookup`1<!!0,!!1,!!2> [System.Collections]System.Collections.Generic.CollectionExtensions::GetAlternateLookup<string,int32,valuetype [runtime]System.ReadOnlySpan`1<char>>(class [System.Collections]System.Collections.Generic.Dictionary`2<!!0,!!1>)"]
["callvirt instance valuetype [System.Collections]System.Collections.Generic.Dictionary`2/AlternateLookup`1<!0,!1,!!0> class [System.Collections]System.Collections.Generic.Dictionary`2<string,int32>::GetAlternateLookup<valuetype [runtime]System.ReadOnlySpan`1<char>>()"]
T-Gro marked this conversation as resolved.
Show resolved Hide resolved

[<FactForNETCOREAPP>]
let ``Ref structs in generics - GetAlternateLookup`` () =
Expand All @@ -144,7 +144,7 @@ open System.Collections.Generic
let main _args =
let myDict = ["x",1;"y",2] |> dict |> Dictionary
let altLookup = myDict.GetAlternateLookup<string,int,ReadOnlySpan<char>>()
let altLookup = myDict.GetAlternateLookup<ReadOnlySpan<char>>()
altLookup.ContainsKey(ReadOnlySpan([|'x'|]))
"""
|> withLangVersionPreview
Expand Down
Loading