From 13c820c61a85669f14e634eb17dee5f28535abac Mon Sep 17 00:00:00 2001 From: nojaf Date: Wed, 4 Jan 2023 10:52:51 +0100 Subject: [PATCH 1/2] Upgrade to .NET 6 --- .config/dotnet-tools.json | 6 +- .github/workflows/main.yml | 11 +- build.fsx | 38 +- build.fsx.lock | 385 +++++++++--------- global.json | 2 +- nuget/FsLexYacc.template | 4 +- paket.dependencies | 2 +- paket.lock | 66 ++- src/Common/Arg.fs | 14 +- src/FsLex/fslex.fsproj | 3 +- src/FsLexYacc.Build.Tasks/FsLexYacc.targets | 4 +- src/FsLexYacc.Runtime/Parsing.fs | 4 +- src/FsYacc/fsyacc.fsproj | 2 +- .../FsLex.Core.Tests/FsLex.Core.Tests.fsproj | 2 +- .../FsYacc.Core.Tests.fsproj | 2 +- .../JsonLexAndYaccExample.fsproj | 6 +- .../LexAndYaccMiniProject.fsproj | 6 +- tests/fsyacc/OldFsYaccTests.fsx | 52 ++- tests/fsyacc/Test1/test1.fsproj | 2 +- tests/fsyacc/Test2/test2.fsproj | 2 +- tests/fsyacc/oldfsyacctests.fsx.lock | 201 +++------ tests/fsyacc/unicode/test1-unicode.fsproj | 2 +- 22 files changed, 359 insertions(+), 457 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 41570bfc..49634a46 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,19 +3,19 @@ "isRoot": true, "tools": { "fake-cli": { - "version": "5.20.4", + "version": "6.0.0-beta001", "commands": [ "fake" ] }, "paket": { - "version": "6.0.0-rc006", + "version": "7.2.0", "commands": [ "paket" ] }, "dotnet-serve": { - "version": "1.7.120", + "version": "1.10.149", "commands": [ "dotnet-serve" ] diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6c419241..3ff3f8e1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,19 +15,12 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macOS-latest] - dotnet: [5.0.404] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: Setup .NET for main project build - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ matrix.dotnet }} - - name: Setup .NET for build tools - uses: actions/setup-dotnet@v1 - with: - dotnet-version: '3.1.x' + uses: actions/setup-dotnet@v3 - name: Install local tools run: dotnet tool restore - name: Paket restore diff --git a/build.fsx b/build.fsx index c13fcd89..55c2e64e 100644 --- a/build.fsx +++ b/build.fsx @@ -1,13 +1,14 @@ #r @"paket: -nuget FSharp.Core 4.7.2 +frameworks: net6.0 + +nuget FSharp.Core ~> 6 nuget Fake.Core.Target nuget Fake.Core.ReleaseNotes nuget Fake.IO.FileSystem -nuget Fake.DotNet.Cli nuget Fake.DotNet.AssemblyInfoFile nuget Fake.DotNet.Paket nuget Fake.Tools.Git -nuget MsBuild.StructuredLogger >= 2.1.507 //" +nuget MsBuild.StructuredLogger //" #if !FAKE #load "./.fake/build.fsx/intellisense.fsx" @@ -26,7 +27,6 @@ open Fake open Fake.Core.TargetOperators open Fake.Core open Fake.Tools.Git -open Fake.DotNet open Fake.IO open Fake.IO.FileSystemOperators open Fake.IO.Globbing.Operators @@ -112,7 +112,7 @@ Target.create "CleanDocs" (fun _ -> // Build library & test project Target.create "Build" (fun _ -> - for framework in ["netcoreapp3.1"] do + for framework in ["net6.0"] do [ "src/FsLex.Core/fslexlex.fs" "src/FsLex.Core/fslexpars.fs" @@ -123,12 +123,9 @@ Target.create "Build" (fun _ -> ] |> File.deleteAll for project in ["src/FsLex/fslex.fsproj"; "src/FsYacc/fsyacc.fsproj"] do - DotNet.publish (fun opts -> { - opts with - Common = { opts.Common with CustomParams = Some "/v:n" } - Configuration = DotNet.BuildConfiguration.Release - Framework = Some framework - }) project + CreateProcess.fromRawCommandLine "dotnet" $"publish {project} -c Release /v:n -f {framework}" + |> Proc.run + |> ignore [ "tests/JsonLexAndYaccExample/Lexer.fs" @@ -142,15 +139,15 @@ Target.create "Build" (fun _ -> for project in [ "src/FsLexYacc.Runtime/FsLexYacc.Runtime.fsproj" "tests/JsonLexAndYaccExample/JsonLexAndYaccExample.fsproj" "tests/LexAndYaccMiniProject/LexAndYaccMiniProject.fsproj" ] do - DotNet.build (fun opts -> { - opts with - Common = { opts.Common with CustomParams = Some "/v:n" } - Configuration = DotNet.BuildConfiguration.Release - }) project + CreateProcess.fromRawCommandLine "dotnet" $"build {project} -c Release /v:n" + |> Proc.run + |> ignore ) Target.create "RunTests" (fun _ -> - DotNet.test id "." + CreateProcess.fromRawCommandLine "dotnet" "test ." + |> Proc.run + |> ignore ) // -------------------------------------------------------------------------------------- @@ -158,8 +155,11 @@ Target.create "RunTests" (fun _ -> Target.create "RunOldFsYaccTests" (fun _ -> let script = Path.Combine(__SOURCE_DIRECTORY__, "tests", "fsyacc", "OldFsYaccTests.fsx") - let result = DotNet.exec id "fake" ("run " + script) - if not result.OK then + let result = + CreateProcess.fromRawCommandLine "dotnet" $"fake run {script}" + |> Proc.run + + if result.ExitCode <> 0 then failwith "Old FsLexYacc tests were failed" ) diff --git a/build.fsx.lock b/build.fsx.lock index 33de40f5..b0484786 100644 --- a/build.fsx.lock +++ b/build.fsx.lock @@ -1,225 +1,204 @@ STORAGE: NONE -RESTRICTION: == netstandard2.0 +RESTRICTION: == net6.0 NUGET remote: https://api.nuget.org/v3/index.json BlackFox.VsWhere (1.1) FSharp.Core (>= 4.2.3) Microsoft.Win32.Registry (>= 4.7) - Fake.Core.CommandLineParsing (5.20.4) + Fake.Core.CommandLineParsing (5.23.1) FParsec (>= 1.1.1) - FSharp.Core (>= 4.7.2) - Fake.Core.Context (5.20.4) - FSharp.Core (>= 4.7.2) - Fake.Core.Environment (5.20.4) - FSharp.Core (>= 4.7.2) - Fake.Core.FakeVar (5.20.4) - Fake.Core.Context (>= 5.20.4) - FSharp.Core (>= 4.7.2) - Fake.Core.Process (5.20.4) - Fake.Core.Environment (>= 5.20.4) - Fake.Core.FakeVar (>= 5.20.4) - Fake.Core.String (>= 5.20.4) - Fake.Core.Trace (>= 5.20.4) - Fake.IO.FileSystem (>= 5.20.4) - FSharp.Core (>= 4.7.2) - System.Collections.Immutable (>= 1.7.1) - Fake.Core.ReleaseNotes (5.20.4) - Fake.Core.SemVer (>= 5.20.4) - Fake.Core.String (>= 5.20.4) - FSharp.Core (>= 4.7.2) - Fake.Core.SemVer (5.20.4) - FSharp.Core (>= 4.7.2) - Fake.Core.String (5.20.4) - FSharp.Core (>= 4.7.2) - Fake.Core.Target (5.20.4) - Fake.Core.CommandLineParsing (>= 5.20.4) - Fake.Core.Context (>= 5.20.4) - Fake.Core.Environment (>= 5.20.4) - Fake.Core.FakeVar (>= 5.20.4) - Fake.Core.Process (>= 5.20.4) - Fake.Core.String (>= 5.20.4) - Fake.Core.Trace (>= 5.20.4) - FSharp.Control.Reactive (>= 4.4.2) - FSharp.Core (>= 4.7.2) - Fake.Core.Tasks (5.20.4) - Fake.Core.Trace (>= 5.20.4) - FSharp.Core (>= 4.7.2) - Fake.Core.Trace (5.20.4) - Fake.Core.Environment (>= 5.20.4) - Fake.Core.FakeVar (>= 5.20.4) - FSharp.Core (>= 4.7.2) - Fake.Core.Xml (5.20.4) - Fake.Core.String (>= 5.20.4) - FSharp.Core (>= 4.7.2) - Fake.DotNet.AssemblyInfoFile (5.20.4) - Fake.Core.Environment (>= 5.20.4) - Fake.Core.String (>= 5.20.4) - Fake.Core.Trace (>= 5.20.4) - Fake.IO.FileSystem (>= 5.20.4) - FSharp.Core (>= 4.7.2) - Fake.DotNet.Cli (5.20.4) - Fake.Core.Environment (>= 5.20.4) - Fake.Core.Process (>= 5.20.4) - Fake.Core.String (>= 5.20.4) - Fake.Core.Trace (>= 5.20.4) - Fake.DotNet.MSBuild (>= 5.20.4) - Fake.DotNet.NuGet (>= 5.20.4) - Fake.IO.FileSystem (>= 5.20.4) - FSharp.Core (>= 4.7.2) + FSharp.Core (>= 6.0) + Fake.Core.Context (5.23.1) + FSharp.Core (>= 6.0) + Fake.Core.Environment (5.23.1) + FSharp.Core (>= 6.0) + Fake.Core.FakeVar (5.23.1) + Fake.Core.Context (>= 5.23.1) + FSharp.Core (>= 6.0) + Fake.Core.Process (5.23.1) + Fake.Core.Environment (>= 5.23.1) + Fake.Core.FakeVar (>= 5.23.1) + Fake.Core.String (>= 5.23.1) + Fake.Core.Trace (>= 5.23.1) + Fake.IO.FileSystem (>= 5.23.1) + FSharp.Core (>= 6.0) + System.Collections.Immutable (>= 5.0) + Fake.Core.ReleaseNotes (5.23.1) + Fake.Core.SemVer (>= 5.23.1) + Fake.Core.String (>= 5.23.1) + FSharp.Core (>= 6.0) + Fake.Core.SemVer (5.23.1) + FSharp.Core (>= 6.0) + Fake.Core.String (5.23.1) + FSharp.Core (>= 6.0) + Fake.Core.Target (5.23.1) + Fake.Core.CommandLineParsing (>= 5.23.1) + Fake.Core.Context (>= 5.23.1) + Fake.Core.Environment (>= 5.23.1) + Fake.Core.FakeVar (>= 5.23.1) + Fake.Core.Process (>= 5.23.1) + Fake.Core.String (>= 5.23.1) + Fake.Core.Trace (>= 5.23.1) + FSharp.Control.Reactive (>= 5.0.2) + FSharp.Core (>= 6.0) + Fake.Core.Tasks (5.23.1) + Fake.Core.Trace (>= 5.23.1) + FSharp.Core (>= 6.0) + Fake.Core.Trace (5.23.1) + Fake.Core.Environment (>= 5.23.1) + Fake.Core.FakeVar (>= 5.23.1) + FSharp.Core (>= 6.0) + Fake.Core.Xml (5.23.1) + Fake.Core.String (>= 5.23.1) + FSharp.Core (>= 6.0) + Fake.DotNet.AssemblyInfoFile (5.23.1) + Fake.Core.Environment (>= 5.23.1) + Fake.Core.String (>= 5.23.1) + Fake.Core.Trace (>= 5.23.1) + Fake.IO.FileSystem (>= 5.23.1) + FSharp.Core (>= 6.0) + Fake.DotNet.Cli (5.23.1) + Fake.Core.Environment (>= 5.23.1) + Fake.Core.Process (>= 5.23.1) + Fake.Core.String (>= 5.23.1) + Fake.Core.Trace (>= 5.23.1) + Fake.DotNet.MSBuild (>= 5.23.1) + Fake.DotNet.NuGet (>= 5.23.1) + Fake.IO.FileSystem (>= 5.23.1) + FSharp.Core (>= 6.0) Mono.Posix.NETStandard (>= 1.0) - Newtonsoft.Json (>= 12.0.3) - Fake.DotNet.MSBuild (5.20.4) + Newtonsoft.Json (>= 13.0.1) + Fake.DotNet.MSBuild (5.23.1) BlackFox.VsWhere (>= 1.1) - Fake.Core.Environment (>= 5.20.4) - Fake.Core.Process (>= 5.20.4) - Fake.Core.String (>= 5.20.4) - Fake.Core.Trace (>= 5.20.4) - Fake.IO.FileSystem (>= 5.20.4) - FSharp.Core (>= 4.7.2) - MSBuild.StructuredLogger (>= 2.1.176) - Fake.DotNet.NuGet (5.20.4) - Fake.Core.Environment (>= 5.20.4) - Fake.Core.Process (>= 5.20.4) - Fake.Core.SemVer (>= 5.20.4) - Fake.Core.String (>= 5.20.4) - Fake.Core.Tasks (>= 5.20.4) - Fake.Core.Trace (>= 5.20.4) - Fake.Core.Xml (>= 5.20.4) - Fake.IO.FileSystem (>= 5.20.4) - Fake.Net.Http (>= 5.20.4) - FSharp.Core (>= 4.7.2) - Newtonsoft.Json (>= 12.0.3) - NuGet.Protocol (>= 5.6) - Fake.DotNet.Paket (5.20.4) - Fake.Core.Process (>= 5.20.4) - Fake.Core.String (>= 5.20.4) - Fake.Core.Trace (>= 5.20.4) - Fake.DotNet.Cli (>= 5.20.4) - Fake.IO.FileSystem (>= 5.20.4) - FSharp.Core (>= 4.7.2) - Fake.IO.FileSystem (5.20.4) - Fake.Core.String (>= 5.20.4) - FSharp.Core (>= 4.7.2) - Fake.Net.Http (5.20.4) - Fake.Core.Trace (>= 5.20.4) - FSharp.Core (>= 4.7.2) - Fake.Tools.Git (5.20.4) - Fake.Core.Environment (>= 5.20.4) - Fake.Core.Process (>= 5.20.4) - Fake.Core.SemVer (>= 5.20.4) - Fake.Core.String (>= 5.20.4) - Fake.Core.Trace (>= 5.20.4) - Fake.IO.FileSystem (>= 5.20.4) - FSharp.Core (>= 4.7.2) + Fake.Core.Environment (>= 5.23.1) + Fake.Core.Process (>= 5.23.1) + Fake.Core.String (>= 5.23.1) + Fake.Core.Trace (>= 5.23.1) + Fake.IO.FileSystem (>= 5.23.1) + FSharp.Core (>= 6.0) + MSBuild.StructuredLogger (>= 2.1.545) + Fake.DotNet.NuGet (5.23.1) + Fake.Core.Environment (>= 5.23.1) + Fake.Core.Process (>= 5.23.1) + Fake.Core.SemVer (>= 5.23.1) + Fake.Core.String (>= 5.23.1) + Fake.Core.Tasks (>= 5.23.1) + Fake.Core.Trace (>= 5.23.1) + Fake.Core.Xml (>= 5.23.1) + Fake.IO.FileSystem (>= 5.23.1) + Fake.Net.Http (>= 5.23.1) + FSharp.Core (>= 6.0) + Newtonsoft.Json (>= 13.0.1) + NuGet.Protocol (>= 5.11) + Fake.DotNet.Paket (5.23.1) + Fake.Core.Process (>= 5.23.1) + Fake.Core.String (>= 5.23.1) + Fake.Core.Trace (>= 5.23.1) + Fake.DotNet.Cli (>= 5.23.1) + Fake.IO.FileSystem (>= 5.23.1) + FSharp.Core (>= 6.0) + Fake.IO.FileSystem (5.23.1) + Fake.Core.String (>= 5.23.1) + FSharp.Core (>= 6.0) + Fake.Net.Http (5.23.1) + Fake.Core.Trace (>= 5.23.1) + FSharp.Core (>= 6.0) + Fake.Tools.Git (5.23.1) + Fake.Core.Environment (>= 5.23.1) + Fake.Core.Process (>= 5.23.1) + Fake.Core.SemVer (>= 5.23.1) + Fake.Core.String (>= 5.23.1) + Fake.Core.Trace (>= 5.23.1) + Fake.IO.FileSystem (>= 5.23.1) + FSharp.Core (>= 6.0) FParsec (1.1.1) FSharp.Core (>= 4.3.4) - FSharp.Control.Reactive (5.0.2) - FSharp.Core (>= 4.7.2) - System.Reactive (>= 5.0) - FSharp.Core (4.7.2) - Microsoft.Build (16.10) - Microsoft.Build.Framework (16.10) - System.Security.Permissions (>= 4.7) - Microsoft.Build.Tasks.Core (16.10) - Microsoft.Build.Framework (>= 16.10) - Microsoft.Build.Utilities.Core (>= 16.10) - Microsoft.NET.StringTools (>= 1.0) - Microsoft.Win32.Registry (>= 4.3) - System.CodeDom (>= 4.4) - System.Collections.Immutable (>= 5.0) - System.Reflection.Metadata (>= 1.6) - System.Resources.Extensions (>= 4.6) - System.Security.Cryptography.Pkcs (>= 4.7) - System.Security.Cryptography.Xml (>= 4.7) - System.Security.Permissions (>= 4.7) - System.Threading.Tasks.Dataflow (>= 4.9) - Microsoft.Build.Utilities.Core (16.10) - Microsoft.Build.Framework (>= 16.10) - Microsoft.NET.StringTools (>= 1.0) - Microsoft.Win32.Registry (>= 4.3) - System.Collections.Immutable (>= 5.0) - System.Configuration.ConfigurationManager (>= 4.7) - System.Security.Permissions (>= 4.7) - System.Text.Encoding.CodePages (>= 4.0.1) - Microsoft.NET.StringTools (1.0) - System.Memory (>= 4.5.4) - System.Runtime.CompilerServices.Unsafe (>= 5.0) - Microsoft.NETCore.Platforms (5.0.2) - Microsoft.NETCore.Targets (5.0) + FSharp.Control.Reactive (5.0.5) + FSharp.Core (>= 4.7.2) + System.Reactive (>= 5.0 < 6.0) + FSharp.Core (6.0.7) + Microsoft.Build (17.4) + Microsoft.Build.Framework (17.4) + Microsoft.Win32.Registry (>= 5.0) + System.Security.Permissions (>= 6.0) + Microsoft.Build.Tasks.Core (17.4) + Microsoft.Build.Framework (>= 17.4) + Microsoft.Build.Utilities.Core (>= 17.4) + Microsoft.NET.StringTools (>= 17.4) + Microsoft.Win32.Registry (>= 5.0) + System.CodeDom (>= 6.0) + System.Collections.Immutable (>= 6.0) + System.Reflection.Metadata (>= 6.0) + System.Resources.Extensions (>= 6.0) + System.Security.Cryptography.Pkcs (>= 6.0.1) + System.Security.Cryptography.Xml (>= 6.0) + System.Security.Permissions (>= 6.0) + System.Threading.Tasks.Dataflow (>= 6.0) + Microsoft.Build.Utilities.Core (17.4) + Microsoft.Build.Framework (>= 17.4) + Microsoft.NET.StringTools (>= 17.4) + Microsoft.Win32.Registry (>= 5.0) + System.Collections.Immutable (>= 6.0) + System.Configuration.ConfigurationManager (>= 6.0) + System.Security.Permissions (>= 6.0) + System.Text.Encoding.CodePages (>= 6.0) + Microsoft.NET.StringTools (17.4) + System.Memory (>= 4.5.5) + System.Runtime.CompilerServices.Unsafe (>= 6.0) Microsoft.Win32.Registry (5.0) - System.Buffers (>= 4.5.1) - System.Memory (>= 4.5.4) System.Security.AccessControl (>= 5.0) System.Security.Principal.Windows (>= 5.0) + Microsoft.Win32.SystemEvents (7.0) Mono.Posix.NETStandard (1.0) - MSBuild.StructuredLogger (2.1.507) - Microsoft.Build (>= 16.4) - Microsoft.Build.Framework (>= 16.4) - Microsoft.Build.Tasks.Core (>= 16.4) - Microsoft.Build.Utilities.Core (>= 16.4) - Newtonsoft.Json (13.0.1) - NuGet.Common (5.10) - NuGet.Frameworks (>= 5.10) - NuGet.Configuration (5.10) - NuGet.Common (>= 5.10) + MSBuild.StructuredLogger (2.1.758) + Microsoft.Build (>= 16.10) + Microsoft.Build.Framework (>= 16.10) + Microsoft.Build.Tasks.Core (>= 16.10) + Microsoft.Build.Utilities.Core (>= 16.10) + Newtonsoft.Json (13.0.2) + NuGet.Common (6.4) + NuGet.Frameworks (>= 6.4) + NuGet.Configuration (6.4) + NuGet.Common (>= 6.4) System.Security.Cryptography.ProtectedData (>= 4.4) - NuGet.Frameworks (5.10) - NuGet.Packaging (5.10) - Newtonsoft.Json (>= 9.0.1) - NuGet.Configuration (>= 5.10) - NuGet.Versioning (>= 5.10) + NuGet.Frameworks (6.4) + NuGet.Packaging (6.4) + Newtonsoft.Json (>= 13.0.1) + NuGet.Configuration (>= 6.4) + NuGet.Versioning (>= 6.4) System.Security.Cryptography.Cng (>= 5.0) System.Security.Cryptography.Pkcs (>= 5.0) - NuGet.Protocol (5.10) - NuGet.Packaging (>= 5.10) - NuGet.Versioning (5.10) - System.Buffers (4.5.1) - System.CodeDom (5.0) - System.Collections.Immutable (5.0) - System.Memory (>= 4.5.4) - System.Configuration.ConfigurationManager (5.0) - System.Security.Cryptography.ProtectedData (>= 5.0) - System.Security.Permissions (>= 5.0) - System.Formats.Asn1 (5.0) - System.Buffers (>= 4.5.1) - System.Memory (>= 4.5.4) - System.Memory (4.5.4) - System.Buffers (>= 4.5.1) - System.Numerics.Vectors (>= 4.4) - System.Runtime.CompilerServices.Unsafe (>= 4.5.3) - System.Numerics.Vectors (4.5) + NuGet.Protocol (6.4) + NuGet.Packaging (>= 6.4) + NuGet.Versioning (6.4) + System.CodeDom (7.0) + System.Collections.Immutable (7.0) + System.Runtime.CompilerServices.Unsafe (>= 6.0) + System.Configuration.ConfigurationManager (7.0) + System.Security.Cryptography.ProtectedData (>= 7.0) + System.Security.Permissions (>= 7.0) + System.Drawing.Common (7.0) + Microsoft.Win32.SystemEvents (>= 7.0) + System.Formats.Asn1 (7.0) + System.Memory (4.5.5) System.Reactive (5.0) - System.Runtime.InteropServices.WindowsRuntime (>= 4.3) - System.Threading.Tasks.Extensions (>= 4.5.4) - System.Reflection.Metadata (5.0) - System.Collections.Immutable (>= 5.0) - System.Resources.Extensions (5.0) - System.Memory (>= 4.5.4) - System.Runtime (4.3.1) - Microsoft.NETCore.Platforms (>= 1.1.1) - Microsoft.NETCore.Targets (>= 1.1.3) - System.Runtime.CompilerServices.Unsafe (5.0) - System.Runtime.InteropServices.WindowsRuntime (4.3) - System.Runtime (>= 4.3) - System.Security.AccessControl (5.0) - System.Security.Principal.Windows (>= 5.0) + System.Reflection.Metadata (7.0) + System.Collections.Immutable (>= 7.0) + System.Resources.Extensions (7.0) + System.Runtime.CompilerServices.Unsafe (6.0) + System.Security.AccessControl (6.0) System.Security.Cryptography.Cng (5.0) - System.Security.Cryptography.Pkcs (5.0.1) - System.Buffers (>= 4.5.1) System.Formats.Asn1 (>= 5.0) - System.Memory (>= 4.5.4) - System.Security.Cryptography.Cng (>= 5.0) - System.Security.Cryptography.ProtectedData (5.0) - System.Memory (>= 4.5.4) - System.Security.Cryptography.Xml (5.0) - System.Memory (>= 4.5.4) - System.Security.Cryptography.Pkcs (>= 5.0) - System.Security.Permissions (>= 5.0) - System.Security.Permissions (5.0) - System.Security.AccessControl (>= 5.0) + System.Security.Cryptography.Pkcs (7.0) + System.Formats.Asn1 (>= 7.0) + System.Security.Cryptography.ProtectedData (7.0) + System.Security.Cryptography.Xml (7.0) + System.Security.Cryptography.Pkcs (>= 7.0) + System.Security.Permissions (7.0) + System.Windows.Extensions (>= 7.0) System.Security.Principal.Windows (5.0) - System.Text.Encoding.CodePages (5.0) - System.Runtime.CompilerServices.Unsafe (>= 5.0) - System.Threading.Tasks.Dataflow (5.0) - System.Threading.Tasks.Extensions (4.5.4) - System.Runtime.CompilerServices.Unsafe (>= 4.5.3) + System.Text.Encoding.CodePages (7.0) + System.Runtime.CompilerServices.Unsafe (>= 6.0) + System.Threading.Tasks.Dataflow (7.0) + System.Windows.Extensions (7.0) + System.Drawing.Common (>= 7.0) diff --git a/global.json b/global.json index 1af97e38..a79a2eaf 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "5.0.404", + "version": "6.0.400", "rollForward": "minor" } } diff --git a/nuget/FsLexYacc.template b/nuget/FsLexYacc.template index 310b6d69..bfaad798 100644 --- a/nuget/FsLexYacc.template +++ b/nuget/FsLexYacc.template @@ -12,8 +12,8 @@ iconurl https://raw.githubusercontent.com/fsprojects/FsLexYacc/master/docs/files tags F#, fsharp, yacc, fsyacc, lex, parsing, lexing, fslex files - ../src/FsLex/bin/Release/netcoreapp3.1/publish ==> build/fslex/netcoreapp3.1 - ../src/FsYacc/bin/Release/netcoreapp3.1/publish ==> build/fsyacc/netcoreapp3.1 + ../src/FsLex/bin/Release/net6.0/publish ==> build/fslex/net6.0 + ../src/FsYacc/bin/Release/net6.0/publish ==> build/fsyacc/net6.0 ../src/FsLexYacc.Build.Tasks/FsLexYacc.targets ==> build ../src/FsLexYacc.Runtime/Lexing.fsi ==> src/fslex ../src/FsLexYacc.Runtime/Lexing.fs ==> src/fslex diff --git a/paket.dependencies b/paket.dependencies index 7b835d45..fd90f4bb 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -1,7 +1,7 @@ source https://api.nuget.org/v3/index.json storage: none -frameworks: netstandard2.0, netcoreapp3.1 +frameworks: netstandard2.0, net6.0 nuget FSharp.Core ~> 4.6.0 nuget FsLexYacc copy_local: true diff --git a/paket.lock b/paket.lock index bce72746..fbcd3824 100644 --- a/paket.lock +++ b/paket.lock @@ -1,14 +1,14 @@ STORAGE: NONE -RESTRICTION: || (== netcoreapp3.1) (== netstandard2.0) +RESTRICTION: || (== net6.0) (== netstandard2.0) NUGET remote: https://api.nuget.org/v3/index.json - Expecto (9.0.2) + Expecto (9.0.4) FSharp.Core (>= 4.6) - Mono.Cecil (>= 0.11.2) - Expecto.FsCheck (9.0.2) - Expecto (>= 9.0.2) - FsCheck (>= 2.14.2) - FsCheck (2.16.4) + Mono.Cecil (>= 0.11.3) + Expecto.FsCheck (9.0.4) + Expecto (>= 9.0.4) + FsCheck (>= 2.14.3) + FsCheck (2.16.5) FSharp.Core (>= 4.2.3) FSharp.Core (4.6.2) FsLexYacc (10.2) - copy_local: true @@ -16,32 +16,30 @@ NUGET FsLexYacc.Runtime (>= 10.2 < 10.3) FsLexYacc.Runtime (10.2) - copy_local: true FSharp.Core (>= 4.5.2) - Microsoft.Build.Tasks.Git (1.0) - copy_local: true - Microsoft.CodeCoverage (17.0) - restriction: || (== netcoreapp3.1) (&& (== netstandard2.0) (>= net45)) (&& (== netstandard2.0) (>= netcoreapp1.0)) - Microsoft.NET.Test.Sdk (17.0) - Microsoft.CodeCoverage (>= 17.0) - restriction: || (== netcoreapp3.1) (&& (== netstandard2.0) (>= net45)) (&& (== netstandard2.0) (>= netcoreapp1.0)) - Microsoft.TestPlatform.TestHost (>= 17.0) - restriction: || (== netcoreapp3.1) (&& (== netstandard2.0) (>= netcoreapp1.0)) - Microsoft.SourceLink.Common (1.0) - copy_local: true - Microsoft.SourceLink.GitHub (1.0) - copy_local: true - Microsoft.Build.Tasks.Git (>= 1.0) - Microsoft.SourceLink.Common (>= 1.0) - Microsoft.TestPlatform.ObjectModel (17.0) - restriction: || (== netcoreapp3.1) (&& (== netstandard2.0) (>= netcoreapp1.0)) - NuGet.Frameworks (>= 5.0) + Microsoft.Build.Tasks.Git (1.1.1) - copy_local: true + Microsoft.CodeCoverage (17.4.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1)) + Microsoft.NET.Test.Sdk (17.4.1) + Microsoft.CodeCoverage (>= 17.4.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1)) + Microsoft.TestPlatform.TestHost (>= 17.4.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) + Microsoft.SourceLink.Common (1.1.1) - copy_local: true + Microsoft.SourceLink.GitHub (1.1.1) - copy_local: true + Microsoft.Build.Tasks.Git (>= 1.1.1) + Microsoft.SourceLink.Common (>= 1.1.1) + Microsoft.TestPlatform.ObjectModel (17.4.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) + NuGet.Frameworks (>= 5.11) System.Reflection.Metadata (>= 1.6) - Microsoft.TestPlatform.TestHost (17.0) - restriction: || (== netcoreapp3.1) (&& (== netstandard2.0) (>= netcoreapp1.0)) - Microsoft.TestPlatform.ObjectModel (>= 17.0) - restriction: || (== netcoreapp3.1) (&& (== netstandard2.0) (>= netcoreapp1.0)) (&& (== netstandard2.0) (>= uap10.0)) - Newtonsoft.Json (>= 9.0.1) - restriction: || (== netcoreapp3.1) (&& (== netstandard2.0) (>= netcoreapp1.0)) (&& (== netstandard2.0) (>= uap10.0)) - Mono.Cecil (0.11.3) - Newtonsoft.Json (13.0.1) - restriction: || (== netcoreapp3.1) (&& (== netstandard2.0) (>= netcoreapp1.0)) - NuGet.Frameworks (6.0) - restriction: || (== netcoreapp3.1) (&& (== netstandard2.0) (>= netcoreapp1.0)) (&& (== netstandard2.0) (>= netcoreapp2.1)) - System.Collections.Immutable (6.0) - restriction: || (== netcoreapp3.1) (&& (== netstandard2.0) (>= netcoreapp1.0)) (&& (== netstandard2.0) (>= netcoreapp2.1)) - System.Memory (>= 4.5.4) + Microsoft.TestPlatform.TestHost (17.4.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) + Microsoft.TestPlatform.ObjectModel (>= 17.4.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) + Newtonsoft.Json (>= 13.0.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) + Mono.Cecil (0.11.4) + Newtonsoft.Json (13.0.2) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) + NuGet.Frameworks (6.4) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) + System.Collections.Immutable (7.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) System.Runtime.CompilerServices.Unsafe (>= 6.0) - System.Memory (4.5.4) - restriction: || (== netcoreapp3.1) (&& (== netstandard2.0) (>= netcoreapp2.1)) - System.Reflection.Metadata (6.0) - restriction: || (== netcoreapp3.1) (&& (== netstandard2.0) (>= netcoreapp1.0)) (&& (== netstandard2.0) (>= netcoreapp2.1)) - System.Collections.Immutable (>= 6.0) - System.Runtime.CompilerServices.Unsafe (6.0) - restriction: || (== netcoreapp3.1) (&& (== netstandard2.0) (>= netcoreapp2.1)) - YoloDev.Expecto.TestSdk (0.12.13) - Expecto (>= 9.0 < 10.0) - restriction: || (== netcoreapp3.1) (&& (== netstandard2.0) (>= netcoreapp2.1)) - FSharp.Core (>= 4.6) - restriction: || (== netcoreapp3.1) (&& (== netstandard2.0) (>= netcoreapp2.1)) - System.Collections.Immutable (>= 1.5) - restriction: || (== netcoreapp3.1) (&& (== netstandard2.0) (>= netcoreapp2.1)) + System.Reflection.Metadata (7.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) + System.Collections.Immutable (>= 7.0) + System.Runtime.CompilerServices.Unsafe (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.0) (>= netcoreapp3.1)) + YoloDev.Expecto.TestSdk (0.13.3) + Expecto (>= 9.0 < 10.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) + FSharp.Core (>= 4.6.2) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) + System.Collections.Immutable (>= 6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) diff --git a/src/Common/Arg.fs b/src/Common/Arg.fs index 7d2e03ab..d6f8ed79 100644 --- a/src/Common/Arg.fs +++ b/src/Common/Arg.fs @@ -47,12 +47,12 @@ type ArgParser() = sbuf.ToString() - static member ParsePartial(cursor,argv,argSpecs:seq,?other,?usageText) = - let other = defaultArg other (fun _ -> ()) + static member ParsePartial(cursor,argv,arguments:seq,?otherArgs,?usageText) = + let other = defaultArg otherArgs (fun _ -> ()) let usageText = defaultArg usageText "" let nargs = Array.length argv incr cursor; - let argSpecs = argSpecs |> Seq.toList + let argSpecs = arguments |> Seq.toList let specs = argSpecs |> List.map (fun (arg:ArgInfo) -> arg.Name, arg.ArgType) while !cursor < nargs do let arg = argv.[!cursor] @@ -107,16 +107,16 @@ type ArgParser() = incr cursor findMatchingArg specs - static member Usage (specs,?usage) = + static member Usage (arguments, ?usage) = let usage = defaultArg usage "" - System.Console.Error.WriteLine (getUsage (Seq.toList specs) usage) + System.Console.Error.WriteLine (getUsage (Seq.toList arguments) usage) #if FX_NO_COMMAND_LINE_ARGS #else - static member Parse (specs,?other,?usageText) = + static member Parse (arguments, ?otherArgs,?usageText) = let current = ref 0 let argv = System.Environment.GetCommandLineArgs() - try ArgParser.ParsePartial (current, argv, specs, ?other=other, ?usageText=usageText) + try ArgParser.ParsePartial (current, argv, arguments, ?otherArgs=otherArgs, ?usageText=usageText) with | Bad h | HelpText h -> diff --git a/src/FsLex/fslex.fsproj b/src/FsLex/fslex.fsproj index 087dbf3a..5a51a329 100644 --- a/src/FsLex/fslex.fsproj +++ b/src/FsLex/fslex.fsproj @@ -2,9 +2,10 @@ Exe - netcoreapp3.1 + net6.0 Major false + true diff --git a/src/FsLexYacc.Build.Tasks/FsLexYacc.targets b/src/FsLexYacc.Build.Tasks/FsLexYacc.targets index 7d874a86..120a6326 100644 --- a/src/FsLexYacc.Build.Tasks/FsLexYacc.targets +++ b/src/FsLexYacc.Build.Tasks/FsLexYacc.targets @@ -15,9 +15,9 @@ Copyright (C) Microsoft Corporation. All rights reserved. CallFsLex;CallFsYacc;$(CompileDependsOn) - $(MSBuildThisFileDirectory)/fslex/netcoreapp3.1 + $(MSBuildThisFileDirectory)/fslex/net6.0 fslex.dll - $(MSBuildThisFileDirectory)/fsyacc/netcoreapp3.1 + $(MSBuildThisFileDirectory)/fsyacc/net6.0 fsyacc.dll dotnet diff --git a/src/FsLexYacc.Runtime/Parsing.fs b/src/FsLexYacc.Runtime/Parsing.fs index 6c6e8f20..f66aa7a7 100644 --- a/src/FsLexYacc.Runtime/Parsing.fs +++ b/src/FsLexYacc.Runtime/Parsing.fs @@ -494,8 +494,8 @@ module Implementation = valueStack.Peep().value type Tables<'tok> with - member tables.Interpret (lexer,lexbuf,initialState) = - Implementation.interpret tables lexer lexbuf initialState + member tables.Interpret (lexer,lexbuf,startState) = + Implementation.interpret tables lexer lexbuf startState module ParseHelpers = let parse_error (_s:string) = () diff --git a/src/FsYacc/fsyacc.fsproj b/src/FsYacc/fsyacc.fsproj index 22c6a3eb..f10313cd 100644 --- a/src/FsYacc/fsyacc.fsproj +++ b/src/FsYacc/fsyacc.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 Major false diff --git a/tests/FsLex.Core.Tests/FsLex.Core.Tests.fsproj b/tests/FsLex.Core.Tests/FsLex.Core.Tests.fsproj index 0a929c5f..669bed04 100644 --- a/tests/FsLex.Core.Tests/FsLex.Core.Tests.fsproj +++ b/tests/FsLex.Core.Tests/FsLex.Core.Tests.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 false diff --git a/tests/FsYacc.Core.Tests/FsYacc.Core.Tests.fsproj b/tests/FsYacc.Core.Tests/FsYacc.Core.Tests.fsproj index 1d21ffc8..73d221b2 100644 --- a/tests/FsYacc.Core.Tests/FsYacc.Core.Tests.fsproj +++ b/tests/FsYacc.Core.Tests/FsYacc.Core.Tests.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 false diff --git a/tests/JsonLexAndYaccExample/JsonLexAndYaccExample.fsproj b/tests/JsonLexAndYaccExample/JsonLexAndYaccExample.fsproj index 3b4bd217..356a643e 100644 --- a/tests/JsonLexAndYaccExample/JsonLexAndYaccExample.fsproj +++ b/tests/JsonLexAndYaccExample/JsonLexAndYaccExample.fsproj @@ -2,9 +2,9 @@ Exe - netcoreapp3.1 - ..\..\src\FsLex\bin\$(Configuration)\netcoreapp3.1 - ..\..\src\FsYacc\bin\$(Configuration)\netcoreapp3.1 + net6.0 + ..\..\src\FsLex\bin\$(Configuration)\net6.0 + ..\..\src\FsYacc\bin\$(Configuration)\net6.0 diff --git a/tests/LexAndYaccMiniProject/LexAndYaccMiniProject.fsproj b/tests/LexAndYaccMiniProject/LexAndYaccMiniProject.fsproj index 2e6c06cb..90bb7d93 100644 --- a/tests/LexAndYaccMiniProject/LexAndYaccMiniProject.fsproj +++ b/tests/LexAndYaccMiniProject/LexAndYaccMiniProject.fsproj @@ -2,9 +2,9 @@ Exe - netcoreapp3.1 - ..\..\src\FsLex\bin\$(Configuration)\netcoreapp3.1 - ..\..\src\FsYacc\bin\$(Configuration)\netcoreapp3.1 + net6.0 + ..\..\src\FsLex\bin\$(Configuration)\net6.0 + ..\..\src\FsYacc\bin\$(Configuration)\net6.0 diff --git a/tests/fsyacc/OldFsYaccTests.fsx b/tests/fsyacc/OldFsYaccTests.fsx index bb740484..70eea3ac 100644 --- a/tests/fsyacc/OldFsYaccTests.fsx +++ b/tests/fsyacc/OldFsYaccTests.fsx @@ -1,9 +1,10 @@ #r @"paket: +frameworks: net6.0 + nuget FSharp.Core ~> 5.0 nuget Fake.IO.FileSystem nuget Fake.DotNet.Fsc -nuget Fake.Core.Trace -nuget Fake.DotNet.Cli //" +nuget Fake.Core.Trace //" #if !FAKE #load "./.fake/oldfsyacctests.fsx/intellisense.fsx" @@ -14,7 +15,6 @@ open System open System.Runtime.InteropServices open System.IO -open Fake.DotNet open Fake.IO open Fake.Core @@ -26,29 +26,39 @@ let assertFileExists file = let run project args = Trace.traceImportant <| sprintf "Running '%s' with args %s" project args - - project - |> DotNet.build (fun opts -> - { opts with - Configuration = DotNet.BuildConfiguration.Release }) - - let res = DotNet.exec (fun opts -> { opts with RedirectOutput = true }) "run" ("-p " + project + " " + args) - - if not res.OK then + + CreateProcess.fromRawCommandLine "dotnet" $"build {project} -c Release" + |> Proc.run + |> ignore + + // project + // |> DotNet.build (fun opts -> + // { opts with + // Configuration = DotNet.BuildConfiguration.Release }) + + let res = + CreateProcess.fromRawCommandLine "dotnet" $"run --project {project} {args}" + |> Proc.run + // DotNet.exec (fun opts -> { opts with RedirectOutput = true }) "run" ("-p " + project + " " + args) + + if res.ExitCode <> 0 then failwithf "Process failed with code %d" res.ExitCode let test proj shouldBeOK (args, baseLineOutput) = Trace.traceImportant <| sprintf "Running '%s' with args '%s'" proj args - let res = DotNet.exec (fun opts -> { opts with RedirectOutput = true }) "run" ("-p " + proj + " " + args) + let res = + CreateProcess.fromRawCommandLine "dotnet" $"run --project {proj} {args}" + |> CreateProcess.redirectOutput + |> Proc.run + //DotNet.exec (fun opts -> { opts with RedirectOutput = true }) "run" ("-p " + proj + " " + args) - if res.OK <> shouldBeOK then + if (res.ExitCode = 0) <> shouldBeOK then failwithf "Process failed with code %d on input %s" res.ExitCode args let output = - res.Results - |> Array.ofList - |> Array.map (fun cm -> cm.Message) + // For some reason, the output is captured in the stderr + res.Result.Error.Split('\n', StringSplitOptions.RemoveEmptyEntries) |> Array.map (fun line -> if line.StartsWith("parsed") then let pieces = line.Split(' ') @@ -122,10 +132,11 @@ let test1Input4TokensBsl = Path.Combine(__SOURCE_DIRECTORY__, "Test1", "test1.in let runTests' shouldBeOK projFile xs = - projFile - |> DotNet.build (fun opts -> { opts with Configuration = DotNet.BuildConfiguration.Release }) + CreateProcess.fromRawCommandLine "dotnet" $"build {projFile} -c Release" + |> Proc.run + |> ignore - xs |> List.iter (test ("-p " + projFile) shouldBeOK) + xs |> List.iter (test projFile shouldBeOK) let runTests projFile xs = runTests' true projFile xs fsLex ("-o " + test1lexFs + " " + test1lexFsl) @@ -133,6 +144,7 @@ fsYacc ("--module TestParser -o " + test1Fs + " " + test1Fsy) runTests test1Proj [ sprintf "--tokens %s" test1Input1, test1Input1TokensBsl test1Input1, test1Input1Bsl + test1Input1, test1Input1Bsl sprintf "%s %s" test1Input2Variation1 test1Input2Variation2, test1Input2Bsl sprintf "--tokens %s" test1Input3, test1Input3TokensBsl test1Input3, test1Input3Bsl diff --git a/tests/fsyacc/Test1/test1.fsproj b/tests/fsyacc/Test1/test1.fsproj index 658dfae1..678fbd2b 100644 --- a/tests/fsyacc/Test1/test1.fsproj +++ b/tests/fsyacc/Test1/test1.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 FS0760 diff --git a/tests/fsyacc/Test2/test2.fsproj b/tests/fsyacc/Test2/test2.fsproj index 59016620..c37087ca 100644 --- a/tests/fsyacc/Test2/test2.fsproj +++ b/tests/fsyacc/Test2/test2.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 FS0760 diff --git a/tests/fsyacc/oldfsyacctests.fsx.lock b/tests/fsyacc/oldfsyacctests.fsx.lock index 9fad4ee5..c3c22b89 100644 --- a/tests/fsyacc/oldfsyacctests.fsx.lock +++ b/tests/fsyacc/oldfsyacctests.fsx.lock @@ -1,10 +1,7 @@ STORAGE: NONE -RESTRICTION: == netstandard2.0 +RESTRICTION: == net6.0 NUGET remote: https://api.nuget.org/v3/index.json - BlackFox.VsWhere (1.1) - FSharp.Core (>= 4.2.3) - Microsoft.Win32.Registry (>= 4.7) Fake.Core.Context (5.20.4) FSharp.Core (>= 4.7.2) Fake.Core.Environment (5.20.4) @@ -20,65 +17,21 @@ NUGET Fake.IO.FileSystem (>= 5.20.4) FSharp.Core (>= 4.7.2) System.Collections.Immutable (>= 1.7.1) - Fake.Core.SemVer (5.20.4) - FSharp.Core (>= 4.7.2) Fake.Core.String (5.20.4) FSharp.Core (>= 4.7.2) - Fake.Core.Tasks (5.20.4) - Fake.Core.Trace (>= 5.20.4) - FSharp.Core (>= 4.7.2) Fake.Core.Trace (5.20.4) Fake.Core.Environment (>= 5.20.4) Fake.Core.FakeVar (>= 5.20.4) FSharp.Core (>= 4.7.2) - Fake.Core.Xml (5.20.4) - Fake.Core.String (>= 5.20.4) - FSharp.Core (>= 4.7.2) - Fake.DotNet.Cli (5.20.4) - Fake.Core.Environment (>= 5.20.4) - Fake.Core.Process (>= 5.20.4) - Fake.Core.String (>= 5.20.4) - Fake.Core.Trace (>= 5.20.4) - Fake.DotNet.MSBuild (>= 5.20.4) - Fake.DotNet.NuGet (>= 5.20.4) - Fake.IO.FileSystem (>= 5.20.4) - FSharp.Core (>= 4.7.2) - Mono.Posix.NETStandard (>= 1.0) - Newtonsoft.Json (>= 12.0.3) Fake.DotNet.Fsc (5.20.4) Fake.Core.Process (>= 5.20.4) Fake.Core.Trace (>= 5.20.4) Fake.IO.FileSystem (>= 5.20.4) FSharp.Compiler.Service (>= 37.0) FSharp.Core (>= 4.7.2) - Fake.DotNet.MSBuild (5.20.4) - BlackFox.VsWhere (>= 1.1) - Fake.Core.Environment (>= 5.20.4) - Fake.Core.Process (>= 5.20.4) - Fake.Core.String (>= 5.20.4) - Fake.Core.Trace (>= 5.20.4) - Fake.IO.FileSystem (>= 5.20.4) - FSharp.Core (>= 4.7.2) - MSBuild.StructuredLogger (>= 2.1.176) - Fake.DotNet.NuGet (5.20.4) - Fake.Core.Environment (>= 5.20.4) - Fake.Core.Process (>= 5.20.4) - Fake.Core.SemVer (>= 5.20.4) - Fake.Core.String (>= 5.20.4) - Fake.Core.Tasks (>= 5.20.4) - Fake.Core.Trace (>= 5.20.4) - Fake.Core.Xml (>= 5.20.4) - Fake.IO.FileSystem (>= 5.20.4) - Fake.Net.Http (>= 5.20.4) - FSharp.Core (>= 4.7.2) - Newtonsoft.Json (>= 12.0.3) - NuGet.Protocol (>= 5.6) Fake.IO.FileSystem (5.20.4) Fake.Core.String (>= 5.20.4) FSharp.Core (>= 4.7.2) - Fake.Net.Http (5.20.4) - Fake.Core.Trace (>= 5.20.4) - FSharp.Core (>= 4.7.2) FSharp.Compiler.Service (40.0) FSharp.Core (5.0.2) Microsoft.Build.Framework (>= 16.9) @@ -106,66 +59,43 @@ NUGET System.Threading.Thread (>= 4.3) System.Threading.ThreadPool (>= 4.3) FSharp.Core (5.0.2) - Microsoft.Build (16.10) - Microsoft.Build.Framework (16.10) - System.Security.Permissions (>= 4.7) - Microsoft.Build.Tasks.Core (16.10) - Microsoft.Build.Framework (>= 16.10) - Microsoft.Build.Utilities.Core (>= 16.10) - Microsoft.NET.StringTools (>= 1.0) - Microsoft.Win32.Registry (>= 4.3) - System.CodeDom (>= 4.4) - System.Collections.Immutable (>= 5.0) - System.Reflection.Metadata (>= 1.6) - System.Resources.Extensions (>= 4.6) - System.Security.Cryptography.Pkcs (>= 4.7) - System.Security.Cryptography.Xml (>= 4.7) - System.Security.Permissions (>= 4.7) - System.Threading.Tasks.Dataflow (>= 4.9) - Microsoft.Build.Utilities.Core (16.10) - Microsoft.Build.Framework (>= 16.10) - Microsoft.NET.StringTools (>= 1.0) - Microsoft.Win32.Registry (>= 4.3) - System.Collections.Immutable (>= 5.0) - System.Configuration.ConfigurationManager (>= 4.7) - System.Security.Permissions (>= 4.7) - System.Text.Encoding.CodePages (>= 4.0.1) - Microsoft.NET.StringTools (1.0) - System.Memory (>= 4.5.4) - System.Runtime.CompilerServices.Unsafe (>= 5.0) - Microsoft.NETCore.Platforms (5.0.2) + Microsoft.Build.Framework (17.4) + Microsoft.Win32.Registry (>= 5.0) + System.Security.Permissions (>= 6.0) + Microsoft.Build.Tasks.Core (17.4) + Microsoft.Build.Framework (>= 17.4) + Microsoft.Build.Utilities.Core (>= 17.4) + Microsoft.NET.StringTools (>= 17.4) + Microsoft.Win32.Registry (>= 5.0) + System.CodeDom (>= 6.0) + System.Collections.Immutable (>= 6.0) + System.Reflection.Metadata (>= 6.0) + System.Resources.Extensions (>= 6.0) + System.Security.Cryptography.Pkcs (>= 6.0.1) + System.Security.Cryptography.Xml (>= 6.0) + System.Security.Permissions (>= 6.0) + System.Threading.Tasks.Dataflow (>= 6.0) + Microsoft.Build.Utilities.Core (17.4) + Microsoft.Build.Framework (>= 17.4) + Microsoft.NET.StringTools (>= 17.4) + Microsoft.Win32.Registry (>= 5.0) + System.Collections.Immutable (>= 6.0) + System.Configuration.ConfigurationManager (>= 6.0) + System.Security.Permissions (>= 6.0) + System.Text.Encoding.CodePages (>= 6.0) + Microsoft.NET.StringTools (17.4) + System.Memory (>= 4.5.5) + System.Runtime.CompilerServices.Unsafe (>= 6.0) + Microsoft.NETCore.Platforms (7.0) Microsoft.NETCore.Targets (5.0) Microsoft.Win32.Primitives (4.3) Microsoft.NETCore.Platforms (>= 1.1) Microsoft.NETCore.Targets (>= 1.1) System.Runtime (>= 4.3) Microsoft.Win32.Registry (5.0) - System.Buffers (>= 4.5.1) - System.Memory (>= 4.5.4) System.Security.AccessControl (>= 5.0) System.Security.Principal.Windows (>= 5.0) - Mono.Posix.NETStandard (1.0) - MSBuild.StructuredLogger (2.1.507) - Microsoft.Build (>= 16.4) - Microsoft.Build.Framework (>= 16.4) - Microsoft.Build.Tasks.Core (>= 16.4) - Microsoft.Build.Utilities.Core (>= 16.4) - Newtonsoft.Json (13.0.1) - NuGet.Common (5.10) - NuGet.Frameworks (>= 5.10) - NuGet.Configuration (5.10) - NuGet.Common (>= 5.10) - System.Security.Cryptography.ProtectedData (>= 4.4) - NuGet.Frameworks (5.10) - NuGet.Packaging (5.10) - Newtonsoft.Json (>= 9.0.1) - NuGet.Configuration (>= 5.10) - NuGet.Versioning (>= 5.10) - System.Security.Cryptography.Cng (>= 5.0) - System.Security.Cryptography.Pkcs (>= 5.0) - NuGet.Protocol (5.10) - NuGet.Packaging (>= 5.10) - NuGet.Versioning (5.10) + Microsoft.Win32.SystemEvents (7.0) runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) runtime.debian.9-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) @@ -210,7 +140,7 @@ NUGET runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) runtime.ubuntu.18.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) System.Buffers (4.5.1) - System.CodeDom (5.0) + System.CodeDom (7.0) System.Collections (4.3) Microsoft.NETCore.Platforms (>= 1.1) Microsoft.NETCore.Targets (>= 1.1) @@ -226,18 +156,17 @@ NUGET System.Runtime.Extensions (>= 4.3) System.Threading (>= 4.3) System.Threading.Tasks (>= 4.3) - System.Collections.Immutable (5.0) - System.Memory (>= 4.5.4) - System.Configuration.ConfigurationManager (5.0) - System.Security.Cryptography.ProtectedData (>= 5.0) - System.Security.Permissions (>= 5.0) + System.Collections.Immutable (7.0) + System.Runtime.CompilerServices.Unsafe (>= 6.0) + System.Configuration.ConfigurationManager (7.0) + System.Security.Cryptography.ProtectedData (>= 7.0) + System.Security.Permissions (>= 7.0) System.Diagnostics.Debug (4.3) Microsoft.NETCore.Platforms (>= 1.1) Microsoft.NETCore.Targets (>= 1.1) System.Runtime (>= 4.3) - System.Diagnostics.DiagnosticSource (5.0.1) - System.Memory (>= 4.5.4) - System.Runtime.CompilerServices.Unsafe (>= 5.0) + System.Diagnostics.DiagnosticSource (7.0) + System.Runtime.CompilerServices.Unsafe (>= 6.0) System.Diagnostics.Process (4.3) Microsoft.NETCore.Platforms (>= 1.1) Microsoft.Win32.Primitives (>= 4.3) @@ -274,9 +203,9 @@ NUGET Microsoft.NETCore.Platforms (>= 1.1) Microsoft.NETCore.Targets (>= 1.1) System.Runtime (>= 4.3) - System.Formats.Asn1 (5.0) - System.Buffers (>= 4.5.1) - System.Memory (>= 4.5.4) + System.Drawing.Common (7.0) + Microsoft.Win32.SystemEvents (>= 7.0) + System.Formats.Asn1 (7.0) System.Globalization (4.3) Microsoft.NETCore.Platforms (>= 1.1) Microsoft.NETCore.Targets (>= 1.1) @@ -343,10 +272,7 @@ NUGET System.Reflection.Extensions (>= 4.3) System.Resources.ResourceManager (>= 4.3) System.Runtime (>= 4.3) - System.Memory (4.5.4) - System.Buffers (>= 4.5.1) - System.Numerics.Vectors (>= 4.4) - System.Runtime.CompilerServices.Unsafe (>= 4.5.3) + System.Memory (4.5.5) System.Net.Http (4.3.4) Microsoft.NETCore.Platforms (>= 1.1.1) runtime.native.System (>= 4.3) @@ -427,7 +353,6 @@ NUGET System.Resources.ResourceManager (>= 4.3) System.Runtime (>= 4.3) System.Runtime.Extensions (>= 4.3) - System.Numerics.Vectors (4.5) System.ObjectModel (4.3) System.Collections (>= 4.3) System.Diagnostics.Debug (>= 4.3) @@ -441,24 +366,21 @@ NUGET System.Reflection.Primitives (>= 4.3) System.Runtime (>= 4.3) System.Reflection.Emit (4.7) - System.Reflection.Emit.ILGeneration (>= 4.7) System.Reflection.Emit.ILGeneration (4.7) System.Reflection.Emit.Lightweight (4.7) - System.Reflection.Emit.ILGeneration (>= 4.7) System.Reflection.Extensions (4.3) Microsoft.NETCore.Platforms (>= 1.1) Microsoft.NETCore.Targets (>= 1.1) System.Reflection (>= 4.3) System.Runtime (>= 4.3) - System.Reflection.Metadata (5.0) - System.Collections.Immutable (>= 5.0) + System.Reflection.Metadata (7.0) + System.Collections.Immutable (>= 7.0) System.Reflection.Primitives (4.3) Microsoft.NETCore.Platforms (>= 1.1) Microsoft.NETCore.Targets (>= 1.1) System.Runtime (>= 4.3) System.Reflection.TypeExtensions (4.7) - System.Resources.Extensions (5.0) - System.Memory (>= 4.5.4) + System.Resources.Extensions (7.0) System.Resources.ResourceManager (4.3) Microsoft.NETCore.Platforms (>= 1.1) Microsoft.NETCore.Targets (>= 1.1) @@ -468,7 +390,7 @@ NUGET System.Runtime (4.3.1) Microsoft.NETCore.Platforms (>= 1.1.1) Microsoft.NETCore.Targets (>= 1.1.3) - System.Runtime.CompilerServices.Unsafe (5.0) + System.Runtime.CompilerServices.Unsafe (6.0) System.Runtime.Extensions (4.3.1) Microsoft.NETCore.Platforms (>= 1.1.1) Microsoft.NETCore.Targets (>= 1.1.3) @@ -493,8 +415,7 @@ NUGET System.Resources.ResourceManager (>= 4.3) System.Runtime (>= 4.3) System.Runtime.Extensions (>= 4.3) - System.Security.AccessControl (5.0) - System.Security.Principal.Windows (>= 5.0) + System.Security.AccessControl (6.0) System.Security.Claims (4.3) System.Collections (>= 4.3) System.Globalization (>= 4.3) @@ -519,6 +440,7 @@ NUGET System.Security.Cryptography.Primitives (>= 4.3) System.Text.Encoding (>= 4.3) System.Security.Cryptography.Cng (5.0) + System.Formats.Asn1 (>= 5.0) System.Security.Cryptography.Csp (4.3) Microsoft.NETCore.Platforms (>= 1.1) System.IO (>= 4.3) @@ -547,11 +469,9 @@ NUGET System.Security.Cryptography.Primitives (>= 4.3) System.Text.Encoding (>= 4.3) System.Security.Cryptography.OpenSsl (5.0) - System.Security.Cryptography.Pkcs (5.0.1) - System.Buffers (>= 4.5.1) System.Formats.Asn1 (>= 5.0) - System.Memory (>= 4.5.4) - System.Security.Cryptography.Cng (>= 5.0) + System.Security.Cryptography.Pkcs (7.0) + System.Formats.Asn1 (>= 7.0) System.Security.Cryptography.Primitives (4.3) System.Diagnostics.Debug (>= 4.3) System.Globalization (>= 4.3) @@ -560,8 +480,7 @@ NUGET System.Runtime (>= 4.3) System.Threading (>= 4.3) System.Threading.Tasks (>= 4.3) - System.Security.Cryptography.ProtectedData (5.0) - System.Memory (>= 4.5.4) + System.Security.Cryptography.ProtectedData (7.0) System.Security.Cryptography.X509Certificates (4.3.2) Microsoft.NETCore.Platforms (>= 1.1) runtime.native.System (>= 4.3) @@ -588,12 +507,10 @@ NUGET System.Security.Cryptography.Primitives (>= 4.3) System.Text.Encoding (>= 4.3) System.Threading (>= 4.3) - System.Security.Cryptography.Xml (5.0) - System.Memory (>= 4.5.4) - System.Security.Cryptography.Pkcs (>= 5.0) - System.Security.Permissions (>= 5.0) - System.Security.Permissions (5.0) - System.Security.AccessControl (>= 5.0) + System.Security.Cryptography.Xml (7.0) + System.Security.Cryptography.Pkcs (>= 7.0) + System.Security.Permissions (7.0) + System.Windows.Extensions (>= 7.0) System.Security.Principal (4.3) System.Runtime (>= 4.3) System.Security.Principal.Windows (5.0) @@ -601,8 +518,8 @@ NUGET Microsoft.NETCore.Platforms (>= 1.1) Microsoft.NETCore.Targets (>= 1.1) System.Runtime (>= 4.3) - System.Text.Encoding.CodePages (5.0) - System.Runtime.CompilerServices.Unsafe (>= 5.0) + System.Text.Encoding.CodePages (7.0) + System.Runtime.CompilerServices.Unsafe (>= 6.0) System.Text.Encoding.Extensions (4.3) Microsoft.NETCore.Platforms (>= 1.1) Microsoft.NETCore.Targets (>= 1.1) @@ -615,7 +532,7 @@ NUGET Microsoft.NETCore.Platforms (>= 1.1) Microsoft.NETCore.Targets (>= 1.1) System.Runtime (>= 4.3) - System.Threading.Tasks.Dataflow (5.0) + System.Threading.Tasks.Dataflow (7.0) System.Threading.Tasks.Parallel (4.3) System.Collections.Concurrent (>= 4.3) System.Diagnostics.Debug (>= 4.3) @@ -630,3 +547,5 @@ NUGET System.Threading.ThreadPool (4.3) System.Runtime (>= 4.3) System.Runtime.Handles (>= 4.3) + System.Windows.Extensions (7.0) + System.Drawing.Common (>= 7.0) diff --git a/tests/fsyacc/unicode/test1-unicode.fsproj b/tests/fsyacc/unicode/test1-unicode.fsproj index 7dde4124..ade3fda7 100644 --- a/tests/fsyacc/unicode/test1-unicode.fsproj +++ b/tests/fsyacc/unicode/test1-unicode.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 FS0760 From ffc9985c370fce706a96921053887fa858358ef9 Mon Sep 17 00:00:00 2001 From: nojaf Date: Mon, 9 Jan 2023 09:02:02 +0100 Subject: [PATCH 2/2] Assert exit code for dotnet cli calls. --- build.fsx | 27 ++++++++++++--------------- tests/fsyacc/OldFsYaccTests.fsx | 33 +++++++++++---------------------- 2 files changed, 23 insertions(+), 37 deletions(-) diff --git a/build.fsx b/build.fsx index 55c2e64e..62e2776f 100644 --- a/build.fsx +++ b/build.fsx @@ -111,6 +111,14 @@ Target.create "CleanDocs" (fun _ -> // -------------------------------------------------------------------------------------- // Build library & test project +let dotnet arguments = + let result = + CreateProcess.fromRawCommandLine "dotnet" arguments + |> Proc.run + + if result.ExitCode <> 0 then + failwithf "Failed to run \"dotnet %s\"" arguments + Target.create "Build" (fun _ -> for framework in ["net6.0"] do [ @@ -123,9 +131,7 @@ Target.create "Build" (fun _ -> ] |> File.deleteAll for project in ["src/FsLex/fslex.fsproj"; "src/FsYacc/fsyacc.fsproj"] do - CreateProcess.fromRawCommandLine "dotnet" $"publish {project} -c Release /v:n -f {framework}" - |> Proc.run - |> ignore + dotnet $"publish {project} -c Release /v:n -f {framework}" [ "tests/JsonLexAndYaccExample/Lexer.fs" @@ -139,15 +145,11 @@ Target.create "Build" (fun _ -> for project in [ "src/FsLexYacc.Runtime/FsLexYacc.Runtime.fsproj" "tests/JsonLexAndYaccExample/JsonLexAndYaccExample.fsproj" "tests/LexAndYaccMiniProject/LexAndYaccMiniProject.fsproj" ] do - CreateProcess.fromRawCommandLine "dotnet" $"build {project} -c Release /v:n" - |> Proc.run - |> ignore + dotnet $"build {project} -c Release /v:n" ) Target.create "RunTests" (fun _ -> - CreateProcess.fromRawCommandLine "dotnet" "test ." - |> Proc.run - |> ignore + dotnet "test ." ) // -------------------------------------------------------------------------------------- @@ -155,12 +157,7 @@ Target.create "RunTests" (fun _ -> Target.create "RunOldFsYaccTests" (fun _ -> let script = Path.Combine(__SOURCE_DIRECTORY__, "tests", "fsyacc", "OldFsYaccTests.fsx") - let result = - CreateProcess.fromRawCommandLine "dotnet" $"fake run {script}" - |> Proc.run - - if result.ExitCode <> 0 then - failwith "Old FsLexYacc tests were failed" + dotnet $"fake run {script}" ) // -------------------------------------------------------------------------------------- diff --git a/tests/fsyacc/OldFsYaccTests.fsx b/tests/fsyacc/OldFsYaccTests.fsx index 70eea3ac..1227a1a3 100644 --- a/tests/fsyacc/OldFsYaccTests.fsx +++ b/tests/fsyacc/OldFsYaccTests.fsx @@ -24,25 +24,18 @@ let assertFileExists file = else failwithf "'%s' doesn't exist" file -let run project args = - Trace.traceImportant <| sprintf "Running '%s' with args %s" project args - - CreateProcess.fromRawCommandLine "dotnet" $"build {project} -c Release" - |> Proc.run - |> ignore - - // project - // |> DotNet.build (fun opts -> - // { opts with - // Configuration = DotNet.BuildConfiguration.Release }) - - let res = - CreateProcess.fromRawCommandLine "dotnet" $"run --project {project} {args}" +let dotnet arguments = + let result = + CreateProcess.fromRawCommandLine "dotnet" arguments |> Proc.run - // DotNet.exec (fun opts -> { opts with RedirectOutput = true }) "run" ("-p " + project + " " + args) - if res.ExitCode <> 0 then - failwithf "Process failed with code %d" res.ExitCode + if result.ExitCode <> 0 then + failwithf "Failed to run \"dotnet %s\"" arguments + +let run project args = + Trace.traceImportant <| sprintf "Running '%s' with args %s" project args + dotnet $"build {project} -c Release" + dotnet $"run --project {project} {args}" let test proj shouldBeOK (args, baseLineOutput) = Trace.traceImportant <| sprintf "Running '%s' with args '%s'" proj args @@ -51,7 +44,6 @@ let test proj shouldBeOK (args, baseLineOutput) = CreateProcess.fromRawCommandLine "dotnet" $"run --project {proj} {args}" |> CreateProcess.redirectOutput |> Proc.run - //DotNet.exec (fun opts -> { opts with RedirectOutput = true }) "run" ("-p " + proj + " " + args) if (res.ExitCode = 0) <> shouldBeOK then failwithf "Process failed with code %d on input %s" res.ExitCode args @@ -132,10 +124,7 @@ let test1Input4TokensBsl = Path.Combine(__SOURCE_DIRECTORY__, "Test1", "test1.in let runTests' shouldBeOK projFile xs = - CreateProcess.fromRawCommandLine "dotnet" $"build {projFile} -c Release" - |> Proc.run - |> ignore - + dotnet $"build {projFile} -c Release" xs |> List.iter (test projFile shouldBeOK) let runTests projFile xs = runTests' true projFile xs