diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 4ac8cde5a13..77e7c4617ed 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -293,6 +293,28 @@ jobs: test -f target/CACHEDIR.TAG # Restore cache for target/release (we only did a debug build) mv -t target/ target.cache/release 2>/dev/null || true + - name: "Verify bootstrap fix (issue #8837)" + shell: bash + run: | + set -x + # Verify that locales were successfully copied during build + # This ensures the bootstrap issue is fixed - the build should work + # even without relying on system 'install' command + + test -d target/debug/locales || { echo "::error ::Locales directory not created"; exit 1; } + + # Check for uucore common locales + test -f target/debug/locales/uucore/fr-FR.ftl || { echo "::error ::uucore locale not copied"; exit 1; } + + # Check for at least a few utility-specific locales + test -f target/debug/locales/ls/fr-FR.ftl || { echo "::error ::ls locale not copied"; exit 1; } + test -f target/debug/locales/cat/fr-FR.ftl || { echo "::error ::cat locale not copied"; exit 1; } + + # Count total locale files to ensure reasonable number were copied + LOCALE_COUNT=$(find target/debug/locales -name "*.ftl" | wc -l) + echo "Found $LOCALE_COUNT locale files" + [ "$LOCALE_COUNT" -gt 50 ] || { echo "::error ::Too few locale files copied ($LOCALE_COUNT)"; exit 1; } + - name: "`make nextest`" shell: bash run: make nextest CARGOFLAGS="--profile ci --hide-progress-bar" diff --git a/GNUmakefile b/GNUmakefile index 41ba59349e5..55544d3c806 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -6,7 +6,6 @@ MULTICALL ?= n COMPLETIONS ?= y MANPAGES ?= y LOCALES ?= y -INSTALL ?= install ifneq (,$(filter install, $(MAKECMDGOALS))) override PROFILE:=release endif @@ -53,6 +52,21 @@ endif PKG_BUILDDIR := $(BUILDDIR)/deps DOCSDIR := $(BASEDIR)/docs +# Bootstrap protection: When uutils is installed as system coreutils (e.g., on +# Gentoo), the system 'install' may be broken or missing, causing build failures. +# Use the just-built 'install' binary to avoid this chicken-and-egg problem. +# Falls back to system 'install' for first-time builds. +ifneq ($(wildcard $(BUILDDIR)/coreutils),) + # Use multicall binary's install command if it exists + INSTALL ?= $(BUILDDIR)/coreutils install +else ifneq ($(wildcard $(BUILDDIR)/install),) + # Use standalone install binary if built without multicall + INSTALL ?= $(BUILDDIR)/install +else + # Fall back to system install command for first build + INSTALL ?= install +endif + BUSYBOX_ROOT := $(BASEDIR)/tmp BUSYBOX_VER := 1.36.1 BUSYBOX_SRC := $(BUSYBOX_ROOT)/busybox-$(BUSYBOX_VER) @@ -449,7 +463,7 @@ locales: @if [ -d "$(BASEDIR)/src/uucore/locales" ]; then \ mkdir -p "$(BUILDDIR)/locales/uucore"; \ for locale_file in "$(BASEDIR)"/src/uucore/locales/*.ftl; do \ - $(INSTALL) -m 644 -v "$$locale_file" "$(BUILDDIR)/locales/uucore/"; \ + cp -v "$$locale_file" "$(BUILDDIR)/locales/uucore/"; \ done; \ fi; \ # Copy utility-specific locales @@ -458,7 +472,7 @@ locales: mkdir -p "$(BUILDDIR)/locales/$$prog"; \ for locale_file in "$(BASEDIR)"/src/uu/$$prog/locales/*.ftl; do \ if [ "$$(basename "$$locale_file")" != "en-US.ftl" ]; then \ - $(INSTALL) -m 644 -v "$$locale_file" "$(BUILDDIR)/locales/$$prog/"; \ + cp -v "$$locale_file" "$(BUILDDIR)/locales/$$prog/"; \ fi; \ done; \ fi; \