Closed Bug 31779 Opened 25 years ago Closed 23 years ago

Cant use debug xpcom with release other libs using it and viceversa

Categories

(Core :: XPCOM, defect, P3)

x86
All
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: dp, Assigned: scc)

Details

Attachments

(1 file)

------- Additional Comments From jonas.utterstrom@vittran.norrnod.se 2000-03-13 
23:10 -------

I think that before Mozilla is released something must be done to nsCOMPtr.h so 
that I can use the Mozilla release libraries with my debug build application. 
And of course the other way around.
A non-debug XPCOM library may work with your developer-specific debug library out 
of the box.  Of course, the debug XPCOM library won't really be a release ... or 
will it?  In either case, you can arbitrarily control debug vs. non-debug 
versions in the face of |nsCOMPtr| by setting |NSCAP_DISABLE_DEBUG_PTR_TYPES| 
uniformly across your builds.  If you need a debug XPCOM library to work with 
release external libraries, just build the debug XPCOM library with this symbol 
defined.  This setting really has no effect on a library that is already release.  
It merely disables one thing about |nsCOMPtr|s that is different in a debug 
build, and makes it be the same as it would be in a release build.  Other 
debugging facilities remain.

So the short answer is: your debug libraries may already work with a release 
XPCOM dll, if they don't, also define |NSCAP_DISABLE_DEBUG_PTR_TYPES| when 
building your library.  Also use this flag when trying to build a debug XPCOM dll 
to work with your release external libraries.  Nothing needs to be done to the 
release XPCOM dll.  Therefore, there's nothing to fix in this bug.  Hope this 
helps.
Status: NEW → RESOLVED
Closed: 25 years ago
OS: Windows NT → All
Resolution: --- → INVALID
Target Milestone: M14
I wonder if you have tried the define (NSCAP_FEATURE_TEST_DONTQUERY_CASES or
NSCAP_DISABLE_DEBUG_PTR_TYPES) in an application outside Mozilla? Just try it,
or I can send you a sample. I have never got it to work and I always end up with
linking errors. The only solution I have found so far is to set NS_DEBUG or
DEBUG. Unfortunately, setting NS_DEBUG gives some annoying warnings, see
http://bugzilla.mozilla.org/show_bug.cgi?id=31548. But dp@netscape.com didn't
like my solution and filed this bug instead. Setting DEBUG is very unattractive
to me since it is widely used as a debugging define in many applications and
also in mine. This makes it hard to combine release and debug builds.

I don't want to make a too big deal of this. I just wanted to remove some
annoying warnings when I use the NS_DEBUG define. I also want to make it easier
for other outsiders to use the Mozilla components from their own applications,
i.e. they should not need to know that the NSCAP_FEATURE_TEST_DONTQUERY_CASES
must be defined.
 
I have not tried it in an application outside of Mozilla.  Please do send me the 
errors.  I really want this to be the solution.  If this solution is broken, I 
will fix it.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
I hope you sit in UNIX, since this application uses autoconf.
To compile: 
./configure --with-mozilla={Path to mozilla}
make

The Mozilla build I use is the default debug version. Notice that I don't even
use nsCOMPtr myself in this application. So I can't avoid compilation errors
with refusing to use nsCOMPtr.
Sorry, it should be 
./configure --with-mozilla={path to Mozilla dist directory}
Pav, can you help me look at this problem on a *nix box of some kind?  We just 
need to look at Jonas' attachments, try to configure and build and examine the 
errors.  Then I can figure out what to do from there.
Target Milestone: M14 → M16
Target Milestone: M16 → M20
mass re-assigning to my new bugzilla account
Assignee: scc → scc
Status: REOPENED → NEW
Status: NEW → ASSIGNED
Jonas, what compile errors are you getting?  I tried your test case and it
worked fine for me once I fixed the one API change to NS_NewLocalFile().  But
you can only use NSCAP_DISABLE_DEBUG_PTR_TYPES on a non-debug xpcom library so
you'd want to detect that at configure time.  But I still think there needs to
be a better way of letting people mix-n-match debug & non-debug xpcom libs &
components even if that's going back to the idea of having a 'mozilla-config' or
'xpcom-config' script similar to 'glib-config' that will handle these issues for
the user.
QA Contact: leger → kandrot
Shaver, I thought you mentioned a fix for this problem (or a similar one) a
while back on irc.  Did those changes ever make it in?
I believe this has been resolved by brendan's checkin of shaver's patch from bug
77112. 
http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=mozilla/xpcom/base&command=DIFF_FRAMESET&file=nsCOMPtr.h&rev1=1.81&rev2=1.82&root=/cvsroot
Status: ASSIGNED → RESOLVED
Closed: 25 years ago23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: