-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix bootstrap failure when uutils replaces system coreutils #8847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
When uutils-coreutils is installed as a system-wide replacement for GNU coreutils (e.g., on Gentoo with emerge), a bootstrap problem occurs: the Makefile uses the 'install' command, but if the system's install is from a broken or incomplete uutils installation, the build fails with errors like '-v: function/utility not found'. This fix moves the INSTALL variable definition to after BUILDDIR is set, allowing it to conditionally use the just-built coreutils install command. The logic checks for: 1. Multicall binary (BUILDDIR/coreutils) first 2. Standalone install binary (BUILDDIR/install) second 3. System install as fallback for first-time builds This prevents the chicken-and-egg problem where emerge can't build uutils because it depends on uutils being functional. Fixes uutils#8837
I think this should be considered as bug of each package manager. |
GNU testsuite comparison:
|
could you please add a check in github action that verify that this issue doesn't happen anymore? thanks |
…ssue The locales target runs during the build phase before the install binary is built, causing 'install: function/utility not found' errors when INSTALL variable evaluates to a non-existent or broken system install command. Since the locales target only copies files to the build directory (not installing with special permissions), using cp is sufficient and avoids the Make variable evaluation timing issue where INSTALL is set at parse time before any binaries are built. This maintains the fix for uutils#8837 while resolving the CI failure in the Build/Makefile job.
This is Gentoo-side issue: #8837 (comment) |
GNU testsuite comparison:
|
0d07dae
to
0bb9e7c
Compare
separate Gentoo issue (not fixed here) as @Alxhr0 discovered, Gentoo's emerge has issues with symlinked multicall binaries:
|
GNU testsuite comparison:
|
Add a CI check to verify that locale files are successfully copied during the build phase without relying on the system install command. This test ensures the bootstrap issue doesn't regress. The test verifies: - Locales directory is created - Common uucore locales are copied - Utility-specific locales are copied - A reasonable number of locale files exist (>50) This addresses the maintainer request to add a regression test for the fix.
0bb9e7c
to
263dcf4
Compare
GNU testsuite comparison:
|
I think this PR should be closed and broken system should be fixed by different method. |
this fixes a real bootstrap problem where rebuilding uutils fails because the system install command is broken. The solution is clean - move INSTALL definition after BUILDDIR so it can use the just-built binary when available.
I think this should be merged as a pragmatic fix. The conditional logic is straightforward and the CI test proves it works. for future work: document |
@oech3 not "recovery tool" - It's "smart build system" Lines 10 to 12 in 97093b4
This PR extends that same philosophy to the INSTALL command—using the just-built binary when available is consistent with the project's 10-year design of intelligent, context-aware builds. The pattern already used for goal detection and OS detection. |
GNU testsuite comparison:
|
Should we extend this idea for all coreutils (e.g mkdir) used at install time? |
i will soon investigate Gentoo and Linux From Scratch to understand the full extent of edge cases where system coreutils might be broken during rebuilds. This will help determine if we need similar logic for mkdir, cp, rm, or other utilities used at install time 💀 |
Fix bootstrap failure when uutils replaces system coreutils
Fixes #8837
Use the just-built install binary instead of system install to avoid bootstrap failures on systems where uutils has replaced GNU coreutils.