build/plugins: defer plugin builds which have plugin dependencies

We did avoid this for as long as possible and through plugins.conf.local
that was automatic for os-OPNProxy before but now we need to put a bit
more effort in in order to not fail the bulk plugins build because of
os-squid not being ready (yet).  It's also a complication of os-squid
no longer being in core but there are still situations like this in plugins
and core that require this fix.
This commit is contained in:
Franco Fichtner 2024-04-17 06:54:02 +02:00
parent e06105e069
commit e35a234910
1 changed files with 24 additions and 2 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2015-2022 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2015-2024 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -59,9 +59,31 @@ for BRANCH in ${EXTRABRANCH} ${PLUGINSBRANCH}; do
setup_copy ${STAGEDIR} ${PLUGINSDIR}
git_reset ${STAGEDIR}${PLUGINSDIR} ${BRANCH}
_PLUGIN_ARGS="PLUGIN_ARCH=${PRODUCT_ARCH} ${PLUGINSENV}"
PREFIX=${PRODUCT_PLUGINS%"*"}
PLUGIN_LIST=
PLUGIN_DEFER=
for PLUGIN_ORIGIN in ${PLUGINSLIST}; do
PLUGIN=${PLUGIN_ORIGIN%%@*}
if [ ! -d ${STAGEDIR}${PLUGINSDIR}/${PLUGIN} ]; then
continue
fi
PLUGIN_DEPS=$(make -C ${STAGEDIR}${PLUGINSDIR}/${PLUGIN} ${PLUGIN_ARGS} -v PLUGIN_DEPENDS)
for PLUGIN_DEP in ${PLUGIN_DEPS}; do
if [ -z "${PLUGIN_DEP%%"${PREFIX}"*}" ]; then
PLUGIN_DEFER="${PLUGIN_DEFER} ${PLUGIN_ORIGIN}"
continue 2
fi
done
PLUGIN_LIST="${PLUGIN_LIST} ${PLUGIN_ORIGIN}"
done
_PLUGIN_ARGS="PLUGIN_ARCH=${PRODUCT_ARCH} ${PLUGINSENV}"
for PLUGIN_ORIGIN in ${PLUGIN_LIST} ${PLUGIN_DEFER}; do
VARIANT=${PLUGIN_ORIGIN##*@}
PLUGIN=${PLUGIN_ORIGIN%%@*}