Upstream uutils declined PR #15034
(https://github.com/uutils/coreutils/pull/15034) to preserve their
'(uutils coreutils)' branding in --version output.

In case Ubuntu prefers not to carry the downstream delta in rust-
coreutils, I also prepared and attached a debdiff for atheme-services
7.2.12-2.1ubuntu1 (setting 'export MKDIR_P = /bin/mkdir -p' in
debian/rules). The fix was verified in a clean stonking container with
rust-coreutils, and forwarded to Debian BTS:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1149925

Leaving both options available for maintainers to decide whether to
carry the compatibility delta in rust-coreutils or apply fixes per
package.


** Changed in: atheme-services (Ubuntu)
       Status: New => Confirmed

** Description changed:

  [ Impact ]
  
- Autoconf 2.69 AC_PROG_MKDIR_P checks `mkdir --version` against:
+ Packages shipping unregenerated Autoconf 2.69 configure scripts fail to build 
when rust-coreutils provides /bin/mkdir. 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.
+ Because rust-coreutils outputs `mkdir (uutils coreutils) <version>`, the
+ pattern does not match and configure falls back to relative `build-
+ aux/install-sh -c -d`. In packages with subdirectories (such as atheme-
+ services 7.2.12), running `$(MKDIR_P)` from build subfolders fails with
+ Error 127 because `build-aux/install-sh` cannot be resolved relative to
+ that subdirectory, causing FTBFS in stonking.
  
  [ 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`.
+ Two solutions are provided for maintainers:
+ 
+ 1. Systemic fix in rust-coreutils: Update `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+. (Attached debdiff for 
rust-coreutils 0.12.0-1ubuntu4).
+ 2. Per-package fix in atheme-services: Set `export MKDIR_P = /bin/mkdir -p` 
in `debian/rules`. This pre-populates MKDIR_P across sub-configures and make 
invocations, bypassing the obsolete version check. (Attached debdiff for 
atheme-services 7.2.12-2.1ubuntu1).
  
  [ 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`
+ 1. For rust-coreutils:
+    - Check `mkdir --version | head -n 1` matches `mkdir (coreutils) 
<version>`.
+    - Run Autoconf 2.69 case check and verify it prints PASSED.
+    - Run `cargo test --package coreutils --test tests 
test_mkdir::test_version`.
+ 2. For atheme-services:
+    - In a clean Ubuntu stonking container with rust-coreutils installed, run 
`dpkg-buildpackage -us -uc -b`.
+    - Verify `modules/contrib/src` installs cleanly without install-sh Error 
127.
+    - Verify all binary packages (atheme-services, atheme-services-contrib, 
dbgsym) build cleanly.
  
  [ 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.
+ - For rust-coreutils: External scripts strictly expecting the literal string 
`(uutils coreutils)` in `--version` output might be affected.
+ - For atheme-services: The change only exports a standard `/bin/mkdir -p` 
path during build time in debian/rules. No runtime impact.
  
  [ 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.
+ 1. Upstream uutils PR: https://github.com/uutils/coreutils/pull/15034 
(declined to preserve '(uutils coreutils)' branding).
+ 2. Debian BTS: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1149925 
(atheme-services forwarded with patch).
+ 3. Target release: stonking (for both packages).
+ 4. Testbed verification: Both fixes independently verified on Ubuntu stonking 
testbed with 0 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.

** Bug watch added: Debian Bug tracker #1149925
   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1149925

** Patch added: "atheme-services 7.2.12-2.1ubuntu1 debdiff for stonking"
   
https://bugs.launchpad.net/ubuntu/+source/atheme-services/+bug/2169228/+attachment/6005495/+files/atheme-services_7.2.12-2.1ubuntu1.debdiff

** Also affects: atheme-services (Debian) via
   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1149925
   Importance: Unknown
       Status: Unknown

-- 
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

Reply via email to