I reproduced this on Ubuntu stonking in an LXC test container with
atheme-services 7.2.12 (modules/contrib/configure).
Root cause:
Autoconf 2.69 AC_PROG_MKDIR_P checks `mkdir --version` against:
'mkdir (GNU coreutils) '* | 'mkdir (coreutils) '* | 'mkdir (fileutils) '4.1*
Because rust-coreutils output "mkdir (uutils coreutils) <version>", none of
these matched. The check fell back to relative "build-aux/install-sh -c -d",
which breaks recursive make runs from subdirectories with Error 127.
Fix:
Change crate_version!() in uucore from "(uutils coreutils) " to "(coreutils) ".
This satisfies Autoconf 2.69 while keeping compatibility with Autoconf 2.71+
(which checks 'mkdir ('*'coreutils) '*).
Verification:
1. Ran atheme-services configure with the patched binary in PATH:
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
2. Tested the version output directly against the Autoconf 2.69 case statement
(passed).
3. Ran full test suite: cargo test --package coreutils --test tests
test_mkdir::test_version (0 regressions).
Upstream PR:
https://github.com/uutils/coreutils/pull/15034
Attached debdiff rust-coreutils_0.12.0-1ubuntu4.debdiff for stonking.
** Description changed:
+ [ Impact ]
+
+ Autoconf 2.69 AC_PROG_MKDIR_P checks `mkdir --version` against:
+ 'mkdir (GNU coreutils) '* | 'mkdir (coreutils) '* | 'mkdir (fileutils) '4.1*
+
+ Because rust-coreutils output `mkdir (uutils coreutils) <version>`, none
+ of these patterns matched and configure fell back to relative `build-
+ aux/install-sh -c -d`. In builds with subdirectories (such as atheme-
+ services), running `$(MKDIR_P)` from a subfolder fails with Error 127
+ because `install-sh` cannot be found relative to that folder, causing
+ FTBFS.
+
+ [ Fix ]
+
+ Change `crate_version!()` in `src/uucore/src/lib/lib.rs` from `(uutils
+ coreutils) <version>` to `(coreutils) <version>`. This matches the
+ `'mkdir (coreutils) '*` glob in Autoconf 2.69 while remaining compatible
+ with Autoconf 2.71+ (which matches `'mkdir ('*'coreutils) '*`). Keep doc
+ website branding in `src/bin/uudoc.rs`, and update tests in
+ `test_mkdir.rs`, `test_echo.rs`, and `test_test.rs`.
+
+ [ Test Plan ]
+
+ 1. Check `mkdir --version` output:
+ `mkdir --version | head -n 1`
+ Must output `mkdir (coreutils) <version>`.
+ 2. Check against the Autoconf 2.69 case statement:
+ case $(mkdir --version 2>&1) in
+ 'mkdir (GNU coreutils) '* | 'mkdir (coreutils) '* | 'mkdir (fileutils)
'4.1*) echo "PASSED" ;;
+ *) echo "FAILED" ;;
+ esac
+ Must output PASSED.
+ 3. In atheme-services (modules/contrib/), run `./configure` and verify that
`checking for a thread-safe mkdir -p...` resolves to `/usr/bin/mkdir -p`
instead of `build-aux/install-sh -c -d`.
+ 4. Run test suite:
+ `cargo test --package coreutils --test tests test_mkdir::test_version`
+
+ [ Where problems could occur ]
+
+ Scripts that look specifically for the literal string `(uutils
+ coreutils)` in `--version` output might be affected. However, coreutils
+ tools are drop-in replacements for standard coreutils, and build systems
+ check for `(coreutils)`. The change improves compatibility.
+
+ [ Other Info ]
+
+ 1. Upstream PR: https://github.com/uutils/coreutils/pull/15034 (opened and
linked).
+ 2. Target series: stonking (rust-coreutils 0.12.0-1ubuntu4).
+ 3. Testbed check: Verified on Ubuntu stand inside LXC container;
atheme-services configure finds mkdir -p. 0 test regressions.
+
+ --- [ Original Report ]
+
Scripts generated by Autoconf 2.69 do not accept uutils mkdir in
AC_PROG_MKDIR_P, because its --version output doesn't match the strings
that check looks for. They then fall back to a relative "install-sh -d"
path, which can break builds. This makes atheme-services fail to build
from source in stonking.
== Details ==
Autoconf 2.69's AC_PROG_MKDIR_P only accepts mkdir if `mkdir --version`
starts with one of:
'mkdir (GNU coreutils) '*
'mkdir (coreutils) '*
'mkdir (fileutils) '4.1*
uutils mkdir (coreutils-from-uutils / rust-coreutils 0.12.0-1ubuntu1)
presumably prints "mkdir (uutils coreutils) ...", which matches none of
them. (This is inferred from the configure result below; the exact
uutils --version output was not checked directly.) Newer Autoconf uses
the looser pattern 'mkdir ('*'coreutils) '*, so regenerated configure
scripts are fine. But many upstream tarballs still ship 2.69-generated
configure scripts that the packaging does not regenerate.
When the check fails, configure falls back to MKDIR_P="$ac_install_sh
-d". That is often a relative path such as "build-aux/install-sh -c -d",
which breaks when it is used from a subdirectory.
== Example: atheme-services 7.2.12-2.1 ==
https://launchpad.net/ubuntu/+source/atheme-
services/7.2.12-2.1/+build/32793374
The top-level configure is regenerated by dh_autoreconf and finds mkdir:
checking for a race-free mkdir -p... /usr/bin/mkdir -p
modules/contrib/configure is the shipped Autoconf 2.69 copy and does not:
checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
make install then runs it from modules/contrib/src and fails:
/bin/bash: line 3: build-aux/install-sh: No such file or directory
make[4]: *** [../buildsys.mk:510: install] Error 127
Debian (GNU coreutils) builds the same version fine on all
architectures. atheme-services has been missing from Ubuntu since this
started (it also failed in resolute).
== Possible fixes ==
- rust-coreutils: make mkdir --version output match what old Autoconf checks
accept, e.g. include "(coreutils)" or "(GNU coreutils)" the way other tools do
for compatibility. Whether that is acceptable to uutils is up to the
maintainers.
- Per package: regenerate the stale configure scripts, or pass
MKDIR_P="/usr/bin/mkdir -p" to configure. For atheme-services, either of these
should work (untested):
override_dh_autoreconf:
dh_autoreconf autoreconf -- -f -i -I m4 . modules/contrib
or adding MKDIR_P="/usr/bin/mkdir -p" to dh_auto_configure.
Other packages with unregenerated Autoconf 2.69 sub-configures are
likely affected the same way.
** Changed in: rust-coreutils (Ubuntu)
Status: New => Confirmed
** Tags added: autoconf ftbfs patch stonking
** Patch added: "rust-coreutils 0.12.0-1ubuntu4 debdiff for stonking"
https://bugs.launchpad.net/ubuntu/+source/rust-coreutils/+bug/2169228/+attachment/6004826/+files/rust-coreutils_0.12.0-1ubuntu4.debdiff
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2169228
Title:
mkdir: --version not recognised by Autoconf 2.69 AC_PROG_MKDIR_P,
falls back to relative install-sh (breaks atheme-services FTBFS)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/atheme-services/+bug/2169228/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs