GNU bug report logs - #63161
Issue with mkinstalldirs and symb links

Previous Next

Package: automake;

Reported by: Panaiotis Arnaud <Arnaud.Panaiotis.ext <at> vossloh.com>

Date: Sat, 29 Apr 2023 01:21:01 UTC

Severity: normal

Tags: wontfix

Done: Karl Berry <karl <at> freefriends.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 63161 in the body.
You can then email your comments to 63161 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-automake <at> gnu.org:
bug#63161; Package automake. (Sat, 29 Apr 2023 01:21:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Panaiotis Arnaud <Arnaud.Panaiotis.ext <at> vossloh.com>:
New bug report received and forwarded. Copy sent to bug-automake <at> gnu.org. (Sat, 29 Apr 2023 01:21:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Panaiotis Arnaud <Arnaud.Panaiotis.ext <at> vossloh.com>
To: "bug-automake <at> gnu.org" <bug-automake <at> gnu.org>
Subject: Issue with mkinstalldirs and symb links
Date: Fri, 28 Apr 2023 14:29:36 +0000
[Message part 1 (text/plain, inline)]
Hi,

I encounter an issue while working with glibc with script scripts/mkinstalldirs. In scriptversion=2018-03-07.03; # UTC.

I had a symbolic link lib64->lib and the folder lib did not exist.

The glibc installing process is calling   ./scripts/mkinstalldirs [..]/lib64 which failed to mkdir -p it.

I made a working patch for my case, which need to be reworked as a loop (As I use the script with a single argument $@ and not a list of them).

Here is my solution:
--- a/scripts/mkinstalldirs.old 2023-04-28 15:25:12.087611912 +0200
+++ b/scripts/mkinstalldirs     2023-04-28 15:27:28.056402448 +0200
@@ -78,8 +78,13 @@
case $dirmode in
   '')
     if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
-      echo "mkdir -p -- $*"
-      exec mkdir -p -- "$@"
+      if test -L "$@"; then
+        echo "mkdir -p -- \"\$(realpath $*)\""
+        exec mkdir -p -- "$(realpath $@)"
+      else
+        echo "mkdir -p -- $*"
+        exec mkdir -p -- "$@"
+      fi
     else
       # On NextStep and OpenStep, the 'mkdir' command does not
       # recognize any option.  It will interpret all options as

Best regards,

Arnaud Panaïotis
Freelance Lead developer
APsudo

[Message part 2 (text/html, inline)]

Information forwarded to bug-automake <at> gnu.org:
bug#63161; Package automake. (Sat, 29 Apr 2023 20:49:01 GMT) Full text and rfc822 format available.

Message #8 received at 63161 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: Arnaud.Panaiotis.ext <at> vossloh.com
Cc: 63161 <at> debbugs.gnu.org
Subject: Re: bug#63161: Issue with mkinstalldirs and symb links
Date: Sat, 29 Apr 2023 22:48:15 +0200
Thanks for the report.

    The glibc installing process is calling
    ./scripts/mkinstalldirs [..]/lib64
    which failed to mkdir -p it.

With literal brackets? I don't understand.

+      if test -L "$@"; then
+        echo "mkdir -p -- \"\$(realpath $*)\""

Neither test -L nor (especially) realpath are portable.
(test -h can be used for the former; have to resort to ls -l|sed
for the latter, I think.)

In any case, "resolving" a broken link is a fundamental change in
behavior.  I'm doubtful that is desirable at this late date. I'm not
sure it's mkinstalldir's job to figure out that you made a broken
symlink and create the directory it points to. If I'm understanding your
scenario correctly.

What do others think? --thanks, karl.




Information forwarded to bug-automake <at> gnu.org:
bug#63161; Package automake. (Tue, 02 May 2023 06:35:02 GMT) Full text and rfc822 format available.

Message #11 received at 63161 <at> debbugs.gnu.org (full text, mbox):

From: Panaiotis Arnaud <Arnaud.Panaiotis.ext <at> vossloh.com>
To: Karl Berry <karl <at> freefriends.org>
Cc: "63161 <at> debbugs.gnu.org" <63161 <at> debbugs.gnu.org>
Subject: RE: bug#63161: Issue with mkinstalldirs and symb links
Date: Tue, 2 May 2023 06:34:17 +0000
Hello,

    The glibc installing process is calling
    ./scripts/mkinstalldirs [..]/lib64
    which failed to mkdir -p it.

With literal brackets? I don't understand.

> No, I did not copy the full path, which is like : buildroot_dir/output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib64 

In any case, "resolving" a broken link is a fundamental change in behavior.  I'm doubtful that is desirable at this late date. I'm not sure it's mkinstalldir's job to figure out that you made a broken symlink and create the directory it points to. If I'm understanding your scenario correctly.

> I don't know why/how glibc created this broken link. Glibc version is glibc-2.34-9-g9acab0bba6a5a57323b1f94bf95b21618a9e5aa4 if this information is helpfull.

Regards,
Arnaud

-----Message d'origine-----
De : Karl Berry <karl <at> freefriends.org> 
Envoyé : samedi 29 avril 2023 22:48
À : Panaiotis Arnaud <Arnaud.Panaiotis.ext <at> vossloh.com>
Cc : 63161 <at> debbugs.gnu.org
Objet : Re: bug#63161: Issue with mkinstalldirs and symb links

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.


Thanks for the report.

    The glibc installing process is calling
    ./scripts/mkinstalldirs [..]/lib64
    which failed to mkdir -p it.

With literal brackets? I don't understand.

+      if test -L "$@"; then
+        echo "mkdir -p -- \"\$(realpath $*)\""

Neither test -L nor (especially) realpath are portable.
(test -h can be used for the former; have to resort to ls -l|sed for the latter, I think.)

In any case, "resolving" a broken link is a fundamental change in behavior.  I'm doubtful that is desirable at this late date. I'm not sure it's mkinstalldir's job to figure out that you made a broken symlink and create the directory it points to. If I'm understanding your scenario correctly.

What do others think? --thanks, karl.




Information forwarded to bug-automake <at> gnu.org:
bug#63161; Package automake. (Wed, 31 Jan 2024 22:48:01 GMT) Full text and rfc822 format available.

Message #14 received at 63161 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: Arnaud.Panaiotis.ext <at> vossloh.com
Cc: 63161 <at> debbugs.gnu.org
Subject: Re: bug#63161: Issue with mkinstalldirs and symb links
Date: Wed, 31 Jan 2024 15:47:06 -0700
Hi Arnaud - back on this bug from last April, I guess I just don't think
it's the job of mkinstalldirs to follow symlinks. It feels like too big
a change in behavior. I think the real bug here lies in whatever
created the broken symlink in the first place.

So I'm going to close this one. All the best,
Karl




Added tag(s) wontfix. Request was from Karl Berry <karl <at> freefriends.org> to control <at> debbugs.gnu.org. (Wed, 31 Jan 2024 22:48:04 GMT) Full text and rfc822 format available.

Reply sent to Karl Berry <karl <at> freefriends.org>:
You have taken responsibility. (Wed, 31 Jan 2024 22:48:05 GMT) Full text and rfc822 format available.

Notification sent to Panaiotis Arnaud <Arnaud.Panaiotis.ext <at> vossloh.com>:
bug acknowledged by developer. (Wed, 31 Jan 2024 22:48:05 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 29 Feb 2024 12:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 28 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.