Page MenuHome GnuPG

GNUPGHOME not set to the cwd
Closed, ResolvedPublic

Description

In T2101, it was reported that the build failed with the error the
GNUGHOME was not set to the cwd. The same issue occurred in our build. The
problem is that the files tests/inittests, openpgp/defs.inc,
pkits/common.sh, and pkits/inittests all compare the output of /bin/pwd,
which does not canonicalize the pathname, to set GNUPGHOME. Meanwhile,
openpgp/Makefile.am uses $(abs_builddir), which does canonicalize the
pathname, to set GNUPGHOME. The GnuPG build process could be made more
robust by either consistently either by deriving these values such that the
pathname is never canonicalized, or such that it always is.

Details

Version
2.1.7

Event Timeline

/bin/pwd always prints the full name of the cwd. Thus I do not understand your
report. Can you please elaborate and describe your OS.

/bin/pwd does produce the full name off the current directory, but it doesn't
canonicalize it, taking into account symlinks, the way $(readlink -f) does.
Thus, the comparisons may fail, and that's what happened in the case of our
build.

Right, /bin/pwd defaults to -P but the shell internal may have a different
default. I checked autoconf and automake and they always use just pwd. The
shell code in our Makefiles should reflect this of course.

See also T1001 for the reason why we use /bin/pwd .

Justus: This is mostly about the test suite, can you please take care of this bug?

werner added a project: Tests.
werner added a project: gnupg.
werner added a subscriber: justus.

I tried to reproduce this problem, and failed. Can you provide more information
about your build environment, and how to reproduce this problem?

I would also be fine just to add -L to any call to /bin/pwd in our tests. Note
that most tests are in tests/openpgp, and that set of tests changed radically
since 2.1.7, and the new version should not be affected (tests/ and tests/pkits
are mostly stubs anyway).

The test framework changed considerably, and the reporter is not responding with details. I don't believe this is applicable anymore. I'm closing this task. Feel free to reopen with more information.