/fileutils/stdio-wrappers fails if run from shell cwd that has symlinks
@dmacks
Submitted by Daniel Macks Link to original bug (#731695)
Description
Building glib-2.40.0 on OS X 10.8 in /tmp, glib/tests/fileutils failed in its /fileutils/stdio-wrappers test. I added printf for cwd and path in that test. Running ./fileutils directly, I got:
/fileutils/stdio-wrappers: cwd= '/private/tmp/live-build/glib-2.40.0/glib/tests/mkdir-test' path='/tmp/live-build/glib-2.40.0/glib/tests/mkdir-test' ** GLib:ERROR:fileutils.c:871:test_stdio_wrappers: assertion failed: (g_str_equal (cwd, path)) Abort
OS X's user "/tmp" (where I had 'cd'ed to unpack/build/test) is actually a symlink to /private/tmp, so it looks like confusion between the actual location (with symlink resolved) vs the shell's concept of cwd ('cd /tmp; echo $PWD' gives /tmp). To rule out /tmp being special, I unpacked and built glib in a real subdir of my home directory (no symlinks anywhere in the path), and the test passes:
/fileutils/stdio-wrappers: cwd= '/Users/dmacks/live-build/glib-2.40.0/glib/tests/mkdir-test' path='/Users/dmacks/live-build/glib-2.40.0/glib/tests/mkdir-test' OK
then I created /Users/dmacks/live-build/glib-2.40.0_testing as a symlink to glib-2.40.0, and cd'ing into /tests in via that path, the test fails:
/fileutils/stdio-wrappers: cwd= '/Users/dmacks/live-build/glib-2.40.0/glib/tests/mkdir-test' path='/Users/dmacks/live-build/glib-2.40.0_testing/glib/tests/mkdir-test' ** GLib:ERROR:fileutils.c:871:test_stdio_wrappers: assertion failed: (g_str_equal (cwd, path)) Abort
Version: 2.40.x