Getting this very bizarre error from libtool when trying to install a package I built. It happens when running in a subdirectory (src/api) of the source tree:
make[5]: Leaving directory '/users/galac/embray/src/slurm/src/api'
/bin/mkdir -p '/usr/local/lib'
/bin/bash ../../libtool --mode=install /usr/bin/install -c libslurm.la '/usr/local/lib'
../../libtool: line 929: cd: ../..: Not a directory
The relevant section of libtool looks like this:
914 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
915 # is ksh but when the shell is invoked as "sh" and the current value of
916 # the _XPG environment variable is not equal to 1 (one), the special
917 # positional parameter $0, within a function call, is the name of the
918 # function.
919 progpath=$0
920
921 # The name of this program.
922 progname=`$ECHO "$progpath" |$SED "$sed_basename"`
923
924 # Make sure we have an absolute progpath for reexecution:
925 case $progpath in
926 [\\/]*|[A-Za-z]:\\*) ;;
927 *[\\/]*)
928 progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
929 progdir=`cd "$progdir" && pwd`
930 progpath=$progdir/$progname
931 ;;
932 *)
933 _G_IFS=$IFS
934 IFS=${PATH_SEPARATOR-:}
935 for progdir in $PATH; do
936 IFS=$_G_IFS
937 test -x "$progdir/$progname" && break
938 done
939 IFS=$_G_IFS
940 test -n "$progdir" || progdir=`pwd`
941 progpath=$progdir/$progname
942 ;;
943 esac
If I insert set -x into the script around this section, I see the following trace:
+ progpath=../../libtool
++ printf '%s\n' ../../libtool
++ /bin/sed 's|^.*/||'
+ progname=libtool
+ case $progpath in
++ printf '%s\n' ../../libtool
++ /bin/sed 's|/[^/]*$||'
+ progdir=../..
++ cd ../..
../../libtool: line 930: cd: ../..: Not a directory
+ progdir=
+ progpath=/libtool
...
this leads to further errors since it does not set progpath=../../libtool, the correct path for libtool itself (in the top-level source dir). It also seems to be correctly setting progdir=../... So why is ../.. not a directory?
Clearly it looks fine if I check manually:
~/src/slurm/src/api$ ls -ld ../..
drwxr-xr-x 11 xxxxxx xxxxx 4096 May 14 14:52 ../..
It is not a symlink or anything like that.
Never seen anything like this in my 20 years of development.