rabbitmq-email icon indicating copy to clipboard operation
rabbitmq-email copied to clipboard

Compilation error

Open Ziggizag opened this issue 2 years ago • 9 comments

Hi,

"make" command results in the following error:

Writing file src/smtp_rfc5322_scan.erl, /usr/lib/erlang/lib/parsetools-2.5/include/leexinc.hrl: no such file or directory

Any idea?

Ziggizag avatar Dec 06 '23 14:12 Ziggizag

I don't, because you haven't provided enough information.

  • What operating system?
  • What version of Erlang?
  • What version of make?
  • Provide a complete transcription of what you are doing, starting with cloning this repository. ATTACH the output as a file. I will delete the comment if it is a giant wall of text.

lukebakken avatar Dec 06 '23 15:12 lukebakken

OK - so now it seems it was because I had Erlang but no "dev" version. I have installed erlang-dev and now:

Error: No Makefile to build dependency .../rabbitmq-email/deps/thoas.

I use Ubuntu 22.04 LTS - I am not a compilation expert, sorry. Everything possible is updated to most recent version.

Ziggizag avatar Dec 06 '23 15:12 Ziggizag

And indeed, the output is a giant wall of text...

But it starts with:

output
Evaluating config script "/home/ziggi/varia/rabbitmq-email/.erlang.mk/rebar3/_build/default/lib/rebar/src/rebar.app.src.script"
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling cf
===> Compiling cth_readable
===> Compiling certifi
===> Compiling eunit_formatters
===> Compiling vendor/eunit_formatters/src/eunit_progress.erl failed
vendor/eunit_formatters/src/eunit_progress.erl:none: undefined parse transform 'eunit_striptests'

escript: exception throw: rebar_abort
  in function  rebar_utils:abort/0 (apps/rebar/src/rebar_utils.erl, line 718)
  in call from rebar_parallel:parallel_dispatch/4 (apps/rebar/src/rebar_parallel.erl, line 39)
  in call from rebar_compiler:run/4 (apps/rebar/src/rebar_compiler.erl, line 253)
  in call from lists:foreach_1/2 (lists.erl, line 1686)
  in call from rebar_prv_compile:'-build_rebar3_apps/3-lc$^0/1-0-'/3 (apps/rebar/src/rebar_prv_compile.erl, line 374)
  in call from rebar_prv_compile:build_rebar3_apps/3 (apps/rebar/src/rebar_prv_compile.erl, line 389)
  in call from rebar_prv_compile:run_compilers/4 (apps/rebar/src/rebar_prv_compile.erl, line 192)
  in call from rebar_prv_compile:compile/4 (apps/rebar/src/rebar_prv_compile.erl, line 154)
/home/ziggi/varia/rabbitmq-email/.erlang.mk/rabbitmq-server/deps/rabbit_common
Error! Failed to eval:  application:load(rebar),        application:set_env(rebar, log_level, debug),

And it ends with:

RunPlugin(P, pre_compile) || P <- Plugins],                             [RunPlugin(P, compile) || P <- Plugins]         end     end(),  halt()

