Commit 3efca0be authored by Federico G. Schwindt's avatar Federico G. Schwindt Committed by Lasse Karstensen

Relax the vmod abi check if we are not in master

For master we retain the more strict check in case we forget to bump
the API version as discussed on irc.  Implementation idea from scoof.

Fixes #1538
parent ffa893e3
......@@ -96,6 +96,7 @@ MAINTAINERCLEANFILES = vcs_version.h
vcs_version.h: FORCE
@if [ -d "$(top_srcdir)/.git" ]; then \
V="$$(git show -s --pretty=format:%h)" \
B="$$(git rev-parse --abbrev-ref HEAD)" \
H="$$(head -n 1 vcs_version.h 2>/dev/null || true)"; \
if [ "/* $$V */" != "$$H" ]; then \
( \
......@@ -108,7 +109,8 @@ vcs_version.h: FORCE
echo ' */' ;\
echo "/* $$V */" ;\
echo '' ;\
echo "#define VCS_Version \"$$V\"" \
echo "#define VCS_Version \"$$V\"" ; \
echo "#define VCS_Branch \"$$B\"" \
) > vcs_version.h ; \
fi \
else \
......@@ -116,7 +118,8 @@ vcs_version.h: FORCE
( \
echo "/* NOGIT */" ; \
echo '/* No git commit ID available, see include/Makefile.am for explanation */' ; \
echo '#define VCS_Version "NOGIT"' \
echo '#define VCS_Version "NOGIT"' ; \
echo '#define VCS_Branch "NOGIT"' \
) > vcs_version.h ; \
fi \
fi
......
......@@ -34,6 +34,8 @@
#include "vcc_compile.h"
#include "vcs_version.h"
#include "vmod_abi.h"
#include "vrt.h"
......@@ -123,6 +125,15 @@ vcc_ParseImport(struct vcc *tl)
vcc_ErrWhere(tl, mod);
return;
}
if (strcmp(VCS_Branch, "master") == 0 &&
strcmp(vmd->abi, VMOD_ABI_Version) != 0) {
VSB_printf(tl->sb, "Incompatible VMOD %.*s\n", PF(mod));
VSB_printf(tl->sb, "\tFile name: %s\n", fn);
VSB_printf(tl->sb, "\tABI mismatch, expected <%s>, got <%s>\n",
VMOD_ABI_Version, vmd->abi);
vcc_ErrWhere(tl, mod);
return;
}
if (vmd->vrt_major != VRT_MAJOR_VERSION ||
vmd->vrt_minor > VRT_MINOR_VERSION) {
VSB_printf(tl->sb, "Incompatible VMOD %.*s\n", PF(mod));
......@@ -154,15 +165,6 @@ vcc_ParseImport(struct vcc *tl)
return;
}
if (strcmp(vmd->abi, VMOD_ABI_Version) != 0) {
VSB_printf(tl->sb, "Incompatible VMOD %.*s\n", PF(mod));
VSB_printf(tl->sb, "\tFile name: %s\n", fn);
VSB_printf(tl->sb, "\tABI mismatch, expected <%s>, got <%s>\n",
VMOD_ABI_Version, vmd->abi);
vcc_ErrWhere(tl, mod);
return;
}
ifp = New_IniFin(tl);
VSB_printf(ifp->ini, "\tif (VRT_Vmod_Init(&VGC_vmod_%.*s,\n", PF(mod));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment