gotthardp/rabbitmq-email

Master vs v1.1.1 tag.

Closed this issue · 9 comments

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.

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

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

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.

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

@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 ")")

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

@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 ")")

Ah, that's in rabbitmq-components.mk