You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by kf...@collab.net on 2006/02/15 15:47:02 UTC

Circular library dependency under Windows? (was: Re: svn commit: r18462 - in trunk/subversion: libsvn_fs libsvn_fs_base libsvn_fs_fs)

"Peter N. Lundblad" <pe...@famlundblad.se> writes regarding r18462:
> > Log:
> > Fix issue #2398: bogus pointer comparison led to server-side
> > assert failure.
> >
> > * subversion/libsvn_fs/fs-loader.h, subversion/libsvn_fs/fs-loader.c
> >   (svn_fs__same_p): New function.
> >
> > * subversion/libsvn_fs_fs/tree.c
> >   (copy_helper): Use above to check equality of the two filesystems,
> >   instead of depending on pointer equality.  Handle inequality by
> >   returning an error, instead of failing an assertion.
> >
> > * subversion/libsvn_fs_base/tree.c
> >   (copy_helper): Same.
>
> Hmmm, I thought such circular dependencies were not supported on
> Windows...

You mean having the lower-level library make calls into the
higher-level library?  Hmm, that's a good point.  It just compiled and
worked for me (Debian GNU/Linux), so I assumed there was no problem.

Can anyone with more Windows development experience say for sure?  If
necessary, I can trivially rewrite the change.  This would result in a
bit of duplicated code (sigh), but I can put comments to help keep the
duplicates in sync.

Thanks for the review, Peter.

-Karl

-- 
www.collab.net  <>  CollabNet  |  Distributed Development On Demand

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Circular library dependency under Windows?

Posted by Max Bowsher <ma...@ukf.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

kfogel@collab.net wrote:
> "Peter N. Lundblad" <pe...@famlundblad.se> writes regarding r18462:
>>> Log:
>>> Fix issue #2398: bogus pointer comparison led to server-side
>>> assert failure.
>>>
>>> * subversion/libsvn_fs/fs-loader.h, subversion/libsvn_fs/fs-loader.c
>>>   (svn_fs__same_p): New function.
>>>
>>> * subversion/libsvn_fs_fs/tree.c
>>>   (copy_helper): Use above to check equality of the two filesystems,
>>>   instead of depending on pointer equality.  Handle inequality by
>>>   returning an error, instead of failing an assertion.
>>>
>>> * subversion/libsvn_fs_base/tree.c
>>>   (copy_helper): Same.
>> Hmmm, I thought such circular dependencies were not supported on
>> Windows...
> 
> You mean having the lower-level library make calls into the
> higher-level library?  Hmm, that's a good point.  It just compiled and
> worked for me (Debian GNU/Linux), so I assumed there was no problem.
> 
> Can anyone with more Windows development experience say for sure?  If
> necessary, I can trivially rewrite the change.  This would result in a
> bit of duplicated code (sigh), but I can put comments to help keep the
> duplicates in sync.

Done, r18482.

The situation for Cygwin/Windows is: cyclic dependencies are ok in
_static_ libraries, but *not* ok in _shared_ libraries.

This means that the change broke Cygwin builds, because people often
build shared libraries on Cygwin, but didn't break Windows builds,
because we haven't managed to teach our buildsystem to build shared on
Windows yet.

Max.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)

iD8DBQFD9LqBfFNSmcDyxYARAgWqAJ43YhoamVkp5eWDJ9Iz4SMiWCkoVQCeJe9C
d0MEVddyCqCU5qY6cvOXnVU=
=M158
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Circular library dependency under Windows? (was: Re: svn commit: r18462 - in trunk/subversion: libsvn_fs libsvn_fs_base libsvn_fs_fs)

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
On 15 Feb 2006 09:47:02 -0600, kfogel@collab.net <kf...@collab.net> wrote:
> You mean having the lower-level library make calls into the
> higher-level library?  Hmm, that's a good point.  It just compiled and
> worked for me (Debian GNU/Linux), so I assumed there was no problem.

Some older BSD-ish linkers don't like circular library dependencies
either.  Linux is probably one of the few OSes that support circular
dependencies.  -- justin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Circular library dependency under Windows?

Posted by Max Bowsher <ma...@ukf.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Peter N. Lundblad wrote:
> On Thu, 16 Feb 2006, Malcolm Rowe wrote:
> 
>> On Wed, Feb 15, 2006 at 09:47:02AM -0600, kfogel@collab.net wrote:
>>> "Peter N. Lundblad" <pe...@famlundblad.se> writes regarding r18462:
>>>> Hmmm, I thought such circular dependencies were not supported on
>>>> Windows...
>>> You mean having the lower-level library make calls into the
>>> higher-level library?  Hmm, that's a good point.  It just compiled and
>>> worked for me (Debian GNU/Linux), so I assumed there was no problem.
>>>
>> I'm not absolutely certain if circular dependencies are the reason, but my Cygwin build now fails with:
>>
>> cd subversion/libsvn_fs_fs && /bin/sh /cygdrive/d/svn/svn-objdir/libtool --tag=CC --silent --mode=link gcc  -g -O2    -DSVN_DEBUG -DAP_DEBUG -Wpointer-arith -Wwrite-strings -Wshadow   -rpath /usr/local/lib -o libsvn_fs_fs-1.la -no-undefined dag.lo err.lo fs.lo fs_fs.lo id.lo key-gen.lo lock.lo revs-txns.lo tree.lo ../../subversion/libsvn_delta/libsvn_delta-1.la ../../subversion/libsvn_subr/libsvn_subr-1.la /usr/lib/libaprutil-0.la -lgdbm -ldb-4.2 -lexpat -liconv /usr/lib/libapr-0.la -lresolv -lcrypt -lz
>> Creating library file: .libs/libsvn_fs_fs-1.dll.a
>> .libs/tree.o: In function `copy_helper':
>> /cygdrive/d/svn/svn-objdir/../svn-trunk/subversion/libsvn_fs_fs/tree.c:1935: undefined reference to `_svn_fs__same_p'
>> /cygdrive/d/svn/svn-objdir/../svn-trunk/subversion/libsvn_fs_fs/tree.c:1937: undefined reference to `_svn_fs_path'
>> /cygdrive/d/svn/svn-objdir/../svn-trunk/subversion/libsvn_fs_fs/tree.c:1937: undefined reference to `_svn_fs_path'
>> collect2: ld returned 1 exit status
>> make: *** [subversion/libsvn_fs_fs/libsvn_fs_fs-1.la] Error 1
>>
> Probably. Fear maxb! (See r16017:-)

*grin*

I recall being a little irked when 'svn up' broke my build :-)


>> I do notice th following section in configure that implies that Cygwin
>> is the only platform that can't do circular linkage.
>>
>> AC_MSG_CHECKING([whether to avoid circular linkage at all costs])
>> case $host in
>>   *-*-cygwin*)
>>     AC_MSG_RESULT([yes])
>>     AC_DEFINE([SVN_AVOID_CIRCULAR_LINKAGE_AT_ALL_COSTS_HACK], 1,
>>               [Define if circular linkage is not possible on this platform.])
>>     ;;
>>   *)
>>     AC_MSG_RESULT([no])
>>     ;;
>> esac
>>
> 
> That long macro with a very very long name is only used in one place in
> the Swig bindings it seems.

Yes. My comprehension of the Perl bindings is inadequate to remove the
circular linkage by redesigning lots of stuff, so I opted for a kludgy,
but working solution.

Problem is, it's not suitable in all cases, because it would break
things if libsvn_swig_pl was built as a static library... which it is in
our Windows build.


Max.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)

