Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to compile asm policy.rego/policy.wasm #39

Open
pavolloffay opened this issue Jan 22, 2021 · 0 comments
Open

Failed to compile asm policy.rego/policy.wasm #39

pavolloffay opened this issue Jan 22, 2021 · 0 comments

Comments

@pavolloffay
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant