Project

General

Profile

Actions

Bug #9840

closed

[darwin] configure script fails if an empty file named `Info.plist` exists in the user's home directory

Added by pje (patrick ellis) over 10 years ago. Updated over 10 years ago.

Status:
Third Party's Issue
Assignee:
Target version:
-
ruby -v:
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
[ruby-core:62594]

Description

On OS X 10.9.2, the ruby-2.1.2 configure script fails if an empty file named Info.plist exists in the user's home directory.

Steps to reproduce:

#!/usr/bin/env bash

touch ~/Info.plist

[[ -f ruby-2.1.2.tar.gz ]] || curl --fail -o ruby-2.1.2.tar.gz -L http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz
[[ -d ruby-2.1.2 ]]        || tar xfz ruby-2.1.2.tar.gz

cd ruby-2.1.2

./configure

The last lines it prints before failing are:

checking whether LDFLAGS is valid... no
configure: error: something wrong with LDFLAGS=""

The generated config.log has an error message from dsymutil when validating LDFLAGS:

configure:7100: checking whether LDFLAGS is valid
configure:7113: clang -o conftest -g -O2    conftest.c  >&5
2014-05-14 12:28:59.987 dsymutil[38379:303] There was an error parsing the Info.plist for the bundle at URL Info.plist -- file:///Users/pje/
 The operation couldn’t be completed. (Cocoa error 3840.)
 <CFBasicHash 0x7fda79d013d0 [0x7fff70e21f00]>{type = immutable dict, count = 1,
entries =>
	0 : <CFString 0x7fff70e04e00 [0x7fff70e21f00]>{contents = "NSDebugDescription"} = <CFString 0x7fda79d01390 [0x7fff70e21f00]>{contents = "Cannot parse a NULL or zero-length data"}
}
configure:7113: $? = 0
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define CANONICALIZATION_FOR_MATHN 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:7118: result: no
configure:7120: error: something wrong with LDFLAGS=""

It looks like dsymutil is trying to read this empty plist file and fails multiple times during the configure step. It prints an error message multiple times, but only causes configure to fail during the LDFLAGS step, making it hard to debug.

Attached is config.log, which was generated from running the above code on my system.

I was able to reproduce this bug for all major ruby versions > 2.0.0.

Just for completeness's sake, here is the output of brew config from the my system:

HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew
HEAD: 724a7f84d853e978b694555ee61198c75fe409b1
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: dual-core 64-bit penryn
OS X: 10.9.2-x86_64
Xcode: 5.1.1
CLT: 5.1.0.0.1.1396320587
Clang: 5.1 build 503
X11: 2.7.5 => /opt/X11
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby

Files

config.log (21.1 KB) config.log pje (patrick ellis), 05/14/2014 07:30 PM

Updated by nobu (Nobuyoshi Nakada) over 10 years ago

It seems to occur only when running configure under the home directory.
Very strange.

Updated by fedya (Alexander Khryukin) over 10 years ago

Same issue for me.


checking minix/config.h presence... no

checking for minix/config.h... no

checking whether it is safe to define __EXTENSIONS__... yes

checking for cd using physical directory... cd -P

checking whether CFLAGS is valid... no

configure: error: something wrong with CFLAGS="-O2 -Wa,--compress-debug-sections -gdwarf-4 -fvar-tracking-assignments -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fPIC  -fweb -frename-registers -Wl,-O2,-z,combreloc,-z,relro,--enable-new-dtags,--hash-style=gnu "

Full buildlog here
http://file-store.rosalinux.ru/api/v1/file_stores/798c626eebafd0ffe3d945ebcba0f26e8b61ac09.log?show=true

part of config.log

configure:7019: result: yes
configure:7051: checking for cd using physical directory
configure:7066: result: cd -P
configure:7084: checking whether CFLAGS is valid
configure:7097: aarch64-openmandriva-linux-gnu-gcc -c -O2 -Wa,--compress-debug-sections -gdwarf-4 -fvar-tracking-assignments -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fPIC  -fweb -frename-registers -Wl,-O2,-z,combreloc,-z,relro,--enable-new-dtags,--hash-style=gnu   conftest.c >&5
conftest.c:1:0: warning: -fstack-protector not supported for this target [enabled by default]
 /* confdefs.h */

Btw i found a way to trick ruby build
i removed -fstack-protector from my CFLAGS and build started.
But need a proper fix.

Updated by fedya (Alexander Khryukin) over 10 years ago

workaround for ruby bug

https://abf.io/openmandriva/ruby/blob/master/ruby.spec#L316

CFLAGS=`echo %{optflags} | sed 's/-fomit-frame-pointer//' | sed 's/-fstack-protector//'`

Updated by nobu (Nobuyoshi Nakada) over 10 years ago

  • Status changed from Open to Third Party's Issue

Why not remove the invalid file?

Updated by pje (patrick ellis) over 10 years ago

Nobuyoshi Nakada wrote:

It seems to occur only when running configure under the home directory. Very strange.

Yes, but it also happens when running configure under any subdirectory of the user's home directory. That's one of the reasons the error message so confusing. I didn't write that in the bug description, but running the Reproduction script I included gives the same behavior in any subdirectory.

Nobuyoshi Nakada wrote:

Why not remove the invalid file?

Yes, that fixes the build. But configure shouldn't be dying because there's an empty Info.plist in a parent directory, should it? At least the error message should be clearer. Even after reading through config.log, it's not obvious that the dsymutil error is relevant, because it appears multiple times.

Updated by nobu (Nobuyoshi Nakada) over 10 years ago

patrick ellis wrote:

Nobuyoshi Nakada wrote:

Why not remove the invalid file?

Yes, that fixes the build. But configure shouldn't be dying because there's an empty Info.plist in a parent directory, should it? At least the error message should be clearer. Even after reading through config.log, it's not obvious that the dsymutil error is relevant, because it appears multiple times.

Anyway you can't build anything with wrong Info.plist, can you?

Updated by pje (patrick ellis) over 10 years ago

Nobuyoshi Nakada wrote:

patrick ellis wrote:

Nobuyoshi Nakada wrote:

Why not remove the invalid file?

Yes, that fixes the build. But configure shouldn't be dying because there's an empty Info.plist in a parent directory, should it? At least the error message should be clearer. Even after reading through config.log, it's not obvious that the dsymutil error is relevant, because it appears multiple times.

Anyway you can't build anything with wrong Info.plist, can you?

Not sure I follow—the Info.plist was in a separate directory from where I'm configuring ruby. It hadn't caused any problems with other software's configure scripts.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0