diff --git a/buildtools/AssemblyCheck/AssemblyCheck.fsproj b/buildtools/AssemblyCheck/AssemblyCheck.fsproj index 9c5a5b11e14..78d24349889 100644 --- a/buildtools/AssemblyCheck/AssemblyCheck.fsproj +++ b/buildtools/AssemblyCheck/AssemblyCheck.fsproj @@ -3,7 +3,6 @@ Exe $(FSharpNetCoreProductTargetFramework) - net8.0 true diff --git a/buildtools/buildtools.targets b/buildtools/buildtools.targets index b4160b714f2..ed0259f01c7 100644 --- a/buildtools/buildtools.targets +++ b/buildtools/buildtools.targets @@ -20,7 +20,7 @@ BeforeTargets="CoreCompile"> - $(ArtifactsDir)\bin\fslex\Release\net8.0\fslex.dll + $(ArtifactsDir)\bin\fslex\Release\net9.0\linux-x64\fslex.dll @@ -44,7 +44,7 @@ BeforeTargets="CoreCompile"> - $(ArtifactsDir)\bin\fsyacc\Release\net8.0\fsyacc.dll + $(ArtifactsDir)\bin\fsyacc\Release\net9.0\linux-x64\fsyacc.dll diff --git a/buildtools/fslex/fslex.fsproj b/buildtools/fslex/fslex.fsproj index b2b744c4a92..b450de1668d 100644 --- a/buildtools/fslex/fslex.fsproj +++ b/buildtools/fslex/fslex.fsproj @@ -3,7 +3,6 @@ Exe $(FSharpNetCoreProductTargetFramework) - net8.0 true LatestMajor $(NoWarn);64;1182;1204 diff --git a/buildtools/fsyacc/fsyacc.fsproj b/buildtools/fsyacc/fsyacc.fsproj index cf4e599e25c..5f97b762e03 100644 --- a/buildtools/fsyacc/fsyacc.fsproj +++ b/buildtools/fsyacc/fsyacc.fsproj @@ -3,7 +3,6 @@ Exe $(FSharpNetCoreProductTargetFramework) - net8.0 true LatestMajor $(NoWarn);64;1182;1204 diff --git a/fcs/build.sh b/fcs/build.sh index c571b3de4a1..99848aa8ffa 100644 --- a/fcs/build.sh +++ b/fcs/build.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash -dotnet build -c Release buildtools +dotnet build -c Release buildtools/fslex +dotnet build -c Release buildtools/fsyacc dotnet build -c Release src/Compiler dotnet run -c Release --project fcs/fcs-test echo "Binaries can be found here: /artifacts/bin/FSharp.Compiler.Service/Release/netstandard2.0/" \ No newline at end of file diff --git a/fcs/fcs-test/fcs-test.fsproj b/fcs/fcs-test/fcs-test.fsproj index fd951e954ea..d401fb31e84 100644 --- a/fcs/fcs-test/fcs-test.fsproj +++ b/fcs/fcs-test/fcs-test.fsproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 true @@ -19,9 +19,9 @@ - - - - + + + + diff --git a/fcs/service_slim.fs b/fcs/service_slim.fs index 53a4a32ba9a..d80132171a8 100644 --- a/fcs/service_slim.fs +++ b/fcs/service_slim.fs @@ -116,7 +116,7 @@ module internal ParseAndCheck = SimulatedMSBuildReferenceResolver.getResolver(), defaultFSharpBinariesDir = FSharpCheckerResultsSettings.defaultFSharpBinariesDir, reduceMemoryUsage = ReduceMemoryFlag.Yes, - implicitIncludeDir = Path.GetDirectoryName(projectOptions.ProjectFileName), + implicitIncludeDir = !! Path.GetDirectoryName(projectOptions.ProjectFileName), isInteractive = false, isInvalidationSupported = true, defaultCopyFSharpCore = CopyFSharpCoreFlag.No, @@ -134,7 +134,6 @@ module internal ParseAndCheck = let dependencyProvider = new DependencyProvider() let! tcGlobals, tcImports = TcImports.BuildTcImports (tcConfigP, dependencyProvider) - |> Async.AwaitNodeCode // Handle type provider invalidation by resetting compiler state tcImports.GetCcusExcludingBase() @@ -142,7 +141,7 @@ module internal ParseAndCheck = ccu.Deref.InvalidateEvent.Add(fun _ -> reset()) ) - let assemblyName = projectOptions.ProjectFileName |> Path.GetFileNameWithoutExtension + let assemblyName = !! Path.GetFileNameWithoutExtension(projectOptions.ProjectFileName) let tcInitial, openDecls0 = GetInitialTcEnv (assemblyName, rangeStartup, tcConfig, tcImports, tcGlobals) let tcInitialState = GetInitialTcState (rangeStartup, assemblyName, tcConfig, tcGlobals, tcImports, tcInitial, openDecls0) @@ -166,7 +165,7 @@ module internal ParseAndCheck = topAttrsOpt: TopAttribs option, tcImplFilesOpt: CheckedImplFile list option, compilerState) = let assemblyRef = mkSimpleAssemblyRef "stdin" let access = tcState.TcEnvFromImpls.AccessRights - let symbolUses = Choice2Of2 TcSymbolUses.Empty + let symbolUses = Choice2Of2 (async { return seq { } }) let dependencyFiles = parseResults |> Seq.map (fun x -> x.DependencyFiles) |> Array.concat let getAssemblyData () = None let details = (compilerState.tcGlobals, compilerState.tcImports, tcState.Ccu, tcState.CcuSig, symbolUses, topAttrsOpt, @@ -313,12 +312,12 @@ type InteractiveChecker internal (compilerStateCache) = let ctok = CompilationThreadToken() let flatErrors = compilerState.tcConfig.flatErrors let errors, diagnosticsLogger, _loggerProvider = CompileHelpers.mkCompilationDiagnosticsHandlers(flatErrors) - let exitCode = + let exnOpt = CompileHelpers.tryCompile diagnosticsLogger (fun exiter -> CompileFromTypedAst (ctok, compilerState.tcGlobals, compilerState.tcImports, tcState.Ccu, tcImplFiles, topAttrs, compilerState.tcConfig, outFile, diagnosticsLogger, exiter)) - return errors.ToArray(), exitCode + return errors.ToArray(), exnOpt } /// Parses and checks the whole project, good for compilers (Fable etc.) diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index 949eba27895..85bf6fd9f9d 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -1694,6 +1694,7 @@ module InfoMemberPrinting = |> PrintTypes.layoutCsharpCodeAnalysisIlAttributes denv (mi.RawMetadata.Return.CustomAttrs) (squareAngleReturn >> (@@)) let paramLayouts = minfo.GetParamDatas (amap, m, minst) + |> List.map (List.map fst) |> List.head |> List.zip (mi.ParamMetadata) |> List.map(fun (ilParams,paramData) -> diff --git a/src/Compiler/Driver/fsc.fs b/src/Compiler/Driver/fsc.fs index c9407a98174..bf6fa877173 100644 --- a/src/Compiler/Driver/fsc.fs +++ b/src/Compiler/Driver/fsc.fs @@ -1273,14 +1273,14 @@ let CompileFromTypedAst typedImplFiles, topAttrs, tcConfig: TcConfig, - outfile, + outfile: string, diagnosticsLogger, exiter: Exiter ) = let tcImportsCapture = None let dynamicAssemblyCreator = None - let assemblyName = Path.GetFileNameWithoutExtension(outfile) + let assemblyName = !! Path.GetFileNameWithoutExtension(outfile) // Doubling here tcImports as frameworkTcImports, seems to work... let frameworkTcImports = tcImports let pdbfile = None diff --git a/src/Compiler/Service/service.fsi b/src/Compiler/Service/service.fsi index e98f74a6029..244ab7483f6 100644 --- a/src/Compiler/Service/service.fsi +++ b/src/Compiler/Service/service.fsi @@ -23,7 +23,7 @@ open FSharp.Compiler.Driver module internal CompileHelpers = val mkCompilationDiagnosticsHandlers: bool -> ResizeArray * DiagnosticsLogger * IDiagnosticsLoggerProvider - val tryCompile: DiagnosticsLogger -> (StopProcessingExiter -> unit) -> int + val tryCompile: DiagnosticsLogger -> (StopProcessingExiter -> unit) -> exn option /// Used to parse and check F# source code. []