iD8DBQFD9LwlfFNSmcDyxYARAhuSAKClU+Cv4ZJRSExmEQNXUT8H/Fbr/ACfVVQe
0hGpZgDBJCx8IJ2nt1/2m2o=
=6rxx
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Circular library dependency under Windows? (was: Re: svn commit: r18462 - in trunk/subversion: libsvn_fs libsvn_fs_base libsvn_fs_fs)

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Thu, 16 Feb 2006, Malcolm Rowe wrote:

> On Wed, Feb 15, 2006 at 09:47:02AM -0600, kfogel@collab.net wrote:
> > "Peter N. Lundblad" <pe...@famlundblad.se> writes regarding r18462:
> > > Hmmm, I thought such circular dependencies were not supported on
> > > Windows...
> >
> > You mean having the lower-level library make calls into the
> > higher-level library?  Hmm, that's a good point.  It just compiled and
> > worked for me (Debian GNU/Linux), so I assumed there was no problem.
> >
> I'm not absolutely certain if circular dependencies are the reason, but my Cygwin build now fails with:
>
> cd subversion/libsvn_fs_fs && /bin/sh /cygdrive/d/svn/svn-objdir/libtool --tag=CC --silent --mode=link gcc  -g -O2    -DSVN_DEBUG -DAP_DEBUG -Wpointer-arith -Wwrite-strings -Wshadow   -rpath /usr/local/lib -o libsvn_fs_fs-1.la -no-undefined dag.lo err.lo fs.lo fs_fs.lo id.lo key-gen.lo lock.lo revs-txns.lo tree.lo ../../subversion/libsvn_delta/libsvn_delta-1.la ../../subversion/libsvn_subr/libsvn_subr-1.la /usr/lib/libaprutil-0.la -lgdbm -ldb-4.2 -lexpat -liconv /usr/lib/libapr-0.la -lresolv -lcrypt -lz
> Creating library file: .libs/libsvn_fs_fs-1.dll.a
> .libs/tree.o: In function `copy_helper':
> /cygdrive/d/svn/svn-objdir/../svn-trunk/subversion/libsvn_fs_fs/tree.c:1935: undefined reference to `_svn_fs__same_p'
> /cygdrive/d/svn/svn-objdir/../svn-trunk/subversion/libsvn_fs_fs/tree.c:1937: undefined reference to `_svn_fs_path'
> /cygdrive/d/svn/svn-objdir/../svn-trunk/subversion/libsvn_fs_fs/tree.c:1937: undefined reference to `_svn_fs_path'
> collect2: ld returned 1 exit status
> make: *** [subversion/libsvn_fs_fs/libsvn_fs_fs-1.la] Error 1
>
Probably. Fear maxb! (See r16017:-)


> (Hmm, the immediate problem may just be that libsvn_fs isn't listed as
> a library for libsvn_fs_fs.  I've re-run autogen, it's not that.)
>

Ouch! Does our build system handle circular dependencies?

> I do notice th following section in configure that implies that Cygwin
> is the only platform that can't do circular linkage.
>
> AC_MSG_CHECKING([whether to avoid circular linkage at all costs])
> case $host in
>   *-*-cygwin*)
>     AC_MSG_RESULT([yes])
>     AC_DEFINE([SVN_AVOID_CIRCULAR_LINKAGE_AT_ALL_COSTS_HACK], 1,
>               [Define if circular linkage is not possible on this platform.])
>     ;;
>   *)
>     AC_MSG_RESULT([no])
>     ;;
> esac
>

That long macro with a very very long name is only used in one place in
the Swig bindings it seems.

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Circular library dependency under Windows? (was: Re: svn commit: r18462 - in trunk/subversion: libsvn_fs libsvn_fs_base libsvn_fs_fs)

Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Wed, Feb 15, 2006 at 09:47:02AM -0600, kfogel@collab.net wrote:
> "Peter N. Lundblad" <pe...@famlundblad.se> writes regarding r18462:
> > Hmmm, I thought such circular dependencies were not supported on
> > Windows...
> 
> You mean having the lower-level library make calls into the
> higher-level library?  Hmm, that's a good point.  It just compiled and
> worked for me (Debian GNU/Linux), so I assumed there was no problem.
> 
> Can anyone with more Windows development experience say for sure?  If
> necessary, I can trivially rewrite the change.  This would result in a
> bit of duplicated code (sigh), but I can put comments to help keep the
> duplicates in sync.
> 

