Skip to content

Instantly share code, notes, and snippets.

@washort
Last active October 25, 2018 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save washort/753ef5dbd25c6904d3ad56f5b8035612 to your computer and use it in GitHub Desktop.
Save washort/753ef5dbd25c6904d3ad56f5b8035612 to your computer and use it in GitHub Desktop.
[version:WARNING] Errors getting Mercurial information: Not running from a Mercurial repository!
[platform:WARNING] In file included from /nix/store/akak0rxhbi4n87z3nx78ipv76frvj841-glibc-2.27-dev/include/assert.h:35:0,
[platform:WARNING] from /run/user/1000/typhon/rpython/translator/c/src/thread.h:4,
[platform:WARNING] from /run/user/1000/typhon/rpython/translator/c/src/thread.c:2:
[platform:WARNING] /nix/store/akak0rxhbi4n87z3nx78ipv76frvj841-glibc-2.27-dev/include/features.h:381:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
[platform:WARNING] # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
[platform:WARNING] ^~~~~~~
[platform:WARNING] In file included from /nix/store/akak0rxhbi4n87z3nx78ipv76frvj841-glibc-2.27-dev/include/bits/libc-header-start.h:33:0,
[platform:WARNING] from /nix/store/akak0rxhbi4n87z3nx78ipv76frvj841-glibc-2.27-dev/include/limits.h:26,
[platform:WARNING] from /nix/store/vv4r320p5yd1k01kld62q1lppjxcswhb-gcc-7.3.0/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/include-fixed/limits.h:194,
[platform:WARNING] from /nix/store/vv4r320p5yd1k01kld62q1lppjxcswhb-gcc-7.3.0/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/include-fixed/syslimits.h:7,
[platform:WARNING] from /nix/store/vv4r320p5yd1k01kld62q1lppjxcswhb-gcc-7.3.0/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/include-fixed/limits.h:34,
[platform:WARNING] from /run/user/1000/typhon/rpython/translator/c/src/signals.c:3:
[platform:WARNING] /nix/store/akak0rxhbi4n87z3nx78ipv76frvj841-glibc-2.27-dev/include/features.h:381:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
[platform:WARNING] # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
[platform:WARNING] ^~~~~~~
[platform:WARNING] In file included from /nix/store/akak0rxhbi4n87z3nx78ipv76frvj841-glibc-2.27-dev/include/assert.h:35:0,
[platform:WARNING] from /run/user/1000/typhon/rpython/translator/c/src/thread.h:4,
[platform:WARNING] from /run/user/1000/typhon/rpython/translator/c/src/thread.c:2:
[platform:WARNING] /nix/store/akak0rxhbi4n87z3nx78ipv76frvj841-glibc-2.27-dev/include/features.h:381:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
[platform:WARNING] # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
[platform:WARNING] ^~~~~~~
Taking initial turn in script...
TRACE: time 1540500409.118307 vat pa
~ "Loader args: [\"run\", \"mast/capn/testCapn\"]"
TRACE: time 1540500409.123965 vat pa
~ "Loading mast/capn/testCapn"
[platform:WARNING] In file included from /nix/store/akak0rxhbi4n87z3nx78ipv76frvj841-glibc-2.27-dev/include/errno.h:25:0,
[platform:WARNING] from /nix/store/8zixz3gkqdlhnra5n0dhigzkfqzn3daf-libuv-1.21.0/include/uv/errno.h:25,
[platform:WARNING] from /nix/store/8zixz3gkqdlhnra5n0dhigzkfqzn3daf-libuv-1.21.0/include/uv.h:48,
[platform:WARNING] from /run/user/1000/usession-unknown-123/module_cache/module_0.c:81:
[platform:WARNING] /nix/store/akak0rxhbi4n87z3nx78ipv76frvj841-glibc-2.27-dev/include/features.h:381:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
[platform:WARNING] # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
[platform:WARNING] ^~~~~~~
Name Point_curtag has no scope
Traceback (most recent call last):
File "main.py", line 318, in <module>
sys.exit(entryPoint(sys.argv))
File "main.py", line 297, in entryPoint
return runTyphon(argv)
File "main.py", line 273, in runTyphon
runUntilDone(vatManager, uv_loop, recorder)
File "main.py", line 102, in runUntilDone
vat.takeSomeTurns()
File "/home/washort/Projects/typhon/typhon/vats.py", line 232, in takeSomeTurns
self.takeTurn()
File "/home/washort/Projects/typhon/typhon/vats.py", line 190, in takeTurn
result = target.callAtom(atom, args, namedArgs)
File "/home/washort/Projects/typhon/typhon/objects/root.py", line 168, in callAtom
return self.recvNamed(atom, arguments, namedArgsMap)
File "<337-codegen /home/washort/Projects/typhon/typhon/autohelp.py:266>", line 8, in recvNamed
rv = self._WhenReactor_run_Any_(_1)
File "/home/washort/Projects/typhon/typhon/objects/refs.py", line 295, in run
outcome = f.call(u"run", [self._ref])
File "/home/washort/Projects/typhon/typhon/objects/root.py", line 147, in call
return self.callAtom(atom, arguments, namedArgs, span)
File "/home/washort/Projects/typhon/typhon/objects/root.py", line 168, in callAtom
return self.recvNamed(atom, arguments, namedArgsMap)
File "/home/washort/Projects/typhon/typhon/nano/interp.py", line 279, in recvNamed
return self.runMethod(method, args, namedArgs)
File "/home/washort/Projects/typhon/typhon/nano/interp.py", line 218, in runMethod
v = e.visitExpr(method.body)
File "<1150-codegen /home/washort/Projects/typhon/typhon/nanopass.py:181>", line 11, in visitExpr
if tag == 6: assert isinstance(specimen, self.src.IfExpr), 'donkey'; return self.visitIfExpr(specimen.test,specimen.cons,specimen.alt,specimen.span)
File "/home/washort/Projects/typhon/typhon/nano/interp.py", line 504, in visitIfExpr
return self.visitExpr(alt)
File "<1150-codegen /home/washort/Projects/typhon/typhon/nanopass.py:181>", line 14, in visitExpr
if tag == 9: assert isinstance(specimen, self.src.TryExpr), 'donkey'; return self.visitTryExpr(specimen.body,specimen.catchPatt,specimen.catchBody,specimen.span)
File "/home/washort/Projects/typhon/typhon/nano/interp.py", line 648, in visitTryExpr
return self.visitExpr(body)
File "<1150-codegen /home/washort/Projects/typhon/typhon/nanopass.py:181>", line 13, in visitExpr
if tag == 8: assert isinstance(specimen, self.src.SeqExpr), 'donkey'; return self.visitSeqExpr(specimen.exprs,specimen.span)
File "/home/washort/Projects/typhon/typhon/nano/interp.py", line 642, in visitSeqExpr
result = self.visitExpr(expr)
File "<1150-codegen /home/washort/Projects/typhon/typhon/nanopass.py:181>", line 7, in visitExpr
if tag == 2: assert isinstance(specimen, self.src.DefExpr), 'donkey'; return self.visitDefExpr(specimen.patt,specimen.ex,specimen.rvalue,specimen.span)
File "/home/washort/Projects/typhon/typhon/nano/interp.py", line 463, in visitDefExpr
val = self.visitExpr(rvalue)
File "<1150-codegen /home/washort/Projects/typhon/typhon/nanopass.py:181>", line 6, in visitExpr
if tag == 1: assert isinstance(specimen, self.src.CallExpr), 'donkey'; return self.visitCallExpr(specimen.obj,specimen.atom,specimen.args,specimen.namedArgs,specimen.span)
File "/home/washort/Projects/typhon/typhon/nano/interp.py", line 458, in visitCallExpr
return rcvr.callAtom(atom, argVals, namedArgMap, span)
File "/home/washort/Projects/typhon/typhon/objects/root.py", line 168, in callAtom
return self.recvNamed(atom, arguments, namedArgsMap)
File "<1158-codegen /home/washort/Projects/typhon/typhon/autohelp.py:266>", line 12, in recvNamed
rv = self._AstEval_run_Any_Any_Str_(_1,_2,_3)
File "/home/washort/Projects/typhon/typhon/scopes/boot.py", line 107, in run
return astEvalToPair(ast._ast, scope, filename, False)[0]
File "/home/washort/Projects/typhon/typhon/nano/interp.py", line 778, in evalToPair
result, topLocals = evalMonte(expr, scope2env(scope), filename, inRepl)
File "/home/washort/Projects/typhon/typhon/nano/interp.py", line 757, in evalMonte
environment.keys(), fqnPrefix, inRepl)
File "/home/washort/Projects/typhon/typhon/nano/main.py", line 21, in mainPipeline
bound = bindNouns(ll)
File "/home/washort/Projects/typhon/typhon/nano/scopes.py", line 470, in bindNouns
ast = ComputeFrameTables().visitExpr(ast)
File "<693-codegen /home/washort/Projects/typhon/typhon/nanopass.py:181>", line 16, in visitExpr
if tag == 11: assert isinstance(specimen, self.src.ObjectExpr), 'donkey'; return self.visitObjectExpr(specimen.doc,specimen.patt,specimen.auditors,specimen.methods,specimen.matchers,specimen.mast,specimen.layout,specimen.span)
File "/home/washort/Projects/typhon/typhon/nano/scopes.py", line 691, in visitObjectExpr
layout.computeFrameTable(self)
File "/home/washort/Projects/typhon/typhon/nano/scopes.py", line 211, in computeFrameTable
nanopass.errorWithSpan(u"Name %s has no scope" % n, None)
File "/home/washort/Projects/typhon/typhon/nanopass.py", line 190, in errorWithSpan
raise CompilerFailed(problem, span)
CompilerFailed: Compiler invariant failed: Name Point_curtag has no scope
import "lib/codec/utf8" =~ [=> UTF8 :DeepFrozen]
import "lib/capn" =~ capn :DeepFrozen
import "tools/capnpc" =~ ["main" => capnpc :DeepFrozen]
exports (main)
def main(_argv, => currentProcess, => makeProcess, => makeFileResource) as DeepFrozen:
def [ (b`CAPNPC`) => CAPNPC ] | _ := currentProcess.getEnvironment()
def compile(schema):
def tmp := makeFileResource("/tmp/test.capnp").setContents(
UTF8.encode(schema, null))
def schemaMsg := when (tmp) -> {
def pr := makeProcess(
CAPNPC,
[b`capnpc`, b`-o-`, b`/tmp/test.capnp`],
[].asMap(),
"stdout" => true,
)
pr.stdout()
}
def result
object capnpcIO:
to stdin():
return schemaMsg
to stdout():
return object _:
to run(output):
bind result := output
to complete():
null
when (schemaMsg) ->
capnpc([], "stdio" => capnpcIO)
def mod := when (result) -> {
try {
def mast := normalize(readMAST(result), typhonAstBuilder)
def schemaModule := typhonAstEval(
mast,
safeScope,
"<testCapn>")
def p := schemaModule(["lib/capn" => capn])
traceln(`p $p`)
p
} catch ee {
traceln.exception(ee)
}
}
return mod
def schema := "
@0xe62e66ea90a396da;
struct Point {
x @0 :Int64;
y @1 :Int64;
}"
def s := compile(schema)
return when (s) -> { traceln(`!!`); 0 } catch p { traceln(`:(`); traceln.exception(p); 1 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment