@@ -25,10 +25,25 @@ if argsToThisFsxScript.Any(fun arg -> arg = "--from-configure") then
2525
2626let rootDir = DirectoryInfo( Path.Combine(__ SOURCE_ DIRECTORY__, " .." ))
2727let stableVersionOfMono = Version( " 6.6" )
28+ let stableVersionOfDotNet = Version " 8.0"
2829
2930let buildTool , legacyBuildTool , areGtkLibsAbsentOrDoesNotApply =
3031
31- let dotnetCmd = Process.ConfigCommandCheck [ " dotnet" ] false true
32+ let anyDotnetCmd = Process.ConfigCommandCheck [ " dotnet" ] false true
33+ let dotnet8Cmd =
34+ match anyDotnetCmd with
35+ | None -> None
36+ | Some _ ->
37+ let currentDotNetVersion =
38+ Process.Execute({ Command = " dotnet" ; Arguments = " --version" }, Echo.Off) .Unwrap() .Trim()
39+ |> Version
40+
41+ // NOTE: see what 1 means here: https://learn.microsoft.com/en-us/dotnet/api/system.version.compareto?view=netframework-4.7
42+ if 1 = stableVersionOfDotNet.CompareTo currentDotNetVersion then
43+ anyDotnetCmd
44+ else
45+ Console.WriteLine " (too old)"
46+ None
3247
3348 match Misc.GuessPlatform() with
3449 | Misc.Platform.Windows ->
@@ -42,23 +57,23 @@ let buildTool, legacyBuildTool, areGtkLibsAbsentOrDoesNotApply =
4257 Console.WriteLine " found"
4358 Some msbuildPath
4459
45- dotnetCmd , msbuildCmd, true
60+ dotnet8Cmd , msbuildCmd, true
4661 | platform (* Unix *) ->
4762 Process.ConfigCommandCheck [ " make" ] true true |> ignore
4863
4964 match Process.ConfigCommandCheck [ " mono" ] false true with
5065 | None ->
51- dotnetCmd , None, true
66+ dotnet8Cmd , None, true
5267 | Some _ ->
5368
5469 match Process.ConfigCommandCheck [ " fsharpc" ] false true with
5570 | None ->
56- dotnetCmd , None, true
71+ dotnet8Cmd , None, true
5772 | Some _ ->
5873
5974 if platform = Misc.Platform.Mac then
6075 let msBuildOrXBuild = Process.ConfigCommandCheck [ " msbuild" ; " xbuild" ] false true
61- dotnetCmd , msBuildOrXBuild, true
76+ dotnet8Cmd , msBuildOrXBuild, true
6277 else
6378
6479 let pkgConfig = " pkg-config"
@@ -141,7 +156,7 @@ let buildTool, legacyBuildTool, areGtkLibsAbsentOrDoesNotApply =
141156 else
142157 maybeXbuild
143158
144- dotnetCmd , legacyBuildTool, areGtkLibsAbsentOrDoesNotApply
159+ dotnet8Cmd , legacyBuildTool, areGtkLibsAbsentOrDoesNotApply
145160
146161if buildTool.IsNone && legacyBuildTool.IsNone then
147162 Console.Out.Flush()
0 commit comments