Skip to content

Commit

Permalink
Merge pull request #17369 from dotnet/merges/main-to-release/dev17.11
Browse files Browse the repository at this point in the history
  • Loading branch information
vzarytovskii authored Jul 1, 2024
2 parents 924abef + 888760c commit 02adf13
Show file tree
Hide file tree
Showing 11 changed files with 342 additions and 163 deletions.
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.3",
"image": "mcr.microsoft.com/dotnet/sdk:9.0.100-preview.5",
"features": {
"ghcr.io/devcontainers/features/common-utils:2.4.2": {},
"ghcr.io/devcontainers/features/common-utils:2.4.3": {},
"ghcr.io/devcontainers/features/git:1.2.0": {},
"ghcr.io/devcontainers/features/github-cli:1.0.11": {},
"ghcr.io/devcontainers/features/dotnet:2.0.5": {}
"ghcr.io/devcontainers/features/dotnet:2.1.0": {}
},
"hostRequirements": {
"cpus": 2,
Expand Down
74 changes: 31 additions & 43 deletions eng/Build.ps1

Large diffs are not rendered by default.

15 changes: 6 additions & 9 deletions eng/SourceBuildPrebuiltBaseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,23 @@
<UsageData>
<IgnorePatterns>
<!-- Ignoring the known prebuilts. -->

<!--
These will go away when repo updates targeting to net8.0
Tracked with https://github.com/dotnet/fsharp/issues/14765
-->
<UsagePattern IdentityGlob="Microsoft.AspNetCore.App.Ref/8.0.2" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Host.linux-x64/8.0.2" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Ref/8.0.2" />
<UsagePattern IdentityGlob="Microsoft.AspNetCore.App.Ref/8.0.*" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Host.linux-x64/8.0.*" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Ref/8.0.*" />
<UsagePattern IdentityGlob="System.Configuration.ConfigurationManager/8.0.0" />
<UsagePattern IdentityGlob="System.Diagnostics.EventLog/8.0.0" />
<UsagePattern IdentityGlob="System.Security.Cryptography.ProtectedData/8.0.0" />
<UsagePattern IdentityGlob="System.CodeDom/8.0.0" />
<UsagePattern IdentityGlob="System.Resources.Extensions/8.0.0" />

<UsagePattern IdentityGlob="System.Diagnostics.DiagnosticSource/8.0.0" />

<UsagePattern IdentityGlob="Microsoft.AspNetCore.App.Runtime.linux-x64/8.0.2" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Crossgen2.linux-x64/8.0.2" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Runtime.linux-x64/8.0.2" />

<UsagePattern IdentityGlob="Microsoft.AspNetCore.App.Runtime.linux-x64/8.0.*" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Crossgen2.linux-x64/8.0.*" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Runtime.linux-x64/8.0.*" />

<!-- Tracked in https://github.com/dotnet/source-build/issues/3438 -->
<UsagePattern IdentityGlob="Microsoft.VisualStudio.Setup.Configuration.Interop/3.2.2146" />
Expand Down
36 changes: 18 additions & 18 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ usage()
echo " --testcoreclr Run unit tests on .NET Core (short: --test, -t)"
echo " --testCompilerComponentTests Run FSharp.Compiler.ComponentTests on .NET Core"
echo " --testBenchmarks Build and Run Benchmark suite"
echo " --testScripting Run FSharp.Private.ScriptingTests on .NET Core"
echo ""
echo "Advanced settings:"
echo " --ci Building in CI"
Expand Down Expand Up @@ -60,6 +61,7 @@ publish=false
test_core_clr=false
test_compilercomponent_tests=false
test_benchmarks=false
test_scripting=false
configuration="Debug"
verbosity='minimal'
binary_log=false
Expand Down Expand Up @@ -136,6 +138,9 @@ while [[ $# > 0 ]]; do
--testbenchmarks)
test_benchmarks=true
;;
--testscripting)
test_scripting=true
;;
--ci)
ci=true
;;
Expand Down Expand Up @@ -177,12 +182,11 @@ done
# Import Arcade functions
. "$scriptroot/common/tools.sh"

