Score:0

./configure: error: working directory cannot be determined

in flag

I am extremely frustrated with this error. now it is worth noting that running cd "$(pwd)" and echoing all environment variables, everything seems in order.

I am currently trying to install unrealircd 5.2.0.1 (BUT I get this error when running ANYTHING involving ./configure script)

Here is my output for pretense on my error:

 _   _                      _ ___________  _____     _
| | | |                    | |_   _| ___ \/  __ \   | |
| | | |_ __  _ __ ___  __ _| | | | | |_/ /| /  \/ __| |
| | | | '_ \| '__/ _ \/  _ | | | | |    / | |    /  _ |
| |_| | | | | | |  __/ (_| | |_| |_| |\ \ | \__/\ (_| |
 \___/|_| |_|_|  \___|\__,_|_|\___/\_| \_| \____/\__,_|

                               Configuration Program
                                for UnrealIRCd 5.2.0.1
[SNIP]
Would you like to pass any custom parameters to configure?
Most people don't need this and can just press ENTER.
Otherwise, see `./configure --help' and write them here:
[] ->
Running with 4 concurrent build processes by default (make -j4).
./configure --with-showlistmodes --enable-ssl --with-maxconnections=9999999 --with-bindir=/root/unrealircd/bin --with-datadir=/root/unrealircd/data --with-pidfile=/root/unrealircd/data/unrealircd.pid --with-confdir=/root/unrealircd/conf --with-modulesdir=/root/unrealircd/modules --with-logdir=/root/unrealircd/logs --with-cachedir=/root/unrealircd/cache --with-docdir=/root/unrealircd/doc --with-tmpdir=/root/unrealircd/tmp --with-privatelibdir=/root/unrealircd/lib --with-scriptdir=/root/unrealircd --with-nick-history=100 --with-permissions=0600 --enable-dynamic-linking
configure: error: working directory cannot be determined

now like i said, I get this error when installing ANYTHING involving a ./configure script. it is also worth noting that as any user I am unable to run ./configure, with same said errors.

cating /etc/passwd says proper home directory for said users.

Now what is my problem here?

cn flag
Ray
Does "when installing ANYTHING involving a ./configure" mean that any `configure` script, not just for the program you mentioned above, causes the above problem? Also, your issue isn't related to `g++`, `gcc`, or `cmake` (as far as I can tell). So, I've removed them from your tags.
Freak avatar
in flag
any configure script
HuHa avatar
es flag
Are you running this as root? Don't do that. The final part (`make install`) needs root permissions, and that should be run as `sudo make install`. But certainly **not** the `./configure` part or the `make` part. You are opening the door wide to any attackers.
HuHa avatar
es flag
"any configure script" is a bold claim. I don't believe that. I am pretty sure this is limited to _this_ configure script.
hr flag
If it really *is* "any configure script" then that suggests a problem with the autoconf `_AC_INIT_DIRCHECK` macro (or one of the commands it relies on - `pwd`, `ls`, `cd`)
Freak avatar
in flag
My pwd, ls and cd all are working as expected. and this error is not limited to just _this_ configure script. How can I fix/change my _AC_INIT_DIRCHECK macro? is this an environment variable?
hr flag
@Freak I have added an answer with some information and debugging tips below
Score:1
es flag

The documentation clearly says:

https://www.unrealircd.org/docs/FAQ#Compile.2Fbuild_problems

Compile/build problems

I ran ./configure and got tons of problems

Do NOT use ./configure! Run ./Config instead.

https://www.unrealircd.org/docs/Installing_from_source

Compiling

First, run the ./Config script which will ask a number of questions. You can just press Enter to accept the default answers.

./Config

Now, compile UnrealIRCd by running make, this may take a minute (or two):

make

Freak avatar
in flag
I was using ./Config, it runs configure as a part of its execution. it only runs ./configure in the end of it. and like i said, this error comes along with executing other scripts that use ./configure.
Score:0
hr flag

By convention, configure is a POSIX shell script that is created from a configure.ac or configure.in template file by the GNU autoconf program - either at install time or before distribution by the software's maintainer.

The error message

configure: error: working directory cannot be determined

comes from a standard autoconf macro named _AC_INIT_DIRCHECK and defined in /usr/share/autoconf/autoconf/general.m4:

AC_DEFUN([_AC_INIT_DIRCHECK],
[m4_divert_push([PARSE_ARGS])dnl

ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
  AC_MSG_ERROR([working directory cannot be determined])
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
  AC_MSG_ERROR([pwd does not report name of working directory])

You may find more detailed information about the cause of the error in the config.log file. Alternatively, you can run the same code in a non-interactive POSIX shell as follows:

/bin/sh -c '
  ac_pwd=`pwd` && test -n "$ac_pwd" && 
  ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .`
'
echo $?

or broken down into its individual parts like

/bin/sh -c 'ac_pwd=`pwd` && test -n "$ac_pwd"'; echo $?

One possibility for failure is that the working directory does not have the executable bit set:

$ chmod -x .

$ /bin/sh -c '
  ac_pwd=`pwd` && test -n "$ac_pwd" &&
  ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .`
'
/bin/sh: 1: cd: can't cd to /home/steeldriver/src/unrealircd
Freak avatar
in flag
when debugging this I get the following error code: 255, any idea what this means? Also this answer has been very helpful in debugging my environment.
hr flag
@Freak can you break it down and determine which command is returning status code 255? Ex. `/bin/sh -c 'ac_pwd=$(pwd)'; echo $?` then `/bin/sh -c 'ac_pwd=$(pwd) && test -n "$ac_pwd"'; echo $?` etc.
hr flag
... and just to add, I don't think 255 is a standard program exit status, I can't really guess what might be producing that
Freak avatar
in flag
I was just able to edit the configure script for unrealircd and I have fixed my issue.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.