asmble icon indicating copy to clipboard operation
asmble copied to clipboard

Failed to compile asm policy.rego/policy.wasm

Open pavolloffay opened this issue 4 years ago • 0 comments

I get the following error compiling a file:

[ERROR] Error in command 'compile': Unrecognized instruction: global.get
asmble.io.IoErr$UnrecognizedInstruction: Unrecognized instruction: global.get
	at asmble.io.SExprToAst.toInstrs(SExprToAst.kt:381)
	at asmble.io.SExprToAst.toInstrs$default(SExprToAst.kt:370)
	at asmble.io.SExprToAst.toFunc(SExprToAst.kt:251)
	at asmble.io.SExprToAst.toModule(SExprToAst.kt:589)
	at asmble.io.SExprToAst.toCmdMaybe(SExprToAst.kt:99)
	at asmble.io.SExprToAst.toScript(SExprToAst.kt:864)
	at asmble.cli.Translate.inToAst(Translate.kt:66)
	at asmble.cli.Compile.run(Compile.kt:54)
	at asmble.cli.Compile.run(Compile.kt:10)
	at asmble.cli.Command.runWithArgs(Command.kt:17)
	at asmble.cli.MainKt.main(Main.kt:31)

policy.wast.txt

mv policy.wast.txt policy.wast
asmble compile -log info policy.wast MyClass

The wast file is https://github.com/open-policy-agent/opa-docker-authz/blob/master/example.rego and compiled to wast

opa build -t wasm -e example/allow example.rego
tar xvf bundle.tar.gz
wasm2wat policy.wasm
asmble compile -log info policy.wast MyClass

pavolloffay avatar Jan 22 '21 16:01 pavolloffay