function TestUsingNUnit() {
function Test() {
BuildCategory="Test"
BuildMessage="Error running tests"
testproject=""
targetframework=""
notestfilter=0
while [[ $# > 0 ]]; do
opt="$(echo "$1" | awk '{print tolower($0)}')"
case "$opt" in
Expand All @@ -194,10 +198,6 @@ function TestUsingNUnit() {
targetframework=$2
shift
;;
--notestfilter)
notestfilter=1
shift
;;
*)
echo "Invalid argument: $1"
exit 1
Expand All @@ -211,15 +211,10 @@ function TestUsingNUnit() {
exit 1
fi

filterArgs=""
if [[ "${RunningAsPullRequest:-}" != "true" && $notestfilter == 0 ]]; then
filterArgs=" --filter TestCategory!=PullRequest"
fi

projectname=$(basename -- "$testproject")
projectname="${projectname%.*}"
testlogpath="$artifacts_dir/TestResults/$configuration/${projectname}_$targetframework.xml"
args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"nunit;LogFilePath=$testlogpath\"$filterArgs --blame --results-directory $artifacts_dir/TestResults/$configuration"
args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"nunit;LogFilePath=$testlogpath\" --blame --results-directory $artifacts_dir/TestResults/$configuration -p:vstestusemsbuildoutput=false"
"$DOTNET_INSTALL_DIR/dotnet" $args || exit $?
}

Expand Down Expand Up @@ -324,16 +319,16 @@ BuildSolution

if [[ "$test_core_clr" == true ]]; then
coreclrtestframework=$tfm
TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj" --targetframework $coreclrtestframework --notestfilter
TestUsingXUnit --testproject "$repo_root/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj" --targetframework $coreclrtestframework --notestfilter
TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj" --targetframework $coreclrtestframework
TestUsingXUnit --testproject "$repo_root/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj" --targetframework $coreclrtestframework
TestUsingNUnit --testproject "$repo_root/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj" --targetframework $coreclrtestframework
Test --testproject "$repo_root/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj" --targetframework $coreclrtestframework
Test --testproject "$repo_root/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj" --targetframework $coreclrtestframework
Test --testproject "$repo_root/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj" --targetframework $coreclrtestframework
Test --testproject "$repo_root/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj" --targetframework $coreclrtestframework
Test --testproject "$repo_root/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj" --targetframework $coreclrtestframework
fi

if [[ "$test_compilercomponent_tests" == true ]]; then
coreclrtestframework=$tfm
TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj" --targetframework $coreclrtestframework --notestfilter
Test --testproject "$repo_root/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj" --targetframework $coreclrtestframework
fi

if [[ "$test_benchmarks" == true ]]; then
Expand All @@ -342,4 +337,9 @@ if [[ "$test_benchmarks" == true ]]; then
popd
fi

if [[ "$test_scripting" == true ]]; then
coreclrtestframework=$tfm
Test --testproject "$repo_root/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj" --targetframework $coreclrtestframework
fi

ExitWithExitCode 0
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.3.24204.13",
"version": "9.0.100-preview.5.24307.3",
"allowPrerelease": true
},
"tools": {
"dotnet": "9.0.100-preview.3.24204.13",
"dotnet": "9.0.100-preview.5.24307.3",
"vs": {
"version": "17.8",
"components": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ TorchSharp.Tensor.LongTensor.From([| 0L .. 100L |]).Device

[<Fact>]
member _.``Use Dependency Manager to restore packages with native dependencies, build and run script that depends on the results``() =
// Skip test on arm64, because there is not an arm64 netive library
if RuntimeInformation.ProcessArchitecture = Architecture.Arm64 then
()
else
let packagemanagerlines = [|
"r", "Microsoft.ML,version=1.4.0-preview"
"r", "Microsoft.ML.AutoML,version=0.16.0-preview"
Expand Down Expand Up @@ -360,6 +364,10 @@ printfn ""%A"" result

[<Fact>]
member _.``Use NativeResolver to resolve native dlls.``() =
// Skip test on arm64, because there is not an arm64 netive library
if RuntimeInformation.ProcessArchitecture = Architecture.Arm64 then
()
else
let packagemanagerlines = [|
"r", "Microsoft.ML,version=1.4.0-preview"
"r", "Microsoft.ML.AutoML,version=0.16.0-preview"
Expand Down Expand Up @@ -442,6 +450,10 @@ printfn ""%A"" result

[<Fact>]
member _.``Use AssemblyResolver to resolve assemblies``() =
// Skip test on arm64, because there is not an arm64 netive library
if RuntimeInformation.ProcessArchitecture = Architecture.Arm64 then
()
else
let packagemanagerlines = [|
"r", "Microsoft.ML,version=1.4.0-preview"
"r", "Microsoft.ML.AutoML,version=0.16.0-preview"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ System.Configuration.ConfigurationManager.AppSettings.Item "Environment" <- "LOC
#if NETSTANDARD
[<Fact>]
member _.``ML - use assembly with native dependencies``() =
// Skip test on arm64, because there is not an arm64 netive library
if RuntimeInformation.ProcessArchitecture = Architecture.Arm64 then
()
else
let code = @"
#r ""nuget:Microsoft.ML,version=1.4.0-preview""
#r ""nuget:Microsoft.ML.AutoML,version=0.16.0-preview""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ let private getSymbolMap (getSymbolProperty: AssemblySymbol -> 'a) (source: stri
|> List.map (fun s -> getCleanedFullName s, getSymbolProperty s)
|> Map.ofList

[<Fact>]
[<FactForDESKTOP>]
let ``implicitly added Module suffix is removed``() =
"""
type MyType = { F: int }
Expand All @@ -76,7 +76,7 @@ module MyType =
"Test.MyType"
"Test.MyType.func123"]

[<Fact>]
[<FactForDESKTOP>]
let ``Module suffix added by an explicitly applied ModuleSuffix attribute is removed``() =
"""
[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
Expand All @@ -87,7 +87,7 @@ module MyType =
"Test.MyType"
"Test.MyType.func123" ]

[<Fact>]
[<FactForDESKTOP>]
let ``Property getters and setters are removed``() =
"""
type MyType() =
Expand All @@ -97,7 +97,7 @@ let ``Property getters and setters are removed``() =
"Test.MyType"
"Test.MyType.MyProperty" ]

[<Fact>]
[<FactForDESKTOP>]
let ``TopRequireQualifiedAccessParent property should be valid``() =
let source = """
module M1 =
Expand Down Expand Up @@ -144,7 +144,7 @@ let ``TopRequireQualifiedAccessParent property should be valid``() =
assertAreEqual (expectedResult, actual)


[<Fact>]
[<FactForDESKTOP>]
let ``Check Unresolved Symbols``() =
let source = """
namespace ``1 2 3``
Expand Down
32 changes: 24 additions & 8 deletions tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule1.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// Various tests for the:
// Microsoft.FSharp.Core.Operators module

// For information on the runtime-dependent behavior differences in this file, see:
// - https://github.com/dotnet/runtime/issues/61885
// - https://github.com/dotnet/runtime/pull/97529

namespace FSharp.Core.UnitTests.Operators

open System
Expand Down Expand Up @@ -278,18 +282,24 @@ type OperatorsModule1() =
// Overflow
let result = Operators.byte Single.MinValue
Assert.AreEqual(0uy, result)

// Overflow
let result = Operators.byte Single.MaxValue
Assert.AreEqual(0uy, result)

if Info.isNetFramework then
Assert.AreEqual(0uy, result)
else
Assert.AreEqual(255uy, result)

// Overflow
let result = Operators.byte Double.MinValue
Assert.AreEqual(0uy, result)

// Overflow
let result = Operators.byte Double.MaxValue
Assert.AreEqual(0uy, result)
if Info.isNetFramework then
Assert.AreEqual(0uy, result)
else
Assert.AreEqual(255uy, result)

// Overflow
let result = Operators.byte (Int64.MaxValue * 8L)
Expand Down Expand Up @@ -343,9 +353,15 @@ type OperatorsModule1() =

// Overflow
Assert.AreEqual('\000', Operators.char Single.MinValue)
Assert.AreEqual('\000', Operators.char Double.MinValue)
Assert.AreEqual('\000', Operators.char Single.MaxValue)
Assert.AreEqual('\000', Operators.char Double.MaxValue)
if Info.isNetFramework then
Assert.AreEqual('\000', Operators.char Single.MaxValue)
else
Assert.AreEqual('\uffff', Operators.char Single.MaxValue)

if Info.isNetFramework then
Assert.AreEqual('\000', Operators.char Double.MaxValue)
else
Assert.AreEqual('\uffff', Operators.char Double.MaxValue)
CheckThrowsOverflowException(fun () -> Operators.char Decimal.MinValue |> ignore)

// string type
Expand Down
Loading

0 comments on commit 02adf13

Please sign in to comment.