Runtime terminating during boot ({{badmatch,{error,nofile}},[{erl_eval,expr,6,[{file,"erl_eval.erl"},{line,498}]},{erl_eval,exprs,6,[{file,"erl_eval.erl"},{line,136}]},{init,start_it,1,[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

Crash dump is being written to: erl_crash.dump...done
Error: No Makefile to build dependency /home/ziggi/varia/rabbitmq-email/deps/thoas.
make[1]: *** [erlang.mk:3750: deps] Error 2
make[1]: Leaving directory '/home/ziggi/varia/rabbitmq-email/.erlang.mk/rabbitmq-server/deps/rabbit_common'
make: *** [erlang.mk:4512: deps] Error 2

Ziggizag avatar Dec 06 '23 15:12 Ziggizag

Please note how I edited your previous comment to put the text behind a dropdown.

  • You did not answer this question - What version of Erlang are you using?
  • Please run these commands:
    cd path/to/rabbitmq-email
    git clean -xffd > /tmp/output.txt
    make 2>&1 | tee -a /tmp/output.txt
    
  • ATTACH /tmp/output.txt to your response.

lukebakken avatar Dec 06 '23 16:12 lukebakken

OK,

erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell "26"

output.txt

Ziggizag avatar Dec 06 '23 16:12 Ziggizag

Thanks. I am getting a different error than you. I will investigate.

Here is the output from my Ubuntu 22 env: lrb-output.txt

lukebakken avatar Dec 06 '23 17:12 lukebakken

Just FYI, I am working on higher priority items like this but will fix this issue as time allows.

lukebakken avatar Dec 06 '23 18:12 lukebakken

Hello, please see if this works in your environment:

git clone https://github.com/rabbitmq/rabbitmq-server.git
cd rabbitmq-server
make FULL=1
cd deps
git clone https://github.com/gotthardp/rabbitmq-email.git
cd rabbitmq-email
make

lukebakken avatar Dec 22 '23 13:12 lukebakken

Thank you @lukebakken, with your hint it work in my environment

I leave here a snippet of code for a multistage docker build where before we build the plugin and then copy the plugin inside the rabbitmq image.

This for rabbitmq 3.11

ARG RABBITMQ_VERSION=3.11.26

FROM elixir:1.14.5-otp-25 as builder
ARG RABBITMQ_VERSION

ENV TZ=Europe/Rome
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y rsync
RUN cd $HOME; git clone --depth 1 --branch v${RABBITMQ_VERSION}  https://github.com/rabbitmq/rabbitmq-server.git
RUN cd $HOME/rabbitmq-server && make FULL=1
RUN cd $HOME/rabbitmq-server/deps && git clone --depth 1 --branch v1.1.1 https://github.com/gotthardp/rabbitmq-email.git
RUN cd $HOME/rabbitmq-server/deps/rabbitmq-email && make RABBITMQ_VERSION=v${RABBITMQ_VERSION} dist

FROM docker.io/bitnami/rabbitmq:${RABBITMQ_VERSION}

COPY --from=builder /root/rabbitmq-server/deps/rabbitmq-email/plugins/eiconv-1.0.0 /opt/bitnami/rabbitmq/plugins/eiconv-1.0.0
COPY --from=builder /root/rabbitmq-server/deps/rabbitmq-email/plugins/gen_smtp-1.2.0 /opt/bitnami/rabbitmq/plugins/gen_smtp-1.2.0
COPY --from=builder /root/rabbitmq-server/deps/rabbitmq-email/plugins/rabbitmq_email-1.1.1 /opt/bitnami/rabbitmq/plugins/rabbitmq_email-1.1.1

This for rabbitmq 3.12 with new erlang/otp version

ARG RABBITMQ_VERSION=3.12.11

FROM elixir:1.14.5 as builder
ARG RABBITMQ_VERSION

ENV TZ=Europe/Rome
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y rsync
RUN cd $HOME; git clone --depth 1 --branch v${RABBITMQ_VERSION}  https://github.com/rabbitmq/rabbitmq-server.git
RUN cd $HOME/rabbitmq-server && make FULL=1
RUN cd $HOME/rabbitmq-server/deps && git clone --depth 1 --branch v1.1.1 https://github.com/gotthardp/rabbitmq-email.git
RUN cd $HOME/rabbitmq-server/deps/rabbitmq-email && make RABBITMQ_VERSION=v${RABBITMQ_VERSION} dist

FROM docker.io/bitnami/rabbitmq:${RABBITMQ_VERSION}

COPY --from=builder /root/rabbitmq-server/deps/rabbitmq-email/plugins/eiconv-1.0.0 /opt/bitnami/rabbitmq/plugins/eiconv-1.0.0
COPY --from=builder /root/rabbitmq-server/deps/rabbitmq-email/plugins/gen_smtp-1.2.0 /opt/bitnami/rabbitmq/plugins/gen_smtp-1.2.0
COPY --from=builder /root/rabbitmq-server/deps/rabbitmq-email/plugins/rabbitmq_email-1.1.1 /opt/bitnami/rabbitmq/plugins/rabbitmq_email-1.1.1

lucatiozzo91 avatar Dec 29 '23 14:12 lucatiozzo91