Supervisor (Polyglot)¶
In [ ]:
#r @"../../../../../../../.nuget/packages/fsharp.control.asyncseq/3.2.1/lib/netstandard2.1/FSharp.Control.AsyncSeq.dll"
#r @"../../../../../../../.nuget/packages/system.reactive/6.0.1-preview.1/lib/net6.0/System.Reactive.dll"
#r @"../../../../../../../.nuget/packages/system.reactive.linq/6.0.1-preview.1/lib/netstandard2.0/System.Reactive.Linq.dll"
#r @"../../../../../../../.nuget/packages/argu/6.2.4/lib/netstandard2.0/Argu.dll"
#r @"../../../../../../../.nuget/packages/microsoft.aspnetcore.http.connections.common/7.0.0/lib/net7.0/Microsoft.AspNetCore.Http.Connections.Common.dll"
#r @"../../../../../../../.nuget/packages/microsoft.aspnetcore.http.connections.client/7.0.0/lib/net7.0/Microsoft.AspNetCore.Http.Connections.Client.dll"
#r @"../../../../../../../.nuget/packages/microsoft.aspnetcore.signalr.common/7.0.0/lib/net7.0/Microsoft.AspNetCore.SignalR.Common.dll"
#r @"../../../../../../../.nuget/packages/microsoft.aspnetcore.signalr.client/7.0.0/lib/net7.0/Microsoft.AspNetCore.SignalR.Client.dll"
#r @"../../../../../../../.nuget/packages/microsoft.aspnetcore.signalr.client.core/7.0.0/lib/net7.0/Microsoft.AspNetCore.SignalR.Client.Core.dll"
#r @"../../../../../../../.nuget/packages/fsharp.json/0.4.1/lib/netstandard2.0/FSharp.Json.dll"
In [ ]:
#!import ../../lib/fsharp/Notebooks.dib
#!import ../../lib/fsharp/Testing.dib
In [ ]:
#!import ../../lib/fsharp/Common.fs
#!import ../../lib/fsharp/CommonFSharp.fs
#!import ../../lib/fsharp/Async.fs
#!import ../../lib/fsharp/AsyncSeq.fs
#!import ../../lib/fsharp/Runtime.fs
#!import ../../lib/fsharp/FileSystem.fs
In [ ]:
#if !INTERACTIVE
open Lib
#endif
In [ ]:
open Common
open SpiralFileSystem.Operators
open Microsoft.AspNetCore.SignalR.Client
sendJson¶
In [ ]:
let inline sendJson (port : int) (json : string) = async {
let host = "127.0.0.1"
let! portOpen = SpiralNetworking.test_port_open host port
if portOpen then
try
let connection = HubConnectionBuilder().WithUrl($"http://{host}:{port}").Build()
do! connection.StartAsync () |> Async.AwaitTask
let! result = connection.InvokeAsync<string> ("ClientToServerMsg", json) |> Async.AwaitTask
do! connection.StopAsync () |> Async.AwaitTask
trace Verbose (fun () -> $"Supervisor.sendJson / port: {port} / json: {json |> SpiralSm.ellipsis_end 200} / result: {result |> Option.ofObj |> Option.map (SpiralSm.ellipsis_end 200)}") _locals
return Some result
with ex ->
trace Critical (fun () -> $"Supervisor.sendJson / port: {port} / json: {json |> SpiralSm.ellipsis_end 200} / ex: {ex |> SpiralSm.format_exception}") _locals
return None
else
trace Debug (fun () -> $"Supervisor.sendJson / port: {port} / error: port not open") _locals
return None
}
sendObj¶
In [ ]:
let inline sendObj port obj =
obj
|> System.Text.Json.JsonSerializer.Serialize
|> sendJson port
VSCPos¶
In [ ]:
type VSCPos = {| line : int; character : int |}
VSCRange¶
In [ ]:
type VSCRange = VSCPos * VSCPos
RString¶
In [ ]:
type RString = VSCRange * string
TracedError¶
In [ ]:
type TracedError = {| trace : string list; message : string |}
ClientErrorsRes¶
In [ ]:
type ClientErrorsRes =
| FatalError of string
| TracedError of TracedError
| PackageErrors of {| uri : string; errors : RString list |}
| TokenizerErrors of {| uri : string; errors : RString list |}
| ParserErrors of {| uri : string; errors : RString list |}
| TypeErrors of {| uri : string; errors : RString list |}
workspaceRoot¶
In [ ]:
let workspaceRoot = SpiralFileSystem.get_workspace_root ()
awaitCompiler¶
In [ ]:
let inline awaitCompiler port cancellationToken = async {
let host = "127.0.0.1"
let struct (ct, disposable) = cancellationToken |> SpiralThreading.new_disposable_token
let! ct = ct |> SpiralAsync.merge_cancellation_token_with_default_async
let compiler = MailboxProcessor.Start (fun inbox -> async {
let! availablePort = SpiralNetworking.get_available_port (Some 180) host port
if availablePort <> port then
inbox.Post (port, false)
else
let compilerPath =
workspaceRoot </> "deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release"
|> System.IO.Path.GetFullPath
let dllPath = compilerPath </> "Spiral.dll"
let! exitCode, result =
SpiralRuntime.execution_options (fun x ->
{ x with
l0 = $@"dotnet ""{dllPath}"" --port {availablePort} --default-int i32 --default-float f64"
l1 = Some ct
l3 = Some (fun struct (_, line, _) -> async {
if line |> SpiralSm.contains $"System.IO.IOException: Failed to bind to address http://{host}:{port}: address already in use." then
inbox.Post (port, false)
if line |> SpiralSm.contains $"Server bound to: http://localhost:{availablePort}" then
let rec loop retry = async {
do!
SpiralNetworking.wait_for_port_access (Some 100) true host availablePort
|> Async.runWithTimeoutAsync 500
|> Async.Ignore
let _locals () = $"port: {availablePort} / retry: {retry} / {_locals ()}"
try
let pingObj = {| Ping = true |}
let! pingResult = pingObj |> sendObj availablePort
trace Verbose (fun () -> $"Supervisor.awaitCompiler / Ping / result: '%A{pingResult}'") _locals
match pingResult with
| Some _ -> inbox.Post (availablePort, true)
| None -> do! loop (retry + 1)
with ex ->
trace Verbose (fun () -> $"Supervisor.awaitCompiler / Ping / ex: {ex |> SpiralSm.format_exception}") _locals
do! loop (retry + 1)
}
do! loop 1
})
l6 = Some workspaceRoot
}
)
|> SpiralRuntime.execute_with_options_async
trace Debug (fun () -> $"Supervisor.awaitCompiler / exitCode: {exitCode} / result: {result}") _locals
disposable.Dispose ()
}, ct)
let! serverPort, managed = compiler.Receive ()
let connection = HubConnectionBuilder().WithUrl($"http://{host}:{serverPort}").Build ()
do! connection.StartAsync () |> Async.AwaitTask
let event = Event<_> ()
let disposable' = connection.On<string> ("ServerToClientMsg", event.Trigger)
let stream =
FSharp.Control.AsyncSeq.unfoldAsync
(fun () -> async {
let! msg = event.Publish |> Async.AwaitEvent
return Some (msg |> FSharp.Json.Json.deserialize<ClientErrorsRes>, ())
})
()
let disposable' =
new_disposable (fun () ->
async {
disposable'.Dispose ()
do! connection.StopAsync () |> Async.AwaitTask
disposable.Dispose ()
if managed
then do!
SpiralNetworking.wait_for_port_access (Some 100) false host serverPort
|> Async.runWithTimeoutAsync 1500
|> Async.Ignore
}
|> Async.RunSynchronously
)
return
serverPort,
stream,
ct,
disposable'
}
getFilePathFromUri¶
In [ ]:
let inline getFilePathFromUri uri =
match System.Uri.TryCreate (uri, System.UriKind.Absolute) with
| true, uri -> uri.AbsolutePath |> System.IO.Path.GetFullPath
| _ -> failwith "invalid uri"
getCompilerPort¶
In [ ]:
let inline getCompilerPort () =
13805
serialize_obj¶
In [ ]:
let serializeObj obj =
try
obj
|> FSharp.Json.Json.serialize
|> SpiralSm.replace "\\\\" "\\"
|> SpiralSm.replace "\\r\\n" "\n"
|> SpiralSm.replace "\\n" "\n"
with ex ->
trace Critical (fun () -> "Supervisor.serialize_obj / obj: %A{obj}") _locals
""
Backend¶
In [ ]:
type Backend =
| Fsharp
| Cuda
buildFile¶
In [ ]:
let inline buildFile backend timeout port cancellationToken path =
let rec loop retry = async {
let fullPath = path |> System.IO.Path.GetFullPath
let fileDir = fullPath |> System.IO.Path.GetDirectoryName
let fileName = fullPath |> System.IO.Path.GetFileNameWithoutExtension
let! code = fullPath |> SpiralFileSystem.read_all_text_async
let stream, disposable = fileDir |> FileSystem.watchDirectory (fun _ -> true)
use _ = disposable
let struct (token, disposable) = SpiralThreading.new_disposable_token cancellationToken
use _ = disposable
let port = port |> Option.defaultWith getCompilerPort
let! serverPort, errors, ct, disposable = awaitCompiler port (Some token)
use _ = disposable
let outputFileName =
match backend with
| Fsharp -> $"{fileName}.fsx"
| Cuda -> $"{fileName}.py"
let outputContentSeq =
stream
|> FSharp.Control.AsyncSeq.chooseAsync (function
| _, (FileSystem.FileSystemChange.Changed (path, Some text))
when (path |> System.IO.Path.GetFileName) = outputFileName
->
// fileDir </> path |> SpiralFileSystem.read_all_text_retry_async
text |> Some |> Async.init
| _ -> None |> Async.init
)
|> FSharp.Control.AsyncSeq.map (fun content ->
Some (content |> SpiralSm.replace "\r\n" "\n"), None
)
let inline printErrorData (data : {| uri : string; errors : RString list |}) =
let fileName = data.uri |> System.IO.Path.GetFileName
let errors =
data.errors
|> List.map snd
|> SpiralSm.concat "\n"
$"{fileName}:\n{errors}"
let errorsSeq =
errors
|> FSharp.Control.AsyncSeq.choose (fun error ->
match error with
| FatalError message ->
Some (message, error)
| TracedError data ->
Some (data.message, error)
| PackageErrors data when data.errors |> List.isEmpty |> not ->
Some (data |> printErrorData, error)
| TokenizerErrors data when data.errors |> List.isEmpty |> not ->
Some (data |> printErrorData, error)
| ParserErrors data when data.errors |> List.isEmpty |> not ->
Some (data |> printErrorData, error)
| TypeErrors data when data.errors |> List.isEmpty |> not ->
Some (data |> printErrorData, error)
| _ -> None
)
|> FSharp.Control.AsyncSeq.map (fun (message, error) ->
None, Some (message, error)
)
let timerSeq =
500
|> FSharp.Control.AsyncSeq.intervalMs
|> FSharp.Control.AsyncSeq.map (fun _ -> None, None)
let outputSeq =
[ outputContentSeq; errorsSeq; timerSeq ]
|> FSharp.Control.AsyncSeq.mergeAll
let! outputChild =
((None, [], 0), outputSeq)
||> FSharp.Control.AsyncSeq.scan (
fun (outputContentResult, errors, typeErrorCount) (outputContent, error) ->
trace Debug (fun () -> $"Supervisor.buildFile / AsyncSeq.scan / outputContent:\n{outputContent |> Option.defaultValue System.String.Empty |> SpiralSm.ellipsis_end 300} / errors: {errors |> serializeObj} / outputContentResult: {outputContentResult} / typeErrorCount: {typeErrorCount} / retry: {retry} / error: {error} / path: {path}") _locals
match outputContent, error with
| Some outputContent, None -> Some outputContent, errors, typeErrorCount
| None, Some (_, FatalError "File main has a type error somewhere in its path.") ->
outputContentResult, errors, typeErrorCount + 1
| None, Some error -> outputContentResult, error :: errors, typeErrorCount
| None, None when typeErrorCount >= 1 ->
outputContentResult, errors, typeErrorCount + 1
| _ -> outputContentResult, errors, typeErrorCount
)
|> FSharp.Control.AsyncSeq.takeWhileInclusive (fun (outputContent, errors, typeErrorCount) ->
trace Debug (fun () -> $"Supervisor.buildFile / takeWhileInclusive / outputContent:\n{outputContent |> Option.defaultValue System.String.Empty |> SpiralSm.ellipsis_end 300} / errors: {errors |> serializeObj} / typeErrorCount: {typeErrorCount} / retry: {retry} / path: {path}") _locals
#if INTERACTIVE
let errorWait = 2
#else
let errorWait = 2
#endif
match outputContent, errors with
| None, [] when typeErrorCount > errorWait -> false
| None, [] -> true
| _ -> false
)
|> FSharp.Control.AsyncSeq.tryLast
|> Async.withCancellationToken ct
|> Async.catch
|> Async.runWithTimeoutAsync timeout
|> Async.StartChild
// do! Async.Sleep 60
let fullPathUri = fullPath |> SpiralFileSystem.normalize_path |> SpiralFileSystem.new_file_uri
let fileOpenObj = {| FileOpen = {| uri = fullPathUri; spiText = code |} |}
let! _fileOpenResult = fileOpenObj |> sendObj serverPort
// do! Async.Sleep 60
let backendId =
match backend with
| Fsharp -> "Fsharp"
| Cuda -> "Python + Cuda"
let buildFileObj = {| BuildFile = {| uri = fullPathUri; backend = backendId |} |}
let! _buildFileResult = buildFileObj |> sendObj serverPort
let! result, typeErrorCount =
outputChild
|> Async.map (function
| Some (Ok (Some (outputCode, errors, typeErrorCount))) ->
(outputCode, errors |> List.distinct |> List.rev), typeErrorCount
| Some (Error ex) ->
trace Critical (fun () -> $"Supervisor.buildFile / error: {ex |> SpiralSm.format_exception} / retry: {retry}") _locals
(None, []), 0
| _ -> (None, []), 0
)
match result with
| None, _ when typeErrorCount > 0 && retry = 0 ->
return! loop (retry + 1)
| _ ->
if fileDir |> SpiralSm.starts_with (workspaceRoot </> "target") then
let fileDirUri = fileDir |> SpiralFileSystem.normalize_path |> SpiralFileSystem.new_file_uri
let fileDeleteObj = {| FileDelete = {| uris = [| fileDirUri |] |} |}
let! _fileDeleteResult = fileDeleteObj |> sendObj serverPort
()
let outputPath = fileDir </> outputFileName
return outputPath, result
}
loop 0
SpiralInput¶
In [ ]:
type SpiralInput =
| Spi of string * string option
| Spir of string
persistCode¶
In [ ]:
let inline persistCode (input: {| backend : Backend option; input: SpiralInput; packages: string [] |}) = async {
let targetDir = workspaceRoot </> "target/spiral_Eval"
let packagesDir = targetDir </> "packages"
let hashHex = $"%A{input.backend}%A{input.input}" |> SpiralCrypto.hash_text
let packageDir = packagesDir </> hashHex
packageDir |> System.IO.Directory.CreateDirectory |> ignore
let moduleName = "main"
let spirModule, spiModule =
match input.input with
| Spi (spi, Some spir) -> true, true
| Spi (spi, None) -> false, true
| Spir spir -> true, false
|> fun (spir, spi) ->
(if spir then $"{moduleName}_real*-" else ""),
if spi then moduleName else ""
let libLinkTargetPath = workspaceRoot </> "lib/spiral"
let libLinkPath = packageDir </> "spiral"
let packagesModule =
input.packages
|> Array.map (fun package ->
let path = workspaceRoot </> package
let packageName = path |> System.IO.Path.GetFileName
let libLinkPath = packageDir </> packageName
libLinkPath |> SpiralFileSystem.link_directory path
$"{packageName}-"
)
|> String.concat "\n "
let packageDir' =
if input.packages |> Array.isEmpty
then workspaceRoot </> "lib"
else
libLinkPath |> SpiralFileSystem.link_directory libLinkTargetPath
packageDir
let spiprojPath = packageDir </> "package.spiproj"
let spiprojCode =
$"""packageDir: {packageDir'}
packages:
|core-
spiral-
{packagesModule}
modules:
{spirModule}
{spiModule}
"""
do! spiprojCode |> SpiralFileSystem.write_all_text_exists spiprojPath
let spirPath = packageDir </> $"{moduleName}_real.spir"
let spiPath = packageDir </> $"{moduleName}.spi"
let spirCode, spiCode =
match input.input with
| Spi (spi, Some spir) -> Some spir, Some spi
| Spi (spi, None) -> None, Some spi
| Spir spir -> Some spir, None
match spirCode with
| Some spir -> do! spir |> SpiralFileSystem.write_all_text_exists spirPath
| None -> ()
match spiCode with
| Some spi -> do! spi |> SpiralFileSystem.write_all_text_exists spiPath
| None -> ()
let spiralPath =
match input.input with
| Spi _ -> spiPath
| Spir _ -> spirPath
match input.backend with
| None -> return spiralPath, None
| Some backend ->
let outputFileName =
let fileName =
match input.input with
| Spi _ -> moduleName
| Spir _ -> $"{moduleName}_real"
match backend with
| Fsharp -> $"{fileName}.fsx"
| Cuda -> $"{fileName}.py"
let outputPath = packageDir </> outputFileName
if outputPath |> System.IO.File.Exists |> not
then return spiralPath, None
else
let! oldCode = spiralPath |> SpiralFileSystem.read_all_text_async
if oldCode <> (spiCode |> Option.defaultValue (spirCode |> Option.defaultValue ""))
then return spiralPath, None
else
let! outputCode = outputPath |> SpiralFileSystem.read_all_text_async
return spiralPath, Some (outputPath, outputCode |> SpiralSm.replace "\r\n" "\n")
}
buildCode¶
In [ ]:
let buildCode backend packages isCache timeout cancellationToken input = async {
let! mainPath, outputCache =
persistCode {| input = input; backend = Some backend; packages = packages |}
match outputCache with
| Some (outputPath, outputCode) when isCache -> return mainPath, (outputPath, Some outputCode), []
| _ ->
let! outputPath, (outputCode, errors) = mainPath |> buildFile backend timeout None cancellationToken
return mainPath, (outputPath, outputCode), errors
}
In [ ]:
//// test
"""inl app () =
console.write_line "text"
1i32
inl main () =
app
|> dyn
|> ignore
"""
|> fun code -> Spi (code, None)
|> buildCode Fsharp [||] false 15000 None
|> Async.runWithTimeout 15000
|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
Some """let rec closure1 () () : unit =
let v0 : (string -> unit) = System.Console.WriteLine
let v1 : string = "text"
v0 v1
and closure0 () () : int32 =
let v0 : unit = ()
let v1 : (unit -> unit) = closure1()
let v2 : unit = (fun () -> v1 (); v0) ()
1
let v0 : (unit -> int32) = closure0()
()
""",
[]
)
)
00:00:11 v #1 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:08 d #1 runtime.execute_with_options_async / { file_name = dotnet; arguments = US1_0 ""/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64"; options = { command = dotnet "/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:buildCode@7-93>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:11 v #2 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #2 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:09 v #3 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:09 v #4 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:11 v #3 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #4 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #5 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #6 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #7 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #8 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #9 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #10 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #11 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #12 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #13 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #14 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #15 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #16 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #17 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #18 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #19 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #20 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #21 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #22 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #23 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #24 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #25 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #26 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #27 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #5 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:11 v #28 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #29 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:12 v #30 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:12 v #31 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:12 v #32 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:05 v #1 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:05 v #2 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:09 v #6 > Server bound to: http://localhost:13805 00:00:05 d #3 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi 00:00:05 d #4 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi 00:00:05 d #5 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi 00:00:05 v #6 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl app () =\n console.write_line \u0022text\u0022\n 1i32\n\ninl main ...et/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi"}} / result: 00:00:05 v #7 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi"}} / result: 00:00:06 d #8 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi 00:00:06 d #9 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi 00:00:06 d #10 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi 00:00:06 d #11 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi 00:00:07 d #12 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi 00:00:07 d #13 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi 00:00:07 d #14 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi 00:00:07 d #15 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi 00:00:08 d #16 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi 00:00:08 d #17 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi 00:00:08 d #18 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi 00:00:08 d #19 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi 00:00:08 d #20 Supervisor.buildFile / AsyncSeq.scan / outputContent: let rec closure1 () () : unit = let v0 : (string -> unit) = System.Console.WriteLine let v1 : string = "text" v0 v1 and closure0 () () : i...t v0 : unit = () let v1 : (unit -> unit) = closure1() let v2 : unit = (fun () -> v1 (); v0) () 1 let v0 : (unit -> int32) = closure0() () / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi 00:00:08 d #21 Supervisor.buildFile / takeWhileInclusive / outputContent: let rec closure1 () () : unit = let v0 : (string -> unit) = System.Console.WriteLine let v1 : string = "text" v0 v1 and closure0 () () : i...t v0 : unit = () let v1 : (unit -> unit) = closure1() let v2 : unit = (fun () -> v1 (); v0) () 1 let v0 : (unit -> int32) = closure0() () / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi 00:00:08 v #22 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6"]}} / result: 00:00:15 v #33 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:08 d #23 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite Some (Some "let rec closure1 () () : unit = let v0 : (string -> unit) = System.Console.WriteLine let v1 : string = "text" v0 v1 and closure0 () () : int32 = let v0 : unit = () let v1 : (unit -> unit) = closure1() let v2 : unit = (fun () -> v1 (); v0) () 1 let v0 : (unit -> int32) = closure0() () ", [])
In [ ]:
//// test
""
|> fun code -> Spi (code, None)
|> buildCode Fsharp [||] false 10000 None
|> Async.runWithTimeout 10000
|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
[ "Cannot find `main` in file main." ]
)
)
00:00:15 v #34 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 d #7 runtime.execute_with_options_async / { file_name = dotnet; arguments = US1_0 ""/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64"; options = { command = dotnet "/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:buildCode@7-93>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:16 v #35 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #36 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #8 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:13 v #9 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:13 v #10 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:16 v #37 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #38 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #39 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #40 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #41 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #42 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #43 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #44 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #45 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #46 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #47 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #48 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #49 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #50 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #51 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #52 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #53 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #54 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #55 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #56 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #57 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #58 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #11 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:16 v #59 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #60 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #61 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #24 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:09 v #25 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:13 v #12 > Server bound to: http://localhost:13805 00:00:09 d #26 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi 00:00:09 d #27 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi 00:00:09 d #28 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi 00:00:09 v #29 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi"}} / result: 00:00:09 v #30 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi"}} / result: 00:00:10 d #31 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi 00:00:10 d #32 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi 00:00:10 d #33 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi 00:00:10 d #34 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi 00:00:11 d #35 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi 00:00:11 d #36 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi 00:00:11 d #37 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi 00:00:11 d #38 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi 00:00:12 d #39 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi 00:00:12 d #40 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi 00:00:12 d #41 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: Some((Cannot find `main` in file main., FatalError "Cannot find `main` in file main.")) / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi 00:00:12 d #42 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [ [ "Cannot find `main` in file main.", { "FatalError": "Cannot find `main` in file main." } ] ] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi 00:00:12 v #43 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa"]}} / result: 00:00:19 v #62 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:12 d #44 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite Some (None, ["Cannot find `main` in file main."])
In [ ]:
//// test
"""inl main () =
1i32 / 0i32
"""
|> fun code -> Spi (code, None)
|> buildCode Fsharp [||] false 10000 None
|> Async.runWithTimeout 10000
|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
[ "An attempt to divide by zero has been detected at compile time." ]
)
)
00:00:19 v #63 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 d #13 runtime.execute_with_options_async / { file_name = dotnet; arguments = US1_0 ""/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64"; options = { command = dotnet "/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:buildCode@7-93>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:19 v #64 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:19 v #65 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:17 v #14 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:17 v #15 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:17 v #16 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:19 v #66 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:19 v #67 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:19 v #68 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:19 v #69 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:19 v #70 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:19 v #71 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:19 v #72 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:19 v #73 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:19 v #74 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:19 v #75 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:19 v #76 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:19 v #77 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:19 v #78 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:19 v #79 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #80 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #81 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #82 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #83 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #84 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #85 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #86 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:17 v #17 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:20 v #87 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #88 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #89 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #45 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:13 v #46 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:17 v #18 > Server bound to: http://localhost:13805 00:00:13 d #47 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi 00:00:13 d #48 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi 00:00:13 d #49 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi 00:00:13 v #50 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () =\n 1i32 / 0i32\n","uri":"file:///home/runner/work/polyglot/p...et/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi"}} / result: 00:00:13 v #51 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi"}} / result: 00:00:13 d #52 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi 00:00:13 d #53 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi 00:00:14 d #54 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi 00:00:14 d #55 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi 00:00:14 d #56 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi 00:00:14 d #57 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi 00:00:15 d #58 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi 00:00:15 d #59 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi 00:00:15 d #60 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi 00:00:15 d #61 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi 00:00:16 d #62 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: Some((An attempt to divide by zero has been detected at compile time., TracedError { message = "An attempt to divide by zero has been detected at compile time." trace = ["Error trace on line: 1, column: 10 in module: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi. inl main () = ^ "; "Error trace on line: 2, column: 5 in module: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi. 1i32 / 0i32 ^ "] })) / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi 00:00:16 d #63 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [ [ "An attempt to divide by zero has been detected at compile time.", { "TracedError": { "message": "An attempt to divide by zero has been detected at compile time.", "trace": [ "Error trace on line: 1, column: 10 in module: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi. inl main () = ^ ", "Error trace on line: 2, column: 5 in module: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi. 1i32 / 0i32 ^ " ] } } ] ] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi 00:00:16 v #64 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2"]}} / result: 00:00:23 v #90 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 d #65 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite Some (None, ["An attempt to divide by zero has been detected at compile time."])
In [ ]:
//// test
"""inl main () =
1 + ""
"""
|> fun code -> Spi (code, None)
|> buildCode Fsharp [||] false 10000 None
|> Async.runWithTimeout 10000
|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
[
"main.spi:
Constraint satisfaction error.
Got: string
Fails to satisfy: number"
]
)
)
00:00:23 v #91 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 d #19 runtime.execute_with_options_async / { file_name = dotnet; arguments = US1_0 ""/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64"; options = { command = dotnet "/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:buildCode@7-93>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:23 v #92 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #93 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #20 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:20 v #21 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:20 v #22 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:23 v #94 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #95 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #96 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #97 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #98 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #99 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #100 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #101 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #102 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #103 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #104 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #105 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #106 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #107 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #108 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #109 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #110 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #111 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #112 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #113 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #114 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:21 v #23 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:23 v #115 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #116 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #117 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:17 v #66 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:17 v #67 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:21 v #24 > Server bound to: http://localhost:13805 00:00:17 d #68 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi 00:00:17 d #69 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi 00:00:17 d #70 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi 00:00:17 v #71 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () =\n 1 \u002B \u0022\u0022\n","uri":"file:///home/runner/work/...et/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi"}} / result: 00:00:17 v #72 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi"}} / result: 00:00:17 d #73 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi 00:00:17 d #74 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi 00:00:18 d #75 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi 00:00:18 d #76 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi 00:00:18 d #77 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi 00:00:18 d #78 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi 00:00:19 d #79 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi 00:00:19 d #80 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi 00:00:19 d #81 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: Some((File main has a type error somewhere in its path., FatalError "File main has a type error somewhere in its path.")) / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi 00:00:19 d #82 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 1 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi 00:00:19 d #83 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 1 / retry: 0 / error: Some((main.spi: Constraint satisfaction error. Got: string Fails to satisfy: number, TypeErrors { errors = [(({ character = 8 line = 1 }, { character = 10 line = 1 }), "Constraint satisfaction error. Got: string Fails to satisfy: number")] uri = "file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi" })) / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi 00:00:19 d #84 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [ [ "main.spi: Constraint satisfaction error. Got: string Fails to satisfy: number", { "TypeErrors": { "errors": [ [ [ { "character": 8, "line": 1 }, { "character": 10, "line": 1 } ], "Constraint satisfaction error. Got: string Fails to satisfy: number" ] ], "uri": "file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi" } } ] ] / typeErrorCount: 1 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi 00:00:26 v #118 networking.test_port_open / { port = 13806; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:19 d #85 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 1 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi 00:00:19 d #86 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 1 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi 00:00:19 d #87 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 1 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi 00:00:19 v #88 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () =\n 1 \u002B \u0022\u0022\n","uri":"file:///home/runner/work/...et/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi"}} / result: 00:00:19 v #89 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi"}} / result: 00:00:19 d #90 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 1 / error: Some((main.spi: Constraint satisfaction error. Got: string Fails to satisfy: number, TypeErrors { errors = [(({ character = 8 line = 1 }, { character = 10 line = 1 }), "Constraint satisfaction error. Got: string Fails to satisfy: number")] uri = "file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi" })) / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi 00:00:19 d #91 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [ [ "main.spi: Constraint satisfaction error. Got: string Fails to satisfy: number", { "TypeErrors": { "errors": [ [ [ { "character": 8, "line": 1 }, { "character": 10, "line": 1 } ], "Constraint satisfaction error. Got: string Fails to satisfy: number" ] ], "uri": "file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi" } } ] ] / typeErrorCount: 0 / retry: 1 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi 00:00:19 v #92 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0"]}} / result: 00:00:19 d #93 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite 00:00:26 v #119 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:19 d #94 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite Some (None, ["main.spi: Constraint satisfaction error. Got: string Fails to satisfy: number"])
In [ ]:
//// test
"""inl main () =
x + y
"""
|> fun code -> Spi (code, None)
|> buildCode Fsharp [||] false 10000 None
|> Async.runWithTimeout 10000
|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
[
"main.spi:
Unbound variable: x.
Unbound variable: y."
]
)
)
00:00:26 v #120 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:24 d #25 runtime.execute_with_options_async / { file_name = dotnet; arguments = US1_0 ""/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64"; options = { command = dotnet "/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:buildCode@7-93>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:26 v #121 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #122 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:24 v #26 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:24 v #27 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:24 v #28 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:27 v #123 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #124 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #125 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #126 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #127 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #128 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #129 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #130 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #131 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #132 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #133 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #134 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #135 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #136 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #137 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #138 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #139 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #140 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #141 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #142 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #143 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:24 v #29 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:27 v #144 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #145 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #146 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #147 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #95 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:20 v #96 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:24 v #30 > Server bound to: http://localhost:13805 00:00:20 d #97 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi 00:00:20 d #98 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi 00:00:20 d #99 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi 00:00:20 v #100 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () =\n x \u002B y\n","uri":"file:///home/runner/work/polyglot/po...et/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi"}} / result: 00:00:20 v #101 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi"}} / result: 00:00:21 d #102 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi 00:00:21 d #103 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi 00:00:21 d #104 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi 00:00:21 d #105 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi 00:00:22 d #106 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi 00:00:22 d #107 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi 00:00:22 d #108 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi 00:00:22 d #109 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi 00:00:22 d #110 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: Some((File main has a type error somewhere in its path., FatalError "File main has a type error somewhere in its path.")) / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi 00:00:22 d #111 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 1 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi 00:00:23 d #112 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 1 / retry: 0 / error: Some((main.spi: Unbound variable: x. Unbound variable: y., TypeErrors { errors = [(({ character = 4 line = 1 }, { character = 5 line = 1 }), "Unbound variable: x."); (({ character = 8 line = 1 }, { character = 9 line = 1 }), "Unbound variable: y.")] uri = "file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi" })) / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi 00:00:23 d #113 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [ [ "main.spi: Unbound variable: x. Unbound variable: y.", { "TypeErrors": { "errors": [ [ [ { "character": 4, "line": 1 }, { "character": 5, "line": 1 } ], "Unbound variable: x." ], [ [ { "character": 8, "line": 1 }, { "character": 9, "line": 1 } ], "Unbound variable: y." ] ], "uri": "file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi" } } ] ] / typeErrorCount: 1 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi 00:00:29 v #148 networking.test_port_open / { port = 13806; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 d #114 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 1 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi 00:00:23 d #115 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 1 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi 00:00:23 d #116 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 1 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi 00:00:23 v #117 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () =\n x \u002B y\n","uri":"file:///home/runner/work/polyglot/po...et/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi"}} / result: 00:00:23 v #118 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi"}} / result: 00:00:23 d #119 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 1 / error: Some((main.spi: Unbound variable: x. Unbound variable: y., TypeErrors { errors = [(({ character = 4 line = 1 }, { character = 5 line = 1 }), "Unbound variable: x."); (({ character = 8 line = 1 }, { character = 9 line = 1 }), "Unbound variable: y.")] uri = "file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi" })) / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi 00:00:23 d #120 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [ [ "main.spi: Unbound variable: x. Unbound variable: y.", { "TypeErrors": { "errors": [ [ [ { "character": 4, "line": 1 }, { "character": 5, "line": 1 } ], "Unbound variable: x." ], [ [ { "character": 8, "line": 1 }, { "character": 9, "line": 1 } ], "Unbound variable: y." ] ], "uri": "file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi" } } ] ] / typeErrorCount: 0 / retry: 1 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi 00:00:23 v #121 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1"]}} / result: 00:00:23 d #122 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite 00:00:29 v #149 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 d #123 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite Some (None, ["main.spi: Unbound variable: x. Unbound variable: y."])
In [ ]:
//// test
"""
inl main () =
real
inl unbox_real forall a. (obj : a) : a =
typecase obj with
| _ => obj
unbox_real ()
()
"""
|> fun code -> Spi (code, None)
|> buildCode Fsharp [||] false 10000 None
|> Async.runWithTimeout 10000
|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
[ "Cannot apply a forall with a term." ]
)
)
00:00:30 v #150 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 d #31 runtime.execute_with_options_async / { file_name = dotnet; arguments = US1_0 ""/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64"; options = { command = dotnet "/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:buildCode@7-93>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:30 v #151 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #152 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #32 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:27 v #33 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:27 v #34 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:30 v #153 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #154 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #155 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #156 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #157 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #158 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #159 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #160 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #161 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #162 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #163 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #164 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #165 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #166 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #167 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #168 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #169 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #170 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #171 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #172 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #173 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #174 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #35 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:30 v #175 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #176 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #177 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #124 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:23 v #125 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:28 v #36 > Server bound to: http://localhost:13805 00:00:23 d #126 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi 00:00:23 d #127 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi 00:00:23 d #128 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi 00:00:23 v #129 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"\ninl main () =\n real\n inl unbox_real forall a. (obj : a) : a =\...et/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi"}} / result: 00:00:23 v #130 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi"}} / result: 00:00:24 d #131 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi 00:00:24 d #132 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi 00:00:24 d #133 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi 00:00:24 d #134 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi 00:00:25 d #135 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi 00:00:25 d #136 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi 00:00:25 d #137 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi 00:00:25 d #138 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi 00:00:26 d #139 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi 00:00:26 d #140 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi 00:00:26 d #141 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi 00:00:26 d #142 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi 00:00:26 d #143 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: Some((Cannot apply a forall with a term., TracedError { message = "Cannot apply a forall with a term." trace = ["Error trace on line: 2, column: 10 in module: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi. inl main () = ^ "; "Error trace on line: 4, column: 9 in module: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi. inl unbox_real forall a. (obj : a) : a = ^ "; "Error trace on line: 7, column: 9 in module: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi. unbox_real () ^ "] })) / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi 00:00:26 d #144 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [ [ "Cannot apply a forall with a term.", { "TracedError": { "message": "Cannot apply a forall with a term.", "trace": [ "Error trace on line: 2, column: 10 in module: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi. inl main () = ^ ", "Error trace on line: 4, column: 9 in module: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi. inl unbox_real forall a. (obj : a) : a = ^ ", "Error trace on line: 7, column: 9 in module: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi. unbox_real () ^ " ] } } ] ] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi 00:00:26 v #145 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a"]}} / result: 00:00:33 v #178 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 d #146 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite Some (None, ["Cannot apply a forall with a term."])
In [ ]:
//// test
"""
inl main () =
real
inl unbox_real forall a. (obj : a) : a =
typecase obj with
| _ => obj
unbox_real `i32 1
"""
|> fun code -> Spi (code, None)
|> buildCode Fsharp [||] false 10000 None
|> Async.runWithTimeout 10000
|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
[ "The main function should not have a forall." ]
)
)
00:00:34 v #179 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:31 d #37 runtime.execute_with_options_async / { file_name = dotnet; arguments = US1_0 ""/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64"; options = { command = dotnet "/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:buildCode@7-93>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:34 v #180 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #181 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:31 v #38 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:31 v #39 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:31 v #40 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:34 v #182 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #183 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #184 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #185 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #186 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #187 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #188 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #189 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #190 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #191 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #192 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #193 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #194 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #195 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #196 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #197 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #198 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #199 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #200 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #201 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #202 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:31 v #41 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:34 v #203 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #204 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #205 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #147 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:27 v #148 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:32 v #42 > Server bound to: http://localhost:13805 00:00:27 d #149 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi 00:00:27 d #150 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi 00:00:27 d #151 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi 00:00:27 v #152 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"\ninl main () =\n real\n inl unbox_real forall a. (obj : a) : a =\...et/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi"}} / result: 00:00:27 v #153 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi"}} / result: 00:00:28 d #154 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi 00:00:28 d #155 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi 00:00:28 d #156 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi 00:00:28 d #157 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi 00:00:29 d #158 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi 00:00:29 d #159 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi 00:00:29 d #160 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi 00:00:29 d #161 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi 00:00:30 d #162 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi 00:00:30 d #163 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi 00:00:30 d #164 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: Some((The main function should not have a forall., TracedError { message = "The main function should not have a forall." trace = [] })) / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi 00:00:30 d #165 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [ [ "The main function should not have a forall.", { "TracedError": { "message": "The main function should not have a forall.", "trace": [] } } ] ] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi 00:00:30 v #166 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f"]}} / result: 00:00:37 v #206 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 d #167 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite Some (None, ["The main function should not have a forall."])
In [ ]:
//// test
"""
inl init_series start end inc =
inl total : f64 = conv ((end - start) / inc) + 1
listm.init total (conv >> (*) inc >> (+) start) : list f64
type integration = (f64 -> f64) -> f64 -> f64 -> f64
inl integral dt : integration =
fun f a b =>
init_series (a + dt / 2) (b - dt / 2) dt
|> listm.map (f >> (*) dt)
|> listm.fold (+) 0
inl main () =
integral 0.1 (fun x => x ** 2) 0 1
"""
|> fun code -> Spi (code, None)
|> buildCode Fsharp [||] false 10000 None
|> Async.runWithTimeout 10000
|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
Some "0.3325000000000001\n",
[]
)
)
00:00:37 v #207 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:35 d #43 runtime.execute_with_options_async / { file_name = dotnet; arguments = US1_0 ""/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64"; options = { command = dotnet "/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:buildCode@7-93>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:37 v #208 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:37 v #209 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:35 v #44 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:35 v #45 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:35 v #46 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:37 v #210 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:37 v #211 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:37 v #212 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:37 v #213 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:37 v #214 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:37 v #215 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:37 v #216 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:37 v #217 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:37 v #218 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:38 v #219 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:38 v #220 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:38 v #221 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:38 v #222 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:38 v #223 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:38 v #224 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:38 v #225 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:38 v #226 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:38 v #227 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:38 v #228 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:38 v #229 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:38 v #230 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:35 v #47 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:38 v #231 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:38 v #232 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:38 v #233 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:38 v #234 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:31 v #168 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:31 v #169 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:35 v #48 > Server bound to: http://localhost:13805 00:00:31 d #170 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi 00:00:31 d #171 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi 00:00:31 d #172 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi 00:00:31 v #173 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"\ninl init_series start end inc =\n inl total : f64 = conv ((end - start)...et/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi"}} / result: 00:00:31 v #174 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi"}} / result: 00:00:31 d #175 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi 00:00:31 d #176 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi 00:00:32 d #177 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi 00:00:32 d #178 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi 00:00:32 d #179 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi 00:00:32 d #180 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi 00:00:33 d #181 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi 00:00:33 d #182 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi 00:00:33 d #183 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi 00:00:33 d #184 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi 00:00:34 d #185 Supervisor.buildFile / AsyncSeq.scan / outputContent: 0.3325000000000001 / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi 00:00:34 d #186 Supervisor.buildFile / takeWhileInclusive / outputContent: 0.3325000000000001 / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi 00:00:34 v #187 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db"]}} / result: 00:00:41 v #235 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 d #188 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite Some (Some "0.3325000000000001 ", [])
In [ ]:
//// test
"""
inl init_series start end inc =
inl total : f64 = conv ((end - start) / inc) + 1
listm.init total (conv >> (*) inc >> (+) start) : list f64
type integration = (f64 -> f64) -> f64 -> f64 -> f64
inl integral dt : integration =
fun f a b =>
init_series (a + dt / 2) (b - dt / 2) dt
|> listm.map (f >> (*) dt)
|> listm.fold (+) 0
inl main () =
integral 0.1 (fun x => x ** 2) 0 1
"""
|> fun code -> Spi (code, None)
|> buildCode Cuda [||] false 10000 None
|> Async.runWithTimeout 10000
|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
Some @"kernel = r""""""
""""""
class static_array():
def __init__(self, length):
self.ptr = []
for _ in range(length):
self.ptr.append(None)
def __getitem__(self, index):
assert 0 <= index < len(self.ptr), ""The get index needs to be in range.""
return self.ptr[index]
def __setitem__(self, index, value):
assert 0 <= index < len(self.ptr), ""The set index needs to be in range.""
self.ptr[index] = value
class static_array_list(static_array):
def __init__(self, length):
super().__init__(length)
self.length = 0
def __getitem__(self, index):
assert 0 <= index < self.length, ""The get index needs to be in range.""
return self.ptr[index]
def __setitem__(self, index, value):
assert 0 <= index < self.length, ""The set index needs to be in range.""
self.ptr[index] = value
def push(self,value):
assert (self.length < len(self.ptr)), ""The length before pushing has to be less than the maximum length of the array.""
self.ptr[self.length] = value
self.length += 1
def pop(self):
assert (0 < self.length), ""The length before popping has to be greater than 0.""
self.length -= 1
return self.ptr[self.length]
def unsafe_set_length(self,i):
assert 0 <= i <= len(self.ptr), ""The new length has to be in range.""
self.length = i
class dynamic_array(static_array):
pass
class dynamic_array_list(static_array_list):
def length_(self): return self.length
import cupy as cp
from dataclasses import dataclass
from typing import NamedTuple, Union, Callable, Tuple
i8 = int; i16 = int; i32 = int; i64 = int; u8 = int; u16 = int; u32 = int; u64 = int; f32 = float; f64 = float; char = str; string = str
def main_body():
return 0.3325000000000001
def main():
r = main_body()
cp.cuda.get_current_stream().synchronize() # This line is here so the `__trap()` calls on the kernel aren't missed.
return r
if __name__ == '__main__': result = main(); None if result is None else print(result)
",
[]
)
)
00:00:41 v #236 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:38 d #49 runtime.execute_with_options_async / { file_name = dotnet; arguments = US1_0 ""/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64"; options = { command = dotnet "/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:buildCode@7-93>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:41 v #237 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #238 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #50 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:39 v #51 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:39 v #52 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:41 v #239 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #240 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #241 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #242 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #243 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #244 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #245 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #246 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #247 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #248 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #249 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #250 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #251 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #252 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #253 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #254 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #255 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #256 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #257 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #258 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #259 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #53 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:41 v #260 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #261 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #262 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 v #263 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:35 v #189 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:35 v #190 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:39 v #54 > Server bound to: http://localhost:13805 00:00:35 d #191 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi 00:00:35 d #192 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi 00:00:35 d #193 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi 00:00:35 v #194 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"\ninl init_series start end inc =\n inl total : f64 = conv ((end - start)...et/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi"}} / result: 00:00:35 v #195 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Python \u002B Cuda","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi"}} / result: 00:00:35 d #196 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi 00:00:35 d #197 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi 00:00:36 d #198 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi 00:00:36 d #199 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi 00:00:36 d #200 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi 00:00:36 d #201 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi 00:00:37 d #202 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi 00:00:37 d #203 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi 00:00:37 d #204 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi 00:00:37 d #205 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi 00:00:37 d #206 Supervisor.buildFile / AsyncSeq.scan / outputContent: kernel = r""" """ class static_array(): def __init__(self, length): self.ptr = [] for _ in range(length): self.ptr.app...the `__trap()` calls on the kernel aren't missed. return r if __name__ == '__main__': result = main(); None if result is None else print(result) / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi 00:00:37 d #207 Supervisor.buildFile / takeWhileInclusive / outputContent: kernel = r""" """ class static_array(): def __init__(self, length): self.ptr = [] for _ in range(length): self.ptr.app...the `__trap()` calls on the kernel aren't missed. return r if __name__ == '__main__': result = main(); None if result is None else print(result) / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi 00:00:37 v #208 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8"]}} / result: 00:00:44 v #264 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:38 d #209 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite Some (Some "kernel = r""" """ class static_array(): def __init__(self, length): self.ptr = [] for _ in range(length): self.ptr.append(None) def __getitem__(self, index): assert 0 <= index < len(self.ptr), "The get index needs to be in range." return self.ptr[index] def __setitem__(self, index, value): assert 0 <= index < len(self.ptr), "The set index needs to be in range." self.ptr[index] = value class static_array_list(static_array): def __init__(self, length): super().__init__(length) self.length = 0 def __getitem__(self, index): assert 0 <= index < self.length, "The get index needs to be in range." return self.ptr[index] def __setitem__(self, index, value): assert 0 <= index < self.length, "The set index needs to be in range." self.ptr[index] = value def push(self,value): assert (self.length < len(self.ptr)), "The length before pushing has to be less than the maximum length of the array." self.ptr[self.length] = value self.length += 1 def pop(self): assert (0 < self.length), "The length before popping has to be greater than 0." self.length -= 1 return self.ptr[self.length] def unsafe_set_length(self,i): assert 0 <= i <= len(self.ptr), "The new length has to be in range." self.length = i class dynamic_array(static_array): pass class dynamic_array_list(static_array_list): def length_(self): return self.length import cupy as cp from dataclasses import dataclass from typing import NamedTuple, Union, Callable, Tuple i8 = int; i16 = int; i32 = int; i64 = int; u8 = int; u16 = int; u32 = int; u64 = int; f32 = float; f64 = float; char = str; string = str def main_body(): return 0.3325000000000001 def main(): r = main_body() cp.cuda.get_current_stream().synchronize() # This line is here so the `__trap()` calls on the kernel aren't missed. return r if __name__ == '__main__': result = main(); None if result is None else print(result) ", [])
In [ ]:
//// test
"""
inl init_series start end inc =
inl total : f64 = conv ((end - start) / inc) + 1
listm.init total (conv >> (*) inc >> (+) start) : list f64
type integration = (f64 -> f64) -> f64 -> f64 -> f64
inl integral dt : integration =
fun f a b =>
init_series (a + dt / 2) (b - dt / 2) dt
|> listm.map (f >> (*) dt)
|> listm.fold (+) 0
inl main () =
integral 0.01 (fun x => x ** 2) 0 1
"""
|> fun code -> Spi (code, None)
|> buildCode Fsharp [||] false 10000 None
|> Async.runWithTimeout 10000
|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
Some "0.33332500000000004\n",
[]
)
)
// |> _assertEqual None
// |> fun x -> printfn $"{x.ToDisplayString ()}"
00:00:45 v #265 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:42 d #55 runtime.execute_with_options_async / { file_name = dotnet; arguments = US1_0 ""/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64"; options = { command = dotnet "/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:buildCode@7-93>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:45 v #266 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #267 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:42 v #56 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:42 v #57 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:42 v #58 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:45 v #268 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #269 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #270 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #271 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #272 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #273 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #274 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #275 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #276 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #277 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #278 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #279 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #280 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #281 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #282 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #283 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #284 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #285 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #286 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #287 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #288 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:42 v #59 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:45 v #289 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #290 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #291 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #292 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:38 v #210 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:38 v #211 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:43 v #60 > Server bound to: http://localhost:13805 00:00:38 d #212 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi 00:00:38 d #213 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi 00:00:38 d #214 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi 00:00:38 v #215 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"\ninl init_series start end inc =\n inl total : f64 = conv ((end - start)...et/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi"}} / result: 00:00:38 v #216 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi"}} / result: 00:00:39 d #217 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi 00:00:39 d #218 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi 00:00:39 d #219 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi 00:00:39 d #220 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi 00:00:40 d #221 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi 00:00:40 d #222 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi 00:00:40 d #223 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi 00:00:40 d #224 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi 00:00:41 d #225 Supervisor.buildFile / AsyncSeq.scan / outputContent: / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi 00:00:41 d #226 Supervisor.buildFile / takeWhileInclusive / outputContent: / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi 00:00:41 d #227 Supervisor.buildFile / AsyncSeq.scan / outputContent: 0.33332500000000004 / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi 00:00:41 d #228 Supervisor.buildFile / takeWhileInclusive / outputContent: 0.33332500000000004 / errors: [] / typeErrorCount: 0 / retry: 0 / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi 00:00:41 v #229 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4"]}} / result: 00:00:48 v #293 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:41 d #230 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite Some (Some "0.33332500000000004 ", [])
getFileTokenRange¶
In [ ]:
let inline getFileTokenRange port cancellationToken path = async {
let fullPath = path |> System.IO.Path.GetFullPath
let! code = fullPath |> SpiralFileSystem.read_all_text_async
let lines = code |> SpiralSm.split "\n"
let struct (token, disposable) = SpiralThreading.new_disposable_token cancellationToken
use _ = disposable
let port = port |> Option.defaultWith getCompilerPort
let! serverPort, _errors, ct, disposable = awaitCompiler port (Some token)
use _ = disposable
let fullPathUri = fullPath |> SpiralFileSystem.normalize_path |> SpiralFileSystem.new_file_uri
let fileOpenObj = {| FileOpen = {| uri = fullPathUri; spiText = code |} |}
let! _fileOpenResult = fileOpenObj |> sendObj serverPort
// do! Async.Sleep 60
let fileTokenRangeObj =
{|
FileTokenRange =
{|
uri = fullPathUri
range =
[|
{| line = 0; character = 0 |}
{| line = lines.Length - 1; character = lines.[lines.Length - 1].Length |}
|]
|}
|}
let! fileTokenRangeResult =
fileTokenRangeObj
|> sendObj serverPort
|> Async.withCancellationToken ct
let fileDir = fullPath |> System.IO.Path.GetDirectoryName
if fileDir |> SpiralSm.starts_with (workspaceRoot </> "target") then
let fileDirUri = fileDir |> SpiralFileSystem.normalize_path |> SpiralFileSystem.new_file_uri
let fileDeleteObj = {| FileDelete = {| uris = [| fileDirUri |] |} |}
let! _fileDeleteResult = fileDeleteObj |> sendObj serverPort
()
return fileTokenRangeResult |> Option.map FSharp.Json.Json.deserialize<int array>
}
getCodeTokenRange¶
In [ ]:
let inline getCodeTokenRange cancellationToken code = async {
let! mainPath, _ =
persistCode {| input = Spi (code, None); backend = None; packages = [||] |}
let codeDir = mainPath |> System.IO.Path.GetDirectoryName
let tokensPath = codeDir </> "tokens.json"
let! tokens = async {
if tokensPath |> System.IO.File.Exists |> not
then return None
else
let! text = tokensPath |> SpiralFileSystem.read_all_text_async
return
if text.Length > 2
then text |> FSharp.Json.Json.deserialize<int array> |> Some
else None
}
match tokens with
| Some tokens ->
return tokens |> Some
| None -> return! mainPath |> getFileTokenRange None cancellationToken
}
In [ ]:
//// test
"""inl main () = ()"""
|> getCodeTokenRange None
|> Async.runWithTimeout 10000
|> Option.flatten
|> _assertEqual (Some [| 0; 0; 3; 7; 0; 0; 4; 4; 0; 0; 0; 5; 1; 8; 0; 0; 1; 1; 8; 0; 0; 2; 1; 4; 0; 0;
2; 1; 8; 0; 0; 1; 1; 8; 0 |])
00:00:50 v #294 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 d #61 runtime.execute_with_options_async / { file_name = dotnet; arguments = US1_0 ""/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64"; options = { command = dotnet "/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:it@4-194>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:51 v #295 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #296 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #62 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:48 v #63 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:48 v #64 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:51 v #297 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #298 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #299 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #300 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #301 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #302 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #303 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #304 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #305 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #306 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #307 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #308 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #309 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #310 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #311 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #312 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #313 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #314 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #315 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #316 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #317 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #65 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:51 v #318 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #319 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #320 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:44 v #231 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:44 v #232 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:48 v #66 > Server bound to: http://localhost:13805 00:00:44 v #233 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () = ()","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/20e725d46cfdc99c0f307f1933a76ec7da4570c1b757721164d86f19feaf821e/main.spi"}} / result: 00:00:45 v #234 Supervisor.sendJson / port: 13805 / json: {"FileTokenRange":{"range":[{"character":0,"line":0},{"character":16,"line":0}],"uri":"file:///home/...et/spiral_Eval/packages/20e725d46cfdc99c0f307f1933a76ec7da4570c1b757721164d86f19feaf821e/main.spi"}} / result: Some([ 0, 0, 3, 7, 0, 0, 4, 4, 0, 0, 0, 5, 1, 8, 0, 0, 1, 1, 8, 0, 0, 2, 1, 4, 0, 0, 2, 1, 8, 0, 0, 1, 1, 8, 0 ]) 00:00:45 v #235 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/20e725d46cfdc99c0f307f1933a76ec7da4570c1b757721164d86f19feaf821e"]}} / result: 00:00:52 v #321 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } Some [|0; 0; 3; 7; 0; 0; 4; 4; 0; 0; 0; 5; 1; 8; 0; 0; 1; 1; 8; 0; 0; 2; 1; 4; 0; 0; 2; 1; 8; 0; 0; 1; 1; 8; 0|]
In [ ]:
//// test
"""inl main () = 1i32"""
|> getCodeTokenRange None
|> Async.runWithTimeout 10000
|> Option.flatten
|> _assertEqual (Some [| 0; 0; 3; 7; 0; 0; 4; 4; 0; 0; 0; 5; 1; 8; 0; 0; 1; 1; 8; 0; 0; 2; 1; 4; 0; 0;
2; 1; 3; 0; 0; 1; 3; 12; 0 |])
00:00:53 v #322 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:50 d #67 runtime.execute_with_options_async / { file_name = dotnet; arguments = US1_0 ""/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64"; options = { command = dotnet "/home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release/Spiral.dll" --port 13805 --default-int i32 --default-float f64; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:it@4-426>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:53 v #323 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #324 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:50 v #68 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:50 v #69 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:50 v #70 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:53 v #325 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #326 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #327 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #328 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #329 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #330 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #331 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #332 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #333 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #334 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #335 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #336 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #337 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #338 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #339 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #340 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #341 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #342 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #343 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #344 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #345 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #71 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:53 v #346 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #347 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #348 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:53 v #349 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:46 v #236 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:46 v #237 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:51 v #72 > Server bound to: http://localhost:13805 00:00:47 v #238 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () = 1i32","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/5370829508ddefc7386d6b4d280722b47d97cb925585525bee733a187ff8f18b/main.spi"}} / result: 00:00:47 v #239 Supervisor.sendJson / port: 13805 / json: {"FileTokenRange":{"range":[{"character":0,"line":0},{"character":18,"line":0}],"uri":"file:///home/...et/spiral_Eval/packages/5370829508ddefc7386d6b4d280722b47d97cb925585525bee733a187ff8f18b/main.spi"}} / result: Some([ 0, 0, 3, 7, 0, 0, 4, 4, 0, 0, 0, 5, 1, 8, 0, 0, 1, 1, 8, 0, 0, 2, 1, 4, 0, 0, 2, 1, 3, 0, 0, 1, 3, 12, 0 ]) 00:00:47 v #240 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/5370829508ddefc7386d6b4d280722b47d97cb925585525bee733a187ff8f18b"]}} / result: 00:00:54 v #350 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } Some [|0; 0; 3; 7; 0; 0; 4; 4; 0; 0; 0; 5; 1; 8; 0; 0; 1; 1; 8; 0; 0; 2; 1; 4; 0; 0; 2; 1; 3; 0; 0; 1; 3; 12; 0|]
Arguments¶
In [ ]:
[<RequireQualifiedAccess>]
type Arguments =
| Build_File of string * string
| File_Token_Range of string * string
| Execute_Command of string
| [<Argu.ArguAttributes.Unique>] Timeout of int
| [<Argu.ArguAttributes.Unique>] Port of int
| [<Argu.ArguAttributes.Unique>] Parallel
| [<Argu.ArguAttributes.Unique>] Exit_On_Error
interface Argu.IArgParserTemplate with
member s.Usage =
match s with
| Build_File _ -> nameof Build_File
| File_Token_Range _ -> nameof File_Token_Range
| Execute_Command _ -> nameof Execute_Command
| Timeout _ -> nameof Timeout
| Port _ -> nameof Port
| Parallel -> nameof Parallel
| Exit_On_Error-> nameof Exit_On_Error
In [ ]:
//// test
Argu.ArgumentParser.Create<Arguments>().PrintUsage ()
"USAGE: dotnet-repl [--help] [--build-file <string> <string>] [--file-token-range <string> <string>] [--execute-command <string>] [--timeout <int>] [--port <int>] [--parallel] [--exit-on-error] OPTIONS: --build-file <string> <string> Build_File --file-token-range <string> <string> File_Token_Range --execute-command <string> Execute_Command --timeout <int> Timeout --port <int> Port --parallel Parallel --exit-on-error Exit_On_Error --help display this list of options. "
main¶
In [ ]:
let main args =
let argsMap = args |> Runtime.parseArgsMap<Arguments>
let buildFileActions =
argsMap
|> Map.tryFind (nameof Arguments.Build_File)
|> Option.defaultValue []
|> List.choose (function
| Arguments.Build_File (inputPath, outputPath) -> Some (inputPath, outputPath)
| _ -> None
)
let fileTokenRangeActions =
argsMap
|> Map.tryFind (nameof Arguments.File_Token_Range)
|> Option.defaultValue []
|> List.choose (function
| Arguments.File_Token_Range (inputPath, outputPath) -> Some (inputPath, outputPath)
| _ -> None
)
let executeCommandActions =
argsMap
|> Map.tryFind (nameof Arguments.Execute_Command)
|> Option.defaultValue []
|> List.choose (function
| Arguments.Execute_Command command -> Some command
| _ -> None
)
let timeout =
match argsMap |> Map.tryFind (nameof Arguments.Timeout) with
| Some [ Arguments.Timeout timeout ] -> timeout
| _ -> 60000 * 60
let port =
match argsMap |> Map.tryFind (nameof Arguments.Port) with
| Some [ Arguments.Port port ] -> Some port
| _ -> None
let isParallel = argsMap |> Map.containsKey (nameof Arguments.Parallel)
let isExitOnError = argsMap |> Map.containsKey (nameof Arguments.Exit_On_Error)
async {
let port =
port
|> Option.defaultWith getCompilerPort
let struct (localToken, disposable) = SpiralThreading.new_disposable_token None
let! serverPort, _errors, compilerToken, disposable = awaitCompiler port (Some localToken)
use _ = disposable
let buildFileAsync =
buildFileActions
|> List.map (fun (inputPath, outputPath) -> async {
let! _outputPath, (outputCode, errors) =
let backend =
if outputPath |> SpiralSm.ends_with ".fsx"
then Fsharp
elif outputPath |> SpiralSm.ends_with ".py"
then Cuda
else failwith $"Supervisor.main / invalid backend / outputPath: {outputPath}"
let isReal = inputPath |> SpiralSm.ends_with ".spir"
inputPath |> buildFile backend timeout (Some serverPort) None
errors
|> List.map snd
|> List.iter (fun error ->
trace Critical (fun () -> $"main / error: {error |> serializeObj}") _locals
)
match outputCode with
| Some outputCode ->
do! outputCode |> SpiralFileSystem.write_all_text_exists outputPath
return 0
| None ->
if isExitOnError
then SpiralRuntime.current_process_kill ()
return 1
})
let fileTokenRangeAsync =
fileTokenRangeActions
|> List.map (fun (inputPath, outputPath) -> async {
let! tokenRange = inputPath |> getFileTokenRange (Some serverPort) None
match tokenRange with
| Some tokenRange ->
do! tokenRange |> FSharp.Json.Json.serialize |> SpiralFileSystem.write_all_text_exists outputPath
return 0
| None ->
if isExitOnError
then SpiralRuntime.current_process_kill ()
return 1
})
let executeCommandAsync =
executeCommandActions
|> List.map (fun command -> async {
let! exitCode, result =
SpiralRuntime.execution_options (fun x ->
{ x with
l0 = command
l1 = Some compilerToken
}
)
|> SpiralRuntime.execute_with_options_async
trace Debug (fun () -> $"main / executeCommand / exitCode: {exitCode} / command: {command}") _locals
if isExitOnError && exitCode <> 0
then SpiralRuntime.current_process_kill ()
return exitCode
})
return!
[| buildFileAsync; fileTokenRangeAsync; executeCommandAsync |]
|> Seq.collect id
|> fun x ->
if isParallel
then Async.Parallel (x, float System.Environment.ProcessorCount * 0.51 |> ceil |> int)
else Async.Sequential x
|> Async.map Array.sum
}
|> Async.runWithTimeout timeout
|> Option.defaultValue 1
In [ ]:
//// test
let args =
System.Environment.GetEnvironmentVariable "ARGS"
|> SpiralRuntime.split_args
|> Result.toArray
|> Array.collect id
match args with
| [||] -> 0
| args -> if main args = 0 then 0 else failwith "main failed"
0