hostapd: pack hostapd-utils and wpa-cli in one variant only

hostapd-utils and wpa-cli use VARIANT:=*, so every variant packs them.
Since the variants are built in parallel, they write the same package
file and pkginfo files at the same time. This makes the build fail
randomly:

  Package hostapd-utils is missing dependencies for the following libraries:
  libgcc_s.so.1

Only pack them in the first selected variant that builds them.

Fixes: b029d56e0b ("hostapd: build the variants in parallel")
Link: https://github.com/openwrt/openwrt/pull/25796
Signed-off-by: Nick Hainke <vincent@systemli.org>
This commit is contained in:
Nick Hainke committed 2026-10-11 09:26:39 +02:00
1 parent af930e44d1
commit 84802285f4
1 file changed
+8 -2
+8 -2
View File
@@ -44,6 +44,12 @@ LOCAL_TYPE=$(strip \
hostapd \
)))
# hostapd-utils and wpa-cli can be packed by several variants, which are
# built in parallel. Only pack them in the first selected variant that
# builds them, so the variants do not write the same files.
HOSTAPD_UTILS_VARIANT=$(firstword $(filter-out supplicant-%,$(ALL_VARIANTS)))
WPA_CLI_VARIANT=$(firstword $(filter wpad-% supplicant-%,$(ALL_VARIANTS)))
LOCAL_AND_LIB_VARIANT=$(patsubst hostapd-%,%,\
$(patsubst wpad-%,%,\
$(patsubst supplicant-%,%,\
@@ -761,7 +767,7 @@ Package/hostapd-openssl/install = $(Package/hostapd/install)
Package/hostapd-wolfssl/install = $(Package/hostapd/install)
Package/hostapd-mbedtls/install = $(Package/hostapd/install)
ifneq ($(LOCAL_TYPE),supplicant)
ifeq ($(BUILD_VARIANT),$(HOSTAPD_UTILS_VARIANT))
define Package/hostapd-utils/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd_cli $(1)/usr/sbin/
@@ -801,7 +807,7 @@ Package/wpa-supplicant-mesh-openssl/install = $(Package/wpa-supplicant/install)
Package/wpa-supplicant-mesh-wolfssl/install = $(Package/wpa-supplicant/install)
Package/wpa-supplicant-mesh-mbedtls/install = $(Package/wpa-supplicant/install)
ifneq ($(LOCAL_TYPE),hostapd)
ifeq ($(BUILD_VARIANT),$(WPA_CLI_VARIANT))
define Package/wpa-cli/install
$(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_BUILD_DIR)/wpa_supplicant/wpa_cli $(1)/usr/sbin/