gotthardp / rabbitmq-email

SMTP Gateway Plugin for RabbitMQ
Mozilla Public License 2.0
181 stars 20 forks source link

Master vs v1.1.1 tag. #57

Closed a-marcellini closed 2 years ago

a-marcellini commented 2 years ago

Hi, once you've merged the last version, we immediately tried to build the image using the tag... and surprisingly, it doesn't work.

The error is:

#10 8.664 make: *** No rule to make target ‘/root/rabbitmq-email/deps/rabbit_common’, needed by ‘deps’.  Stop.

On the contrary, if we use master, it works without any problem.

lukebakken commented 2 years ago

Please be sure to always include the commands you run and all of the output when reporting a problem.

If I clone only the tag, like this -

git clone --branch v1.1.1 https://github.com/gotthardp/rabbitmq-email.git

I do see the issue. But if I do a full clone and then change to the v1.1.1 tag, it works fine.

In your clone, you should be able to fix this by doing the following:

git fetch
git checkout master
git checkout v1.1.1
make RABBITMQ_VERSION=3.11.1
a-marcellini commented 2 years ago

This is our dockerfile:

FROM elixir:1.14 as builder
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 https://github.com/sistemi-iungo/rabbitmq-email.git --branch iungo-master
RUN cd $HOME; git clone https://github.com/gotthardp/rabbitmq-email.git --branch v1.1.1
#SHELL ["/bin/bash"]
RUN cd $HOME/rabbitmq-email && make && make RABBITMQ_VERSION=v3.11.1 dist

FROM rabbitmq:3.11.1-management

COPY --from=builder /root/rabbitmq-email/plugins/eiconv-1.0.0 /opt/rabbitmq/plugins/eiconv-1.0.0
COPY --from=builder /root/rabbitmq-email/plugins/gen_smtp-1.2.0 /opt/rabbitmq/plugins/gen_smtp-1.2.0
COPY --from=builder /root/rabbitmq-email/plugins/rabbitmq_email-1.1.1 /opt/rabbitmq/plugins/rabbitmq_email-1.1.1
lukebakken commented 2 years ago

OK, please change your build to not use the --branch argument to git clone, and instead checkout the v1.1.1 tag.

There is something in erlang.mk that depends on having a full git clone.

I'll close this now because I'm pretty sure this will address your issue, but let me know if it doesn't.

michaelklishin commented 2 years ago

Does a make deps added explicitly before make and make dist make any difference?

lukebakken commented 2 years ago

@michaelklishin make deps results in the same error in my environment. I'm going to take a minute to see if there's something I can fix in erlang.mk with regard to this issue. I also see this suspicious error in the output:

/bin/sh: 1: Syntax error: "(" unexpected (expecting ")")
michaelklishin commented 2 years ago

@lukebakken have erlang.mk and rabbitmq-components.mk been synced for this plugin recently? They have for other community plugins we've updated.

lukebakken commented 2 years ago

https://github.com/gotthardp/rabbitmq-email/pull/53

lukebakken commented 2 years ago

@michaelklishin this is what gets a bit confused by the "detached HEAD" checkout that happens with --branch

set -x;     fetch_url1='https://github.com/rabbitmq/rabbitmq-server.git'; fetch_url2='git@github.com:rabbitmq/rabbitmq-server.git'; if [ ! -d /home/lbakken/misc/rabbitmq-email/.erlang.mk/rabbitmq-server ]; then if test "$fetch_url1" != 'git@github.com:gotthardp/rabbitmq-email.git' && git clone -q -n -- "$fetch_url1" /home/lbakken/misc/rabbitmq-email/.erlang.mk/rabbitmq-server; then fetch_url="$fetch_url1"; push_url=''; elif git clone -q -n -- "$fetch_url2" /home/lbakken/misc/rabbitmq-email/.erlang.mk/rabbitmq-server; then fetch_url="$fetch_url2"; push_url=''; fi; fi; cd /home/lbakken/misc/rabbitmq-email/.erlang.mk/rabbitmq-server && (  git checkout -q (no >/dev/null 2>&1 ||   git checkout -q branch) >/dev/null 2>&1 ||   git checkout -q main >/dev/null 2>&1 ||   git checkout -q main >/dev/null 2>&1 ||  (echo "error: no valid pathspec among:  (no branch) main main" 1>&2 && false) ) && (test "$fetch_url" = "$push_url" || git remote set-url --push origin "$push_url")
/bin/sh: 1: Syntax error: "(" unexpected (expecting ")")
lukebakken commented 2 years ago

Ah, that's in rabbitmq-components.mk