for-GET / katt

KATT (Klarna API Testing Tool) is an HTTP-based API testing tool for Erlang.
https://github.com/for-GET/katt
Apache License 2.0
119 stars 16 forks source link

Katt compile error due to get_stacktrace error in meck #68

Closed tobiiasl closed 6 years ago

tobiiasl commented 6 years ago

Katt version: 1.5.4-29-gc418814

When compiling Katt on our build servers the build fails:

[10:12:37][/src Deps] Compiled src/meck_cover.erl
[10:12:37][/src Deps] /src/support/katt/deps/meck/src/meck_code_gen.erl:185: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace
[10:12:37][/src Deps] Compiling /src/support/katt/deps/meck/src/meck_code_gen.erl failed:
[10:12:37][/src Deps] ERROR: compile failed while processing /src/support/katt/deps/meck: rebar_abort
[10:12:37][/src Deps] make[1]: *** [Makefile:111: compile] Error 1

NB: For some reason I cannot reproduce the problem on my Mac. Compiling meck works fine.

Here is a longer excerpt from the log file from the build server.

[10:11:50][/src Deps] ==> katt (get-deps)
[10:11:50][/src Deps] Pulling hackney from {git,"git://github.com/benoitc/hackney.git",
[10:11:50][/src Deps] {tag,"1.6.0"}}
[10:11:50][/src Deps] Cloning into 'hackney'...
[10:11:54][/src Deps] Pulling jsx from {git,"git://github.com/talentdeficit/jsx.git",{tag,"2.8.0"}}
[10:11:54][/src Deps] Cloning into 'jsx'...
[10:11:58][/src Deps] Pulling tdiff from {git,"git://github.com/tomas-abrahamsson/tdiff.git",
[10:11:58][/src Deps] {tag,"0.1"}}
[10:11:58][/src Deps] Cloning into 'tdiff'...
[10:11:59][/src Deps] Pulling meck from {git,"git://github.com/eproxus/meck.git",{tag,"0.8.4"}}
[10:11:59][/src Deps] Cloning into 'meck'...
[10:12:01][/src Deps] Pulling neotoma from {git,"git://github.com/seancribbs/neotoma.git",
[10:12:01][/src Deps] {tag,"1.7.3"}}
[10:12:01][/src Deps] Cloning into 'neotoma'...
[10:12:03][/src Deps] ==> hackney (get-deps)
[10:12:03][/src Deps] Pulling idna from {git,"https://github.com/benoitc/erlang-idna",{tag,"1.2.0"}}
[10:12:03][/src Deps] Cloning into 'idna'...
[10:12:09][/src Deps] Pulling mimerl from {git,"https://github.com/benoitc/mimerl",{tag,"1.0.2"}}
[10:12:09][/src Deps] Cloning into 'mimerl'...
[10:12:13][/src Deps] Pulling certifi from {git,"https://github.com/certifi/erlang-certifi",
[10:12:13][/src Deps] {tag,"0.4.0"}}
[10:12:13][/src Deps] Cloning into 'certifi'...
[10:12:16][/src Deps] Pulling metrics from {git,"https://github.com/benoitc/erlang-metrics",
[10:12:16][/src Deps] {tag,"1.0.1"}}
[10:12:16][/src Deps] Cloning into 'metrics'...
[10:12:17][/src Deps] Pulling ssl_verify_fun from {git,"https://github.com/deadtrickster/ssl_verify_fun.erl",
[10:12:17][/src Deps] {tag,"1.1.0"}}
[10:12:17][/src Deps] Cloning into 'ssl_verify_fun'...
[10:12:22][/src Deps] ==> idna (get-deps)
[10:12:22][/src Deps] ==> mimerl (get-deps)
[10:12:22][/src Deps] ==> certifi (get-deps)
[10:12:22][/src Deps] ==> metrics (get-deps)
[10:12:22][/src Deps] ==> ssl_verify_fun (get-deps)
[10:12:22][/src Deps] ==> jsx (get-deps)
[10:12:22][/src Deps] ==> tdiff (get-deps)
[10:12:22][/src Deps] ==> meck (get-deps)
[10:12:22][/src Deps] ==> neotoma (get-deps)
[10:12:22][/src Deps] ==> idna (compile)
[10:12:23][/src Deps] Compiled src/idna.erl
[10:12:23][/src Deps] Compiled src/idna_ucs.erl
[10:12:23][/src Deps] Compiled src/idna_unicode.erl
[10:12:24][/src Deps] Compiled src/punycode.erl
[10:12:24][/src Deps] Compiled src/idna_unicode_data2.erl
[10:12:31][/src Deps] Compiled src/idna_unicode_data1.erl
[10:12:31][/src Deps] ==> mimerl (compile)
[10:12:32][/src Deps] Compiled src/mimerl.erl
[10:12:32][/src Deps] ==> certifi (compile)
[10:12:34][/src Deps] Compiled src/certifi.erl
[10:12:35][/src Deps] Compiled src/certifi_cacerts.erl
[10:12:35][/src Deps] Compiled src/certifi_weakcerts.erl
[10:12:35][/src Deps] ==> metrics (compile)
[10:12:35][/src Deps] Compiled src/metrics_dummy.erl
[10:12:35][/src Deps] Compiled src/metrics_exometer.erl
[10:12:35][/src Deps] Compiled src/metrics.erl
[10:12:35][/src Deps] Compiled src/metrics_folsom.erl
[10:12:35][/src Deps] ==> ssl_verify_fun (compile)
[10:12:35][/src Deps] Compiled src/ssl_verify_fingerprint.erl
[10:12:36][/src Deps] Compiled src/ssl_verify_hostname.erl
[10:12:36][/src Deps] ==> hackney (compile)
[10:12:36][/src Deps] Compiled src/hackney_app.erl
[10:12:36][/src Deps] Compiled src/hackney_bstr.erl
[10:12:36][/src Deps] Compiled src/hackney_cookie.erl
[10:12:36][/src Deps] Compiled src/hackney_connect.erl
[10:12:36][/src Deps] Compiled src/hackney_date.erl
[10:12:36][/src Deps] Compiled src/hackney.erl
[10:12:36][/src Deps] Compiled src/hackney_headers.erl
[10:12:36][/src Deps] Compiled src/hackney_http_connect.erl
[10:12:36][/src Deps] Compiled src/hackney_http.erl
[10:12:36][/src Deps] Compiled src/hackney_manager.erl
[10:12:36][/src Deps] Compiled src/hackney_pool_handler.erl
[10:12:36][/src Deps] /src/support/katt/deps/hackney/src/hackney_multipart.erl:271: Warning: random:uniform/1: the 'random' module is deprecated; use the 'rand' module instead
[10:12:36][/src Deps] Compiled src/hackney_multipart.erl
[10:12:36][/src Deps] /src/support/katt/deps/hackney/src/hackney_pool.erl:213: Warning: call to crypto:rand_bytes/1 will fail, since it was removed in 20.0; use crypto:strong_rand_bytes/1
[10:12:36][/src Deps] Compiled src/hackney_pool.erl
[10:12:36][/src Deps] Compiled src/hackney_socks5.erl
[10:12:36][/src Deps] Compiled src/hackney_ssl_transport.erl
[10:12:36][/src Deps] Compiled src/hackney_response.erl
[10:12:36][/src Deps] Compiled src/hackney_sup.erl
[10:12:36][/src Deps] Compiled src/hackney_tcp_transport.erl
[10:12:36][/src Deps] Compiled src/hackney_request.erl
[10:12:36][/src Deps] /src/support/katt/deps/hackney/src/hackney_stream.erl:35: Warning: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace
[10:12:36][/src Deps] Compiled src/hackney_stream.erl
[10:12:36][/src Deps] Compiled src/hackney_trace.erl
[10:12:36][/src Deps] Compiled src/hackney_util.erl
[10:12:36][/src Deps] Compiled src/hackney_url.erl
[10:12:36][/src Deps] ==> jsx (compile)
[10:12:36][/src Deps] Compiled src/jsx_consult.erl
[10:12:36][/src Deps] Compiled src/jsx.erl
[10:12:36][/src Deps] Compiled src/jsx_encoder.erl
[10:12:36][/src Deps] Compiled src/jsx_config.erl
[10:12:36][/src Deps] Compiled src/jsx_to_json.erl
[10:12:36][/src Deps] Compiled src/jsx_to_term.erl
[10:12:36][/src Deps] Compiled src/jsx_verify.erl
[10:12:36][/src Deps] Compiled src/jsx_parser.erl
[10:12:37][/src Deps] Compiled src/jsx_decoder.erl
[10:12:37][/src Deps] ==> tdiff (compile)
[10:12:37][/src Deps] /src/support/katt/deps/tdiff/src/tdiff_benchmark.erl:22: Warning: export_all flag enabled - all functions will be exported
[10:12:37][/src Deps] /src/support/katt/deps/tdiff/src/tdiff_benchmark.erl:34: Warning: random:seed0/0: the 'random' module is deprecated; use the 'rand' module instead
[10:12:37][/src Deps] /src/support/katt/deps/tdiff/src/tdiff_benchmark.erl:76: Warning: random:uniform/0: the 'random' module is deprecated; use the 'rand' module instead
[10:12:37][/src Deps] /src/support/katt/deps/tdiff/src/tdiff_benchmark.erl:90: Warning: random:uniform/1: the 'random' module is deprecated; use the 'rand' module instead
[10:12:37][/src Deps] /src/support/katt/deps/tdiff/src/tdiff_benchmark.erl:96: Warning: random:uniform/1: the 'random' module is deprecated; use the 'rand' module instead
[10:12:37][/src Deps] /src/support/katt/deps/tdiff/src/tdiff_benchmark.erl:153: Warning: random:seed/3: the 'random' module is deprecated; use the 'rand' module instead
[10:12:37][/src Deps] Compiled src/tdiff_benchmark.erl
[10:12:37][/src Deps] Compiled src/tdiff.erl
[10:12:37][/src Deps] Compiled src/tdiff_debug.erl
[10:12:37][/src Deps] ==> meck (compile)
[10:12:37][/src Deps] Compiled src/meck_args_matcher.erl
[10:12:37][/src Deps] Compiled src/meck_code.erl
[10:12:37][/src Deps] Compiled src/meck_cover.erl
[10:12:37][/src Deps] /src/support/katt/deps/meck/src/meck_code_gen.erl:185: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace
[10:12:37][/src Deps] Compiling /src/support/katt/deps/meck/src/meck_code_gen.erl failed:
[10:12:37][/src Deps] ERROR: compile failed while processing /src/support/katt/deps/meck: rebar_abort
[10:12:37][/src Deps] make[1]: *** [Makefile:111: compile] Error 1
[10:12:37][/src Deps] make: *** [Makefile:79: deps] Error 2
[10:12:37][/src Deps] *** Unmount system ***
tobiiasl commented 6 years ago

