diodechain / diode_server

Diode Server
https://diode.io
Other
39 stars 9 forks source link

New Ubuntu Server 18.04 Dependencies Issue on Compile #21

Closed jimthedj65 closed 7 months ago

jimthedj65 commented 3 years ago

Hi guys the previous errors are resolved and now I have a dependency error when compiling elixir.diode

as always all assistance greatly appreciated

Build details Ubuntu LTS 18.04 minimal server install GNU Make 4.1 gcc version 7.5.0 g++ | >= 4:7.2 gcc | >= 4:7.2 dpkg -s libboost-dev | grep Version Version: 1.65.1.0ubuntu1 autoconf (GNU Autoconf) 2.69 Erlang/OTP 23 [erts-11.1.7] [source] [64-bit] [smp:32:32] [ds:32:32:10] [async-threads:1] [hipe] Elixir 1.11.2 (compiled with Erlang/OTP 23) dpkg -s libtool-bin | grep 'Version' Version: 2.4.6-2 dpkg -s libboost-dev | grep 'Version' Version: 1.65.1.0ubuntu1 dpkg -s build-essential | grep 'Version' Version: 12.4ubuntu1

Error: Generated plug_cowboy app **==> Elixir.Diode Unchecked dependencies for environment dev:


Build Begins mix deps.get Could not find Hex, which is needed to build dependency :benchee Shall I install Hex? (if running non-interactively, use "mix local.hex --force") [Yn] Y

warning: variable "package" does not exist and is being expanded to "package()", please use parentheses to remove the ambiguity or change the variable name /home/pxcghost/diode_server_ex/deps/mix_erlang_tasks/mix.exs:10: MixErlangTasks.Mixfile.project/0

==> mix_erlang_tasks Compiling 4 files (.ex) warning: :ct.run_test/1 defined in application :common_test is used by the current application but the current application does not directly depend on :common_test. To fix this, you must do one of:

  1. If :common_test is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :common_test is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :common_test, you may optionally skip this warning by adding [xref: [exclude: :ct]] to your "def project" in mix.exs

    lib/mix/tasks/ct.ex:30: Mix.Tasks.Ct.run/1

warning: :edoc.application/3 defined in application :edoc is used by the current application but the current application does not directly depend on :edoc. To fix this, you must do one of:

  1. If :edoc is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :edoc is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :edoc, you may optionally skip this warning by adding [xref: [exclude: :edoc]] to your "def project" in mix.exs

    lib/mix/tasks/edoc.ex:8: Mix.Tasks.Edoc.run/1

warning: :eunit.test/2 defined in application :eunit is used by the current application but the current application does not directly depend on :eunit. To fix this, you must do one of:

  1. If :eunit is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :eunit is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :eunit, you may optionally skip this warning by adding [xref: [exclude: :eunit]] to your "def project" in mix.exs

    lib/mix/tasks/eunit.ex:32: Mix.Tasks.Eunit.run/1

warning: String.to_char_list/1 is deprecated. Use String.to_charlist/1 instead Found at 2 locations: lib/util.ex:13: MixErlangTasks.Util.compile_files/2 lib/util.ex:14: MixErlangTasks.Util.compile_files/2

warning: String.to_char_list/1 is deprecated. Use String.to_charlist/1 instead Found at 2 locations: lib/mix/tasks/ct.ex:31: Mix.Tasks.Ct.run/1 lib/mix/tasks/ct.ex:32: Mix.Tasks.Ct.run/1

Generated mix_erlang_tasks app ==> Elixir.Diode Could not find "rebar3", which is needed to build dependency :esqlite I can install a local copy which is just used by Mix Shall I install rebar3? (if running non-interactively, use "mix local.rebar --force") [Yn] Y

==> decimal Compiling 1 file (.ex) Generated decimal app warning: String.strip/1 is deprecated. Use String.trim/1 instead /home/pxcghost/diode_server_ex/deps/poison/mix.exs:4: Poison.Mixfile

