You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Bert Huijben <rh...@sharpsvn.net> on 2009/10/10 16:51:54 UTC

RE: svn commit: r39926 - trunk

> -----Original Message-----
> From: Daniel Shahaf [mailto:tigris@danielsh.fastmail.net]
> Sent: zaterdag 10 oktober 2009 15:39
> To: svn@subversion.tigris.org
> Subject: svn commit: r39926 - trunk
> 
> Author: danielsh
> Date: Sat Oct 10 06:38:56 2009
> New Revision: 39926
> 
> Log:
> Fix the Windows build.
> 
> * build.conf (libsvn_subr):  Export svn_debug.h.

This fixes the Windows shared library build for debug mode, but it breaks
the Windows build for release mode.. See the buildbots.

libsvn_subr.def : error LNK2001: unresolved external symbol
svn_dbg__preamble
libsvn_subr.def : error LNK2001: unresolved external symbol svn_dbg__printf
..\..\..\Release\subversion\libsvn_subr\libsvn_subr-1.lib : fatal error
LNK1120: 2 unresolved externals

	Bert

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2405924

Re: svn commit: r39926 - trunk

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Greg Stein wrote on Sat, 10 Oct 2009 at 15:58 -0400:
> On Sat, Oct 10, 2009 at 14:23, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> > [[[
> > Index: subversion/include/private/svn_debug.h
> > ===================================================================
> > --- subversion/include/private/svn_debug.h      (revision 39926)
> > +++ subversion/include/private/svn_debug.h      (working copy)
> > @@ -83,5 +83,8 @@ svn_dbg__printf(const char *fmt, ...);
> >  }
> >  #endif /* __cplusplus */
> >
> > +#else /* SVN_DEBUG */
> > +#define SVN_DBG(ARGS) /* nothing */
> >  #endif /* SVN_DEBUG */
> > +
> >  #endif /* SVN_DEBUG_H */
> 
> I don't think the header should change at all. SVN_DBG() should never
> be left in (released) code. It is only for developers to use locally.
> 

In this case, shouldn't we define it to error in release builds?  Right 
now it simply causes a "SVN_DBG(x) not declared" error.

e.g.,

#ifndef SVN_DEBUG
#define SVN_DBG(ARGS) #error "Don't use SVN_DBG in release builds"
#define SVN_DBG(ARGS) SVN_ERR_MALFUNCTION()
#endif

(yes, that #error will not become a preprocessor-time error, I know)


> > Index: subversion/libsvn_subr/debug.c
> > ===================================================================
> > --- subversion/libsvn_subr/debug.c      (revision 39926)
> > +++ subversion/libsvn_subr/debug.c      (working copy)
> > @@ -21,9 +21,6 @@
> >  * ====================================================================
> >  */
> >
> > -/* These functions are only available to SVN developers.  */
> > -#ifdef SVN_DEBUG
> > -
> 
> This change should be fine. The functions will be around, but unused.
> Or, as Bert noted, some "third party" code might compile with
> SVN_DEBUG and still have these functions available.
> 

Already committed by Bert in r39935.  (Thanks, Bert.)

> >...
> > +++ subversion/svnversion/main.c        (working copy)
> > @@ -26,6 +26,8 @@
> >  #include "svn_utf.h"
> >  #include "svn_opt.h"
> >
> > +#include "private/svn_debug.h"
> 
> This is never needed. It's done automatically at the end of svn_types.h
> 

I know... but was too tired and decided to add it anyway (couldn't hurt).

> >...
> 
> Cheers,
> -g
> 
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2406216
>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2406282

Re: svn commit: r39926 - trunk

Posted by Greg Stein <gs...@gmail.com>.
On Sat, Oct 10, 2009 at 14:23, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
>...
> Something like this?  I tested it and it doesn't behave as I expected it
> to; but I'm too confused to decide whether it's because the patch is bad
> or because I'm not rebuilding correctly.
>
> I should get some rest now...
>
> Daniel
>
> [[[
> Index: subversion/include/private/svn_debug.h
> ===================================================================
> --- subversion/include/private/svn_debug.h      (revision 39926)
> +++ subversion/include/private/svn_debug.h      (working copy)
> @@ -83,5 +83,8 @@ svn_dbg__printf(const char *fmt, ...);
>  }
>  #endif /* __cplusplus */
>
> +#else /* SVN_DEBUG */
> +#define SVN_DBG(ARGS) /* nothing */
>  #endif /* SVN_DEBUG */
> +
>  #endif /* SVN_DEBUG_H */

I don't think the header should change at all. SVN_DBG() should never
be left in (released) code. It is only for developers to use locally.

> Index: subversion/libsvn_subr/debug.c
> ===================================================================
> --- subversion/libsvn_subr/debug.c      (revision 39926)
> +++ subversion/libsvn_subr/debug.c      (working copy)
> @@ -21,9 +21,6 @@
>  * ====================================================================
>  */
>
> -/* These functions are only available to SVN developers.  */
> -#ifdef SVN_DEBUG
> -

This change should be fine. The functions will be around, but unused.
Or, as Bert noted, some "third party" code might compile with
SVN_DEBUG and still have these functions available.

>...
> +++ subversion/svnversion/main.c        (working copy)
> @@ -26,6 +26,8 @@
>  #include "svn_utf.h"
>  #include "svn_opt.h"
>
> +#include "private/svn_debug.h"

This is never needed. It's done automatically at the end of svn_types.h

>...

Cheers,
-g

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2406216

RE: svn commit: r39926 - trunk

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Bert Huijben wrote on Sat, 10 Oct 2009 at 19:26 +0200:
> 
> 
> > -----Original Message-----
> > From: Daniel Shahaf [mailto:d.s@daniel.shahaf.name]
> > Sent: zaterdag 10 oktober 2009 19:15
> > To: Bert Huijben
> > Cc: dev@subversion.tigris.org; svn@subversion.tigris.org
> > Subject: RE: svn commit: r39926 - trunk
> > 
> > Bert Huijben wrote on Sat, 10 Oct 2009 at 18:51 +0200:
> > > > Fix the Windows build.
> > > >
> > > > * build.conf (libsvn_subr):  Export svn_debug.h.
> > >
> > > This fixes the Windows shared library build for debug mode, but it
> > breaks
> > > the Windows build for release mode.. See the buildbots.
> > >
> > 
> > Thanks, I haven't noticed they broke.
> > 
> > > libsvn_subr.def : error LNK2001: unresolved external symbol
> > > svn_dbg__preamble
> > > libsvn_subr.def : error LNK2001: unresolved external symbol
> > svn_dbg__printf
> > > ..\..\..\Release\subversion\libsvn_subr\libsvn_subr-1.lib : fatal
> > error
> > > LNK1120: 2 unresolved externals
> > >
> > 
> > What do you suggest then?  Without this change I get the same error
> > when
> > I try to use SVN_DBG in debug builds.
> > 
> > Could we just define the svn_dbg__* functions unconditionally?  (and
> > make them no-ops if SVN_DEBUG is not defined)
> 
> I think that would be safe. But we might just define them always as the
> macros remove the call sites anyway. (And this would allow using them from a
> debug mode application compiled against a release library).
> 

Something like this?  I tested it and it doesn't behave as I expected it
to; but I'm too confused to decide whether it's because the patch is bad
or because I'm not rebuilding correctly.

I should get some rest now...

Daniel

[[[
Index: subversion/include/private/svn_debug.h
===================================================================
--- subversion/include/private/svn_debug.h	(revision 39926)
+++ subversion/include/private/svn_debug.h	(working copy)
@@ -83,5 +83,8 @@ svn_dbg__printf(const char *fmt, ...);
 }
 #endif /* __cplusplus */
 
+#else /* SVN_DEBUG */
+#define SVN_DBG(ARGS) /* nothing */
 #endif /* SVN_DEBUG */
+
 #endif /* SVN_DEBUG_H */
Index: subversion/libsvn_subr/debug.c
===================================================================
--- subversion/libsvn_subr/debug.c	(revision 39926)
+++ subversion/libsvn_subr/debug.c	(working copy)
@@ -21,9 +21,6 @@
  * ====================================================================
  */
 
-/* These functions are only available to SVN developers.  */
-#ifdef SVN_DEBUG
-
 #include <stdarg.h>
 
 #include "svn_types.h"
@@ -78,5 +75,3 @@ svn_dbg__printf(const char *fmt, ...)
   va_end(ap);
 }
 
-
-#endif /* SVN_DEBUG */
Index: subversion/svnversion/main.c
===================================================================
--- subversion/svnversion/main.c	(revision 39926)
+++ subversion/svnversion/main.c	(working copy)
@@ -26,6 +26,8 @@
 #include "svn_utf.h"
 #include "svn_opt.h"
 
+#include "private/svn_debug.h"
+
 #include "svn_private_config.h"
 
 #define SVNVERSION_OPT_VERSION SVN_OPT_FIRST_LONGOPT_ID
@@ -210,6 +212,8 @@ main(int argc, const char *argv[])
       return EXIT_FAILURE;
     }
 
+  SVN_DBG(("done options parsing\n"));
+
   SVN_INT_ERR(svn_utf_cstring_to_utf8
               (&wc_path, (os->ind < argc) ? os->argv[os->ind] : ".",
                pool));
]]]

> 	Bert
> 
>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2406124

RE: svn commit: r39926 - trunk

Posted by Bert Huijben <rh...@sharpsvn.net>.
> -----Original Message-----
> From: Daniel Shahaf [mailto:d.s@daniel.shahaf.name]
> Sent: zaterdag 10 oktober 2009 19:15
> To: Bert Huijben
> Cc: dev@subversion.tigris.org; svn@subversion.tigris.org
> Subject: RE: svn commit: r39926 - trunk
> 
> Bert Huijben wrote on Sat, 10 Oct 2009 at 18:51 +0200:
> > > Fix the Windows build.
> > >
> > > * build.conf (libsvn_subr):  Export svn_debug.h.
> >
> > This fixes the Windows shared library build for debug mode, but it
> breaks
> > the Windows build for release mode.. See the buildbots.
> >
> 
> Thanks, I haven't noticed they broke.
> 
> > libsvn_subr.def : error LNK2001: unresolved external symbol
> > svn_dbg__preamble
> > libsvn_subr.def : error LNK2001: unresolved external symbol
> svn_dbg__printf
> > ..\..\..\Release\subversion\libsvn_subr\libsvn_subr-1.lib : fatal
> error
> > LNK1120: 2 unresolved externals
> >
> 
> What do you suggest then?  Without this change I get the same error
> when
> I try to use SVN_DBG in debug builds.
> 
> Could we just define the svn_dbg__* functions unconditionally?  (and
> make them no-ops if SVN_DEBUG is not defined)

I think that would be safe. But we might just define them always as the
macros remove the call sites anyway. (And this would allow using them from a
debug mode application compiled against a release library).

	Bert

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2406015

RE: svn commit: r39926 - trunk

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Bert Huijben wrote on Sat, 10 Oct 2009 at 18:51 +0200:
> > Fix the Windows build.
> > 
> > * build.conf (libsvn_subr):  Export svn_debug.h.
> 
> This fixes the Windows shared library build for debug mode, but it breaks
> the Windows build for release mode.. See the buildbots.
> 

Thanks, I haven't noticed they broke.

> libsvn_subr.def : error LNK2001: unresolved external symbol
> svn_dbg__preamble
> libsvn_subr.def : error LNK2001: unresolved external symbol svn_dbg__printf
> ..\..\..\Release\subversion\libsvn_subr\libsvn_subr-1.lib : fatal error
> LNK1120: 2 unresolved externals
> 

What do you suggest then?  Without this change I get the same error when
I try to use SVN_DBG in debug builds.

Could we just define the svn_dbg__* functions unconditionally?  (and
make them no-ops if SVN_DEBUG is not defined)

> 	Bert
> 
>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2405981