You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Roland Schwingel <ro...@onevision.de> on 2004/10/26 09:56:00 UTC
svn_path_canonicalize() broken in 1.1.x on cygwin (was: SVN 1.1.1:
Cannot find .subversion folder (CYGWIN) on users@)
Hi...
Yesterday I posted the attached observation to the users list...I did
some further investigations.
As of the fact that IMHO this is a bug in the implementation I am
switching to the developers list.
To summarize:
Subversion 1.1.x can not find the users .subversion folder in his/her
homeaccount on cygwin when
the homeaccount resides on an UNC share.
Subversion 1.0.9 is like 1.0.4 not showing the behaviour. Everything is
fine. So I was taking a look
in the code. apr is identical in 1.0.9 and 1.1.1. So it couldn't be the
failing instance here. So I looked further
and found that svn_path_canonicalize() in subversion/libsvn_subr/path.c
is broken in 1.1.x when running
on cygwin and getting an UNC path.
Example:
//server/share/folder
will result in
/server/share/folder
after svn_path_canonicalize()
The reason for it is that the leading / gots stripped here. There is an
#ifdef for win32
taking care of double leading seperators but not for cygwin.
So replacing the 2 occurencies of
#ifdef WIN32
in svn_path_canonicalize() with
#if defined(WIN32) || defined(CYGWIN)
fixed the problem for me. I attached a patch for this problem basing on
the current 1.1.1 release code
I haven't read the HACKING file so this is just a suggestion how it can
be fixed .Feel free to ignore
it and use another solution for this if you find it better suitable.
I also dared and filed an issue for this (#2108).
Roland
Re: svn_path_canonicalize() broken in 1.1.x on cygwin (was: SVN 1.1.1: Cannot
find .subversion folder (CYGWIN) on users@)
Posted by Roland Schwingel <Ro...@onevision.com>.
Hi...
"Max Bowsher" <ma...@ukf.net> wrote on 27.10.2004 20:14:18:
> Ben Reser wrote:
> > On Wed, Oct 27, 2004 at 06:35:50PM +0100, Max Bowsher wrote:
> >> I assume CYGWIN is an APR define?
> >
> > No idea.
> >
> >> The platform standard predefined-by-compiler #define for detecting
cygwin
> >> is __CYGWIN__.
> >
> > Then we ought to use that?
>
> I think CYGWIN is an APR abstraction.
>
> Since we use apr to hide other platform oddities, I guess we should use
it
> here too.
>
> It's just a matter of checking up on the CYGWIN definition logic, before
we
> start to rely on it.
The -DCYGWIN came from the ./configure stage to the CPPFLAGS variables in
the
Makefile. So I used that because I thought it would be the intended
abstraction
for it. __CYGWIN__ (and __CYGWIN32__) are normally defined by gcc's spec
file
on cygwin. In my eyes __CYGWIN__ can be used identical to the CYGWIN
abstraction.
The __CYGWIN__ variant would have the slight benefit that it would also
work if
the abstracted CYGWIN define would fade away...
Roland
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn_path_canonicalize() broken in 1.1.x on cygwin (was: SVN 1.1.1: Cannot find .subversion folder (CYGWIN) on users@)
Posted by Max Bowsher <ma...@ukf.net>.
Ben Reser wrote:
> On Wed, Oct 27, 2004 at 06:35:50PM +0100, Max Bowsher wrote:
>> I assume CYGWIN is an APR define?
>
> No idea.
>
>> The platform standard predefined-by-compiler #define for detecting cygwin
>> is __CYGWIN__.
>
> Then we ought to use that?
I think CYGWIN is an APR abstraction.
Since we use apr to hide other platform oddities, I guess we should use it
here too.
It's just a matter of checking up on the CYGWIN definition logic, before we
start to rely on it.
Max.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn_path_canonicalize() broken in 1.1.x on cygwin (was: SVN 1.1.1: Cannot find .subversion folder (CYGWIN) on users@)
Posted by Ben Reser <be...@reser.org>.
On Wed, Oct 27, 2004 at 06:35:50PM +0100, Max Bowsher wrote:
> I assume CYGWIN is an APR define?
No idea.
> The platform standard predefined-by-compiler #define for detecting cygwin
> is __CYGWIN__.
Then we ought to use that?
--
Ben Reser <be...@reser.org>
http://ben.reser.org
"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn_path_canonicalize() broken in 1.1.x on cygwin (was: SVN 1.1.1: Cannot find .subversion folder (CYGWIN) on users@)
Posted by Max Bowsher <ma...@ukf.net>.
Ben Reser wrote:
> On Wed, Oct 27, 2004 at 07:50:23AM +0200, Branko ??ibej wrote:
>> Yes, it's defintely a bug, and I think the solution is accetpable given
>> that there already is an ifdef there.
>
> Looks fine to me but I'll defer to maxb on if we want to test for CYGWIN
> with defined(CYGWIN) or not. There are no other cases of it in our code
> so I'm somewhat cautious to start using it.
I assume CYGWIN is an APR define?
The platform standard predefined-by-compiler #define for detecting cygwin is
__CYGWIN__.
Max.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn_path_canonicalize() broken in 1.1.x on cygwin (was: SVN 1.1.1: Cannot find .subversion folder (CYGWIN) on users@)
Posted by Ben Reser <be...@reser.org>.
On Wed, Oct 27, 2004 at 07:50:23AM +0200, Branko ??ibej wrote:
> Yes, it's defintely a bug, and I think the solution is accetpable given
> that there already is an ifdef there.
Looks fine to me but I'll defer to maxb on if we want to test for CYGWIN
with defined(CYGWIN) or not. There are no other cases of it in our code
so I'm somewhat cautious to start using it.
--
Ben Reser <be...@reser.org>
http://ben.reser.org
"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn_path_canonicalize() broken in 1.1.x on cygwin (was: SVN 1.1.1:
Cannot find .subversion folder (CYGWIN) on users@)
Posted by Branko Čibej <br...@xbc.nu>.
Roland Schwingel wrote:
> Hi...
>
> Yesterday I posted the attached observation to the users list...I did
> some further investigations.
> As of the fact that IMHO this is a bug in the implementation I am
> switching to the developers list.
>
> To summarize:
> Subversion 1.1.x can not find the users .subversion folder in his/her
> homeaccount on cygwin when
> the homeaccount resides on an UNC share.
>
> Subversion 1.0.9 is like 1.0.4 not showing the behaviour. Everything
> is fine. So I was taking a look
> in the code. apr is identical in 1.0.9 and 1.1.1. So it couldn't be
> the failing instance here. So I looked further
> and found that svn_path_canonicalize() in
> subversion/libsvn_subr/path.c is broken in 1.1.x when running
> on cygwin and getting an UNC path.
>
> Example:
> //server/share/folder
> will result in
> /server/share/folder
> after svn_path_canonicalize()
>
> The reason for it is that the leading / gots stripped here. There is
> an #ifdef for win32
> taking care of double leading seperators but not for cygwin.
>
> So replacing the 2 occurencies of
> #ifdef WIN32
> in svn_path_canonicalize() with
> #if defined(WIN32) || defined(CYGWIN)
>
> fixed the problem for me. I attached a patch for this problem basing
> on the current 1.1.1 release code
>
> I haven't read the HACKING file so this is just a suggestion how it
> can be fixed .Feel free to ignore
> it and use another solution for this if you find it better suitable.
>
> I also dared and filed an issue for this (#2108).
You dare a lot. :-)
Yes, it's defintely a bug, and I think the solution is accetpable given
that there already is an ifdef there.
So, please read HACKING and add a log message for your patch.
Thanks!
-- Brane
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org