diff --git a/release-tools/build.make b/release-tools/build.make index 5ad8221b..13b3419f 100644 --- a/release-tools/build.make +++ b/release-tools/build.make @@ -78,11 +78,14 @@ FULL_LDFLAGS = $(LDFLAGS) $(IMPORTPATH_LDFLAGS) $(EXT_LDFLAGS) # defined by BUILD_PLATFORMS. $(CMDS:%=build-%): build-%: check-go-version-go mkdir -p bin - # OS_ARCH_SEEN captures all of the $os-$arch seen for the current binary + # os_arch_seen captures all of the $os-$arch seen for the current binary # that we want to build, if we've seen an $os-$arch before it means that # we don't need to build it again, this is done to avoid building # the windows binary multiple times (see the default value of $BUILD_PLATFORMS) - export OS_ARCH_SEEN="" && echo '$(BUILD_PLATFORMS)' | tr ';' '\n' | while read -r os arch suffix base_image addon_image; do \ + echo '$(BUILD_PLATFORMS)' | tr ';' '\n' | while read -r os arch suffix base_image addon_image; do \ + if ! [ -z $$os_arch_seen ]; then \ + os_arch_seen=""; \ + fi; \ os_arch_seen_pre=$${OS_ARCH_SEEN%%$$os-$$arch*}; \ if ! [ $${#os_arch_seen_pre} = $${#OS_ARCH_SEEN} ]; then \ continue; \ @@ -91,7 +94,7 @@ $(CMDS:%=build-%): build-%: check-go-version-go echo "Building $* for GOOS=$$os GOARCH=$$arch failed, see error(s) above."; \ exit 1; \ fi; \ - OS_ARCH_SEEN+=";$$os-$$arch"; \ + os_arch_seen+=";$$os-$$arch"; \ done $(CMDS:%=container-%): container-%: build-%