Tested to update to the latest version of Katt (1.6.0-rc-2-gb13e705). Same problem.

andreineculau commented 6 years ago

I think you cannot reproduce locally because you're not compiling meck at all (meck is only compiled in dev mode) i.e. this should fail on your computer too rm -rf deps; make .rebar/DEV_MODE; make

fixed by upgrading meck in https://github.com/for-GET/katt/commit/df167bd972590992d28dc4fb96b48f115be5d966

tobiiasl commented 6 years ago

Thanks a lot for the swift fix! It worked out fine.

FYI: I had got it to compile locally but did not get the same error:

~/git/firecloud/firecloud_foo/support/katt$ make get-deps compile
/Users/tobiaslindgren/git/firecloud/firecloud_foo/support/katt/rebar get-deps
==> idna (get-deps)
==> mimerl (get-deps)
==> certifi (get-deps)
==> metrics (get-deps)
==> ssl_verify_fun (get-deps)
==> hackney (get-deps)
==> jsx (get-deps)
==> tdiff (get-deps)
==> neotoma (get-deps)
==> katt (get-deps)
Pulling meck from {git,"git://github.com/eproxus/meck.git",{tag,"0.8.4"}}
Cloning into 'meck'...
==> meck (get-deps)
/Users/tobiaslindgren/git/firecloud/firecloud_foo/support/katt/rebar compile
==> idna (compile)
==> mimerl (compile)
==> certifi (compile)
==> metrics (compile)
==> ssl_verify_fun (compile)
==> hackney (compile)
==> jsx (compile)
==> tdiff (compile)
==> meck (compile)
Compiled src/meck.erl
Compiled src/meck_ret_spec.erl
Compiled src/meck_expect.erl
Compiled src/meck_util.erl
Compiled src/meck_history.erl
Compiled src/meck_code.erl
Compiled src/meck_matcher.erl
Compiled src/meck_cover.erl
Compiled src/meck_args_matcher.erl
Compiled src/meck_code_gen.erl
Compiled src/meck_proc.erl
==> neotoma (compile)
==> katt (compile)
Compiled src/katt_blueprint.erl

I double checked with rm -rf deps; make .rebar/DEV_MODE; make which also worked fine.

I also tried to create a branch on this github repo but did not have enough access rights to push.

Anyway, it works now so no need to dig further into this. Thanks again!