==> poison Compiling 4 files (.ex) warning: Integer.to_char_list/2 is deprecated. Use Integer.to_charlist/2 instead lib/poison/encoder.ex:173: Poison.Encoder.BitString.seq/1

Generated poison app ===> Compiling keccakf1600 make: Entering directory '/home/pxcghost/diode_server_ex/deps/keccakf1600/c_src' C decaf-utils.c C keccakf1600_nif.c C shake.c In file included from /usr/include/assert.h:35:0, from /home/pxcghost/diode_server_ex/deps/keccakf1600/c_src/shake.c:43: /usr/include/features.h:184:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]

warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"

^~~ LD keccakf1600.so make: Leaving directory '/home/pxcghost/diode_server_ex/deps/keccakf1600/c_src' ==> while Compiling 1 file (.ex) Generated while app ==> elixir_make Compiling 1 file (.ex) Generated elixir_make app ==> earmark Compiling 1 file (.yrl) Compiling 2 files (.xrl) Compiling 3 files (.erl) Compiling 32 files (.ex) Generated earmark app warning: Mix.Local.path_for/1 is deprecated. Use Mix.path_for/1 instead mix.exs:68: MakeupElixir.Mixfile.build_docs/1

==> makeup_elixir Compiling 4 files (.ex) Compiling lib/makeup/lexers/elixir_lexer.ex (it's taking more than 10s) Generated makeup_elixir app ==> ex_doc Compiling 20 files (.ex) warning: :crypto.strong_rand_bytes/1 defined in application :crypto is used by the current application but the current application does not directly depend on :crypto. To fix this, you must do one of:

  1. If :crypto is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :crypto is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :crypto, you may optionally skip this warning by adding [xref: [exclude: :crypto]] to your "def project" in mix.exs

    lib/ex_doc/formatter/epub.ex:166: ExDoc.Formatter.EPUB.uuid4/0

Generated ex_doc app ==> debouncer Compiling 1 file (.ex) warning: Supervisor.Spec.worker/2 is deprecated. Use the new child specifications outlined in the Supervisor module instead lib/debouncer.ex:135: Debouncer.start/2

Generated debouncer app warning: redefining module Profiler.MixProject (current version defined in memory) /home/pxcghost/diode_server_ex/deps/profiler/mix.exs:1

===> Compiling cowlib src/cow_multipart.erl:392: Warning: crypto:rand_bytes/1 is removed; use crypto:strong_rand_bytes/1 instead

===> Compiling cowboy src/cowboy_handler.erl:87: Warning: erlang:get_stacktrace/0 is deprecated and will be removed in OTP 24; use use the new try/catch syntax for retrieving the stack backtrace src/cowboy_handler.erl:116: Warning: erlang:get_stacktrace/0 is deprecated and will be removed in OTP 24; use use the new try/catch syntax for retrieving the stack backtrace src/cowboy_handler.erl:235: Warning: erlang:get_stacktrace/0 is deprecated and will be removed in OTP 24; use use the new try/catch syntax for retrieving the stack backtrace src/cowboy_handler.erl:290: Warning: erlang:get_stacktrace/0 is deprecated and will be removed in OTP 24; use use the new try/catch syntax for retrieving the stack backtrace

src/cowboy_rest.erl:69: Warning: erlang:get_stacktrace/0 is deprecated and will be removed in OTP 24; use use the new try/catch syntax for retrieving the stack backtrace src/cowboy_rest.erl:1006: Warning: erlang:get_stacktrace/0 is deprecated and will be removed in OTP 24; use use the new try/catch syntax for retrieving the stack backtrace

src/cowboy_websocket.erl:147: Warning: erlang:get_stacktrace/0 is deprecated and will be removed in OTP 24; use use the new try/catch syntax for retrieving the stack backtrace src/cowboy_websocket.erl:645: Warning: erlang:get_stacktrace/0 is deprecated and will be removed in OTP 24; use use the new try/catch syntax for retrieving the stack backtrace src/cowboy_websocket.erl:755: Warning: erlang:get_stacktrace/0 is deprecated and will be removed in OTP 24; use use the new try/catch syntax for retrieving the stack backtrace

==> mime Compiling 2 files (.ex) Generated mime app ==> sqlitex Compiling 9 files (.ex) Generated sqlitex app ==> plug_crypto Compiling 5 files (.ex) warning: System.stacktrace/0 is deprecated, use STACKTRACE instead lib/plug/crypto/key_generator.ex:56

warning: System.stacktrace/0 is deprecated, use STACKTRACE instead lib/plug/crypto/message_verifier.ex:24

warning: System.stacktrace/0 is deprecated, use STACKTRACE instead lib/plug/crypto/message_verifier.ex:33

warning: System.stacktrace/0 is deprecated, use STACKTRACE instead lib/plug/crypto/message_encryptor.ex:37

warning: System.stacktrace/0 is deprecated, use STACKTRACE instead lib/plug/crypto/message_encryptor.ex:47

Generated plug_crypto app ==> plug Compiling 1 file (.erl) Compiling 40 files (.ex) warning: System.stacktrace/0 is deprecated, use STACKTRACE instead lib/plug/conn/wrapper_error.ex:23

Generated plug app ==> plug_cowboy Compiling 5 files (.ex) warning: System.stacktrace/0 is deprecated, use STACKTRACE instead lib/plug/cowboy/handler.ex:24

warning: System.stacktrace/0 is deprecated, use STACKTRACE instead lib/plug/cowboy/handler.ex:30

warning: System.stacktrace/0 is deprecated, use STACKTRACE instead lib/plug/cowboy/handler.ex:35

Generated plug_cowboy app **==> Elixir.Diode Unchecked dependencies for environment dev:

$hex

Command 'hex' not found, but can be installed with:

sudo apt install basez

$mix deps.get Resolving Hex dependencies... Dependency resolution completed: Unchanged: benchee 1.0.1 cowboy 1.1.2 cowlib 1.0.2 debouncer 0.1.3 decimal 1.8.1 deep_merge 1.0.0 earmark 1.4.4 elixir_make 0.6.0 esqlite 0.4.1 ex_doc 0.21.3 libsecp256k1 0.1.10 makeup 1.0.1 makeup_elixir 0.14.0 mime 1.3.1 mix_erlang_tasks 0.1.0 nimble_parsec 0.5.3 plug 1.10.0 plug_cowboy 1.0.0 plug_crypto 1.1.2 poison 3.1.0 profiler 0.2.2 ranch 1.3.2 while 0.2.2

jimthedj65 commented 3 years ago

I have checked and can confirm that ebin is not present "_build/dev/lib/profiler/ebin/profiler.app"

dominicletz commented 3 years ago

Interesting issue, it seems when you call explicitly

mix deps.compile profiler

it will work. Not clear to me yet why this doesn't happen automatically. Seems to work for all other dependencies...

jimthedj65 commented 3 years ago

ok thanks dominic I will try that

jimthedj65 commented 3 years ago

Hi dominic finally got time to give this another go and I do get a different error with the latest build today

mix compile
===> Fetching pc v1.13.0
===> Version cached at /home/pxcghost/.cache/rebar3/hex/hexpm/packages/pc-1.13.0.tar is up to date, reusing it
escript: exception error: undefined function erlang:get_stacktrace/0
  in function  rebar3:main/1 (/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
** (Mix) Could not compile dependency :esqlite, "/home/pxcghost/.mix/rebar3 bare compile --paths /home/pxcghost/diode_server/_build/dev/lib/*/ebin" command failed. You can recompile this dependency with "mix deps.compile esqlite", update it with "mix deps.update esqlite" or clean it with "mix deps.clean esqlite"

when running mix deps.compile profiler the first time I got

mix deps.compile profiler
==> profiler
Compiling 1 file (.ex)
warning: :fprof.analyse/1 is undefined (module :fprof is not available or is yet to be defined)
  lib/profiler.ex:244: Profiler.fprof/2

warning: :fprof.profile/0 is undefined (module :fprof is not available or is yet to be defined)
  lib/profiler.ex:243: Profiler.fprof/2

warning: :fprof.trace/1 is undefined (module :fprof is not available or is yet to be defined)
Found at 2 locations:
  lib/profiler.ex:240: Profiler.fprof/2
  lib/profiler.ex:242: Profiler.fprof/2

when I ran it a second time it just exited to a blank line with no output.

jimthedj65 commented 3 years ago

I also tried the docker build which had a different errors

== Compilation error in file lib/rlp.ex == ** (CompileError) lib/rlp.ex:44: cannot find or invoke local is_struct/1 inside guard. Only macros can be invoked in a guard and they must be defined before their invocation. Called as: is_struct(struct)

The command '/bin/sh -c mix compile' returned a non-zero code: 1

jimthedj65 commented 3 years ago

full output below `sudo ./docker Sending build context to Docker daemon 1.819MB Step 1/8 : FROM elixir:1.9 ---> 8ba58ec8810b Step 2/8 : RUN apt-get update && apt-get install -y libboost-dev libboost-system-dev ---> Using cache ---> 2cb10347d9f4 Step 3/8 : ENV MIX_ENV=prod PORT=8080 ---> Using cache ---> 27ffb4a48f40 Step 4/8 : COPY mix.* . ---> Using cache ---> 55a11844a968 Step 5/8 : RUN mix local.hex --force && mix local.rebar && mix deps.get && mix deps.compile ---> Using cache ---> ac4756e6907d Step 6/8 : COPY . . ---> 0dfa6eda59dd Step 7/8 : RUN mix compile ---> Running in 63e1e7d4ef26 make -j4 -C evm make[1]: Entering directory '/evm' g++ -c -std=c++17 -I. -O2 -g -Wall -Wno-unknown-pragmas libaleth-interpreter/VMOpt.cpp -o libaleth-interpreter/VMOpt.o g++ -c -std=c++17 -I. -O2 -g -Wall -Wno-unknown-pragmas libaleth-interpreter/VM.cpp -o libaleth-interpreter/VM.o g++ -c -std=c++17 -I. -O2 -g -Wall -Wno-unknown-pragmas libaleth-interpreter/VMCalls.cpp -o libaleth-interpreter/VMCalls.o g++ -c -std=c++17 -I. -O2 -g -Wall -Wno-unknown-pragmas intx/div.cpp -o intx/div.o gcc -c -I. -O2 -g -Wall -Wno-unknown-pragmas evmc/instruction_metrics.c -o evmc/instruction_metrics.o gcc -c -I. -O2 -g -Wall -Wno-unknown-pragmas ethash/keccak.c -o ethash/keccak.o gcc -c -I. -O2 -g -Wall -Wno-unknown-pragmas ethash/keccakf1600.c -o ethash/keccakf1600.o g++ -c -std=c++17 -I. -O2 -g -Wall -Wno-unknown-pragmas main.cpp -o main.o g++ -c -std=c++17 -I. -O2 -g -Wall -Wno-unknown-pragmas host.cpp -o host.o g++ libaleth-interpreter/VMOpt.o libaleth-interpreter/VM.o libaleth-interpreter/VMCalls.o intx/div.o evmc/instruction_metrics.o ethash/keccak.o ethash/keccakf1600.o main.o host.o -lboost_system -o evm make[1]: Leaving directory '/evm' Compiling 77 files (.ex)

== Compilation error in file lib/rlp.ex == ** (CompileError) lib/rlp.ex:44: cannot find or invoke local is_struct/1 inside guard. Only macros can be invoked in a guard and they must be defined before their invocation. Called as: is_struct(struct)

The command '/bin/sh -c mix compile' returned a non-zero code: 1`

dominicletz commented 3 years ago

Hey @jimthedj65 try running ./docker with the latest master. This is now a docker based build that should do it on nearly any environment.

jimthedj65 commented 3 years ago

thanks Dominic the docker file seems to run, obviously the directory data_prod needs to be added to the docker run command. so far running the node which has built about 10 Gig of data so far