Closed Bug 520098 Opened 11 years ago Closed 10 years ago

Darwin build fails on new quota check from bug 72892 (nsLocalFileUnix.cpp)

Categories

(Core :: XPCOM, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: niederstrasser, Assigned: niederstrasser)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
Build Identifier: 

Building mozilla-central on Darwin fails after the checkin from bug 72892.

First, it crashes because sys/sysparams.h does not exist on Darwin.  I can get around that by having it searched for in ./configure.in, but even after patching that, the build fails with:

g++-4.2 -arch i386 -o nsLocalFileUnix.o -c -fvisibility=hidden -DMOZILLA_INTERNAL_API -DOSTYPE=\"Darwin\" -DOSARCH=Darwin -D_IMPL_NS_COM -I.. -I/src/mozilla-central/xpcom/io -I. -I../../dist/include -I../../dist/include/nsprpub  -I/src/mozilla-central/obj-i386-apple-darwin9.8.0-browser/dist/include/nspr -I/src/mozilla-central/obj-i386-apple-darwin9.8.0-browser/dist/include/nss -I/sw/include      -fPIC  -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-long-long -isysroot /Developer/SDKs/MacOSX10.5.sdk -fno-strict-aliasing -fpascal-strings -fno-common -fshort-wchar -pthread  -DNDEBUG -DTRIMMED -O3   -DMOZILLA_CLIENT -include ../../mozilla-config.h -Wp,-MD,.deps/nsLocalFileUnix.pp /src/mozilla-central/xpcom/io/nsLocalFileUnix.cpp
/src/mozilla-central/xpcom/io/nsLocalFileUnix.cpp: In member function ‘virtual nsresult nsLocalFile::GetDiskSpaceAvailable(PRInt64*)’:
/src/mozilla-central/xpcom/io/nsLocalFileUnix.cpp:1238: error: invalid conversion from ‘int’ to ‘const char*’
/src/mozilla-central/xpcom/io/nsLocalFileUnix.cpp:1238: error:   initializing argument 1 of ‘int quotactl(const char*, int, int, char*)’
/src/mozilla-central/xpcom/io/nsLocalFileUnix.cpp:1238: error: invalid conversion from ‘const char*’ to ‘int’
/src/mozilla-central/xpcom/io/nsLocalFileUnix.cpp:1238: error:   initializing argument 2 of ‘int quotactl(const char*, int, int, char*)’
make[1]: *** [nsLocalFileUnix.o] Error 1
make[1]: Leaving directory `/src/mozilla-central/obj-i386-apple-darwin9.8.0-browser/xpcom/io'

Backing out the patches from bug 72892 lets the build go to completion.

Reproducible: Always
Correction: that should have been sys/sysmacros.h in comment #0.
Version: unspecified → Trunk
Attached patch workaroundSplinter Review
This works around the build crash by basically #if defining out the changes from bug 72892.
Hm, I really don't have idea how is quotactl supported on Mac and don't have a chance to get this platform...
Martin,

http://developer.apple.com/mac/library/DOCUMENTATION/Darwin/Reference/ManPages/man2/quotactl.2.html

has the man page.  I don't know if that'll help though.  Although I can't program for fixes, I will gladly test possible patches.
Duplicate of this bug: 569092
This is inside a HAVE_SYS_QUOTA_H block, which seems wrong. We should probably be testing for sys/sysmacros.h in configure as well.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Ted, isn't that what the 'workaround' attachment 404168 [details] [diff] [review] does?  It adds +AC_CHECK_HEADERS(sys/sysmacros.h) in configure.in.

It also changes a HAVE_SYS_QUOTA_H block:

-#if defined(HAVE_SYS_STAT_H) || defined(HAVE_SYS_QUOTA_H)
+#if defined(HAVE_SYS_STAT_H) || defined(HAVE_SYS_SYSMACROS_H)

in xpcom/io/nsLocalFileUnix.cpp. Or do you mean moving #including <sys/sysmacros.h> outside the HAVE_SYS_QUOTA_H block earlier in the file?
Sorry, I didn't actually look at your workaround patch!
Assignee: nobody → niederstrasser
Attachment #404168 - Flags: review?(benjamin)
Attachment #404168 - Flags: review?(benjamin) → review+
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/f9aceff48e1b
Status: NEW → RESOLVED
Closed: 10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
(attachment 404168 [details] [diff] [review])
> -#if defined(HAVE_SYS_STAT_H) || defined(HAVE_SYS_QUOTA_H)
> +#if defined(HAVE_SYS_STAT_H) || defined(HAVE_SYS_SYSMACROS_H)

This breaks on Android which has <sys/sysmacros.h> but not <sys/quota.h>.

The code inside the #if statement requires <sys/quota.h>.  It does not necessarily require <sys/sysmacros.h>.  (On Linux this file defines "major" and "minor" but on both Linux and BSD they are included in <sys/types.h> which is already included in this file.)
Depends on: 571440
Filed bug 571440 for the Android breakage.
You need to log in before you can comment on or make changes to this bug.