aeternity / aesophia_cli Goto Github PK
View Code? Open in Web Editor NEWAeternity Sophia CLI
License: ISC License
Aeternity Sophia CLI
License: ISC License
Hello, I tried to build the cli following the instructions but I get a build error:
environment:
✦ ➜ DEBUG=1 ./rebar3 report escriptize
===> Expanded command sequence to be run: [{default,report}]
===> Provider: {default,report}
Rebar3 report
version 3.9.1
generated at 2019-10-08T12:41:14+00:00
=================
Please submit this along with your issue at https://github.com/erlang/rebar3/issues (and feel free to edit out private information, if any)
-----------------
Task: escriptize
Entered as:
escriptize
-----------------
Operating System: x86_64-pc-linux-gnu
ERTS: Erlang/OTP 21 [erts-10.2.4] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]
Root Directory: /usr/lib/erlang
Library directory: /usr/lib/erlang/lib
-----------------
Loaded Applications:
bbmustache: 1.6.0
certifi: 2.3.1
cf: 0.2.2
compiler: 7.3.1
crypto: 4.4
cth_readable: 1.4.3
dialyzer: 3.3.1
edoc: 0.9.4
erlware_commons: 1.3.1
eunit: 2.3.7
eunit_formatters: 0.5.0
getopt: 1.0.1
hipe: 3.18.2
inets: 7.0.5
kernel: 6.2
providers: 1.7.0
public_key: 1.6.4
relx: 3.27.0+build.1035.refebdcebf
sasl: 3.3
snmp: 5.2.12
ssl_verify_fun: 1.1.3
stdlib: 3.7.1
syntax_tools: 2.1.6
tools: 3.0.2
-----------------
Escript path: [...]/aeternity/aesophia_cli/rebar3
Providers:
app_discovery as clean compile compile cover ct deps dialyzer do edoc escriptize eunit get-deps help install install_deps list lock new path pkgs release relup report repos shell state tar tree unlock update upgrade upgrade upgrade version xref
stack trace:
make: Nothing to be done for 'sources'.
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: undef
===> Stack trace to the error location:
[{leex,file,
[".../aeternity/aesophia_cli/_build/default/lib/aebytecode/src/aeb_fate_asm_scan.xrl",
[{return,true}]],
[]},
{rebar_compiler_xrl,compile,4,
[{file,"/home/dev/work/rebar3/src/rebar_compiler_xrl.erl"},
{line,38}]},
{rebar_compiler,compile_each,5,
[{file,"/home/dev/work/rebar3/src/rebar_compiler.erl"},
{line,85}]},
{rebar_compiler,'-compile_all/2-fun-1-',2,
[{file,"/home/dev/work/rebar3/src/rebar_compiler.erl"},
{line,53}]},
{lists,foreach,2,[{file,"lists.erl"},{line,1338}]},
{rebar_compiler,compile_all,2,
[{file,"/home/dev/work/rebar3/src/rebar_compiler.erl"},
{line,52}]},
{rebar_prv_compile,compile,3,
[{file,"/home/dev/work/rebar3/src/rebar_prv_compile.erl"},
{line,165}]},
{rebar_prv_compile,'-copy_and_build_apps/3-lc$^0/1-0-',3,
[{file,"/home/dev/work/rebar3/src/rebar_prv_compile.erl"},
{line,101}]}]
===> When submitting a bug report, please include the output of `rebar3 report "your command"`
Error.aes
contract Foo =
entrypoint getArg(x : bar) = x
entrypoint getArg(x : int) = baz
$ aesophia_cli ./Error.aes
Type error in './Error.aes' at line 3, col 3:
Duplicate definitions of `getArg` at
- line 2, column 3
- line 3, column 3
Type error in './Error.aes' at line 3, col 32:
Unbound variable `baz`
$ aesophia_cli --create_json_aci ./Error.aes
Type error at line 3, col 3:
Duplicate definitions of `getArg` at
- line 2, column 3
- line 3, column 3
Type error at line 3, col 32:
Unbound variable `baz`
$ aesophia_cli --version
Sophia compiler version 7.0.1
So, in the case of --create_json_aci
the filename is missed in error messages.
Compiler warnings were introduced in this PR aeternity/aesophia#346
I'm investigating the ability to run this cli in npm package. Seems that the last release build can't run in Windows
What needs to be installed to run this cli? Proposing to add this info to readme.md or so.
➜ test cat Test.aes
contract RemoteTest =
entrypoint test_remote : (int) => int
main contract Test =
entrypoint test_empty () = 1
➜ test ./aesophia_cli --create_json_aci Test.aes
[{"contract":{"functions":[{"arguments":[{"name":"_1","type":"int"}],"name":"test_remote","payable":false,"returns":"int","stateful":false}],"kind":"contract_child","name":"RemoteTest","payable":false,"type_defs":[]}},{"contract":{"functions":[{"arguments":[],"name":"test_empty","payable":false,"returns":"int","stateful":false}],"kind":"contract_main","name":"Test","payable":false,"type_defs":[]}}]
➜ test ./aesophia_cli Test.aes
Code generation error in 'Test.aes' at line 2, col 16:
Missing definition of function 'test_remote'.
The issue should be pretty clear from the example above. I'd expect ACI generation to abort with the same error.
Dear All,
aesophia_cli is not working on the Ubuntu 21.04 machine. I have installed rebar and its dependencies. Following are the machine specifications. Please let me know if you need any further details.
https://github.com/aeternity/aesophia_cli/tree/master/priv/bin
Are you sure that you need to store previous versions builds in repo? They are easily accessible by switching to specific tag, like: https://github.com/aeternity/aesophia_cli/blob/v6.0.0/aesophia_cli
I wonder what's the reason to include newline in the compiler error output? This is a bit harsh to parse by other tools and would be even more ambiguous if multiple error messages are printed.
aesophia_cli contracts/Test.aes --call_result 'cb_nwHBjRJniwzQdedLvREM7c666OYO4fCpL0ODpwrvd0ZFgHoNJdLoj/Ez5LMLGE79H9gUWeiXGA==' --call_result_fun test_bls12_381_fp
Data error:
Cannot translate FATE value {bytes,<<141,18,103,139,12,208,117,231,75,189,17,
12,237,206,186,232,230,14,225,240,169,47,
67,131,167,10,239,119,70,69,128,122,13,
37,210,232,143,241,51,228,179,11,24,78,
253,31,216,20>>}
of Sophia type MCL_BLS12_381.fp
the function is entrypoint test_bls12_381_fp(a: int) = BLS12_381.int_to_fp(a)
it was called with 3336208025895282801467121042590356419234644692143882069381168599475053878258325423048715471169591881823262687764052 IIRC
Hello Team,
I am facing the following issues while I am trying to build the aesophia_cli tools on my MacOS 10.13.6 environment as per the steps mentioned in the README. Could you please help to resolve this issue. Looking forward to hearing from you!
Gokuls-MacBook-Air:aesophia_cli gokulalex$ ./rebar3 escriptize
===> Verifying dependencies...
=WARNING REPORT==== 25-Dec-2021::13:22:31.401915 ===
Description: "Authenticity is not established by certificate path validation"
Reason: "Option {verify, verify_peer} and cacertfile/cacerts is missing"
===> Fetching aeserialization ({git,
"https://github.com/aeternity/aeserialization.git",
{ref,
"58e34ae7b5abfcc54f505ea8d57183d04f67120e"}})
===> Fetching aesophia ({git,
"https://github.com/aeternity/aesophia.git",
{ref,
"5ad5270e381f6e810d7b8b5cdc168d283e7a90bb"}})
===> Fetching eblake2 ({pkg,<<"eblake2">>,<<"1.0.0">>})
===> Downloaded package, caching at /Users/gokulalex/.cache/rebar3/hex/hexpm/packages/eblake2-1.0.0.tar
escript: exception error: undefined function erlang:get_stacktrace/0
in function rebar3:main/1 (/home/dev/work/rebar3/src/rebar3.erl, line 72)
in call from escript:run/2 (escript.erl, line 750)
in call from escript:start/1 (escript.erl, line 277)
in call from init:start_em/1
in call from init:do_boot/3
--validate
argument works fine if my contract doesn't have includes, but it fails if it has.
Includes.aes
include "Library.aes"
contract Includes =
entrypoint test(x: int): int = Library.sum(x, 4)
Library.aes
namespace Library =
function sum(x: int, y: int): int = x + y
$ aesophia_cli ./Includes.aes
cb_+JNGA6B51l49GY6JJ6qb/jroQydox6vWgqENgx/qdLdRje0rvsC4Zrg4/kTWRB8ANwA3ABoOgj8BAz/+TbeAOQI3AgcHBxQUAAIA/pKLIDYANwEHBwwDCAwBAAQDEU23gDmoLwMRRNZEHxFpbml0EU23gDkxLkxpYnJhcnkuc3VtEZKLIDYRdGVzdIIvAIU3LjAuMQBZCB3I
$ aesophia_cli ./Includes.aes --validate cb_+JNGA6B51l49GY6JJ6qb/jroQydox6vWgqENgx/qdLdRje0rvsC4Zrg4/kTWRB8ANwA3ABoOgj8BAz/+TbeAOQI3AgcHBxQUAAIA/pKLIDYANwEHBwwDCAwBAAQDEU23gDmoLwMRRNZEHxFpbml0EU23gDkxLkxpYnJhcnkuc3VtEZKLIDYRdGVzdIIvAIU3LjAuMQBZCB3I
Parse error at line 1, col 1:
Couldn't find include file 'Library.aes'
$ aesophia_cli --version
Sophia compiler version 7.0.1
Currently the CLI does not care much about stderr
and stdout
it seems as errors and warnings are dumped to stdout as well. They should go to stderr
instead and the bytecode should go to stdout
without any formatting (i.e. now it also includes Bytecode:
prefix.
Of course the extra formatting can be removed only if options combinations are not supported (i.e. adding --pp_asm also dump the FASM).
--create_json_aci
is a good example how it should work, by dumping only ACI
Please note the exit codes as well, warnings should not lead to error exit code (which is the case right now).
When building on mac, I get
===> Building escript...
cp: ~/DAPPS/Aeternity/aesophia_cli/_build/default/bin/aesophia_cli: No such file or directory
===> Hook for escriptize failed!
Running rebar 3.9.1 on Erlang/OTP 21 Erts 10.3.2
Hi Aeternity Team,
I was trying to build the aesophia_cli package on Ubuntu 21.04. I am getting the following compilation error. Could you please share your guidance to address this issue. Looking forward to hearing from you.
/Apps/ae-apps/aesophia_cli$ rebar3 escriptize
===> Verifying dependencies...
===> Fetching aeserialization (from {git,"https://github.com/aeternity/aeserialization.git",
{ref,"58e34ae7b5abfcc54f505ea8d57183d04f67120e"}})
===> Fetching aesophia (from {git,"https://github.com/aeternity/aesophia.git",
{ref,"5ad5270e381f6e810d7b8b5cdc168d283e7a90bb"}})
===> Fetching eblake2 v1.0.0
===> Downloaded package, caching at /home/semiott/.cache/rebar3/hex/hexpm/packages/eblake2-1.0.0.tar
===> Fetching rebar3_hex v6.11.9
===> Downloaded package, caching at /home/semiott/.cache/rebar3/hex/hexpm/packages/rebar3_hex-6.11.9.tar
===> Fetching hex_core v0.8.4
===> Downloaded package, caching at /home/semiott/.cache/rebar3/hex/hexpm/packages/hex_core-0.8.4.tar
===> Fetching verl v1.0.2
===> Downloaded package, caching at /home/semiott/.cache/rebar3/hex/hexpm/packages/verl-1.0.2.tar
===> Compiling verl
===> Compiling hex_core
===> Compiling rebar3_hex
===> Fetching aebytecode (from {git,"https://github.com/aeternity/aebytecode.git",
{ref,"05dfd7ffc7fb1e07ecc0b1e516da571f56d7dc8f"}})
===> Fetching base58 (from {git,"https://github.com/aeternity/erl-base58.git",
{ref,"60a335668a60328a29f9731b67c4a0e9e3d50ab6"}})
===> Fetching enacl (from {git,"https://github.com/aeternity/enacl.git",
{ref,"26180f42c0b3a450905d2efd8bc7fd5fd9cece75"}})
===> Fetching pc v1.13.0
===> Downloaded package, caching at /home/semiott/.cache/rebar3/hex/hexpm/packages/pc-1.13.0.tar
===> Compiling pc
===> Fetching getopt v1.0.1
===> Downloaded package, caching at /home/semiott/.cache/rebar3/hex/hexpm/packages/getopt-1.0.1.tar
===> Fetching jsx (from {git,"https://github.com/talentdeficit/jsx.git",
{ref,"3074d4865b3385a050badf7828ad31490d860df5"}})
===> Compiling jsx
===> Compiling getopt
===> Compiling eblake2
===> Compiling enacl
===> Compiling /home/semiott/Apps/ae-apps/aesophia_cli/c_src/enacl_nif.c
===> /home/semiott/Apps/ae-apps/aesophia_cli/c_src/enacl_nif.c:5:10: fatal error: sodium.h: No such file or directory
5 | #include <sodium.h>
| ^~~~~~~~~~
compilation terminated.
I've noticed that if I add or remove space chars, the compiled bytecode insignificantly changes. From my perspective, these space chars don't change the contract semantics so the bytecode should be the same. Does it happen because the bytecode contains the hash of the source code? Can it be used somehow?
The current behavior looks odd because if I add space chars to an included file then the bytecode remains the same.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.