I'm not absolutely certain if circular dependencies are the reason, but my Cygwin build now fails with:

cd subversion/libsvn_fs_fs && /bin/sh /cygdrive/d/svn/svn-objdir/libtool --tag=CC --silent --mode=link gcc  -g -O2    -DSVN_DEBUG -DAP_DEBUG -Wpointer-arith -Wwrite-strings -Wshadow   -rpath /usr/local/lib -o libsvn_fs_fs-1.la -no-undefined dag.lo err.lo fs.lo fs_fs.lo id.lo key-gen.lo lock.lo revs-txns.lo tree.lo ../../subversion/libsvn_delta/libsvn_delta-1.la ../../subversion/libsvn_subr/libsvn_subr-1.la /usr/lib/libaprutil-0.la -lgdbm -ldb-4.2 -lexpat -liconv /usr/lib/libapr-0.la -lresolv -lcrypt -lz
Creating library file: .libs/libsvn_fs_fs-1.dll.a
.libs/tree.o: In function `copy_helper':
/cygdrive/d/svn/svn-objdir/../svn-trunk/subversion/libsvn_fs_fs/tree.c:1935: undefined reference to `_svn_fs__same_p'
/cygdrive/d/svn/svn-objdir/../svn-trunk/subversion/libsvn_fs_fs/tree.c:1937: undefined reference to `_svn_fs_path'
/cygdrive/d/svn/svn-objdir/../svn-trunk/subversion/libsvn_fs_fs/tree.c:1937: undefined reference to `_svn_fs_path'
collect2: ld returned 1 exit status
make: *** [subversion/libsvn_fs_fs/libsvn_fs_fs-1.la] Error 1

(Hmm, the immediate problem may just be that libsvn_fs isn't listed as
a library for libsvn_fs_fs.  I've re-run autogen, it's not that.)

I do notice th following section in configure that implies that Cygwin
is the only platform that can't do circular linkage.

AC_MSG_CHECKING([whether to avoid circular linkage at all costs])
case $host in
  *-*-cygwin*)
    AC_MSG_RESULT([yes])
    AC_DEFINE([SVN_AVOID_CIRCULAR_LINKAGE_AT_ALL_COSTS_HACK], 1,
              [Define if circular linkage is not possible on this platform.])
    ;;
  *)
    AC_MSG_RESULT([no])
    ;;
esac

Regards,
Malcolm

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: Circular library dependency under Windows?

Posted by Lieven Govaerts <lg...@mobsol.be>.
I did an update of trunk up to revision 18467 on Windows, cleaned the
intermediate files, built the __ALL_TESTS__ target in Visual Studio.NET 2003
and ran fs-test, fs-base-test and svnserve. All without any problem.

I'm not very familiar with the "circular dependencies" problem, I suppose a
two-pass linker solves this automatically?

Isn't this something an automated build solution would have caught? Maybe I
should set one up.

Lieven.


> -----Original Message-----
> From: kfogel@newton.ch.collab.net 

> >
> > Hmmm, I thought such circular dependencies were not supported on 
> > Windows...
> 
> You mean having the lower-level library make calls into the 
> higher-level library?  Hmm, that's a good point.  It just 
> compiled and worked for me (Debian GNU/Linux), so I assumed 
> there was no problem.
> 
> Can anyone with more Windows development experience say for 
> sure?  If necessary, I can trivially rewrite the change.  
> This would result in a bit of duplicated code (sigh), but I 
> can put comments to help keep the duplicates in sync.
> 
> Thanks for the review, Peter.
> 
> -Karl



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org