Issue 26761 - problem with find from cygwin package findutils 4.1.7-4
Summary: problem with find from cygwin package findutils 4.1.7-4
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: solenv (show other issues)
Version: 680m30
Hardware: PC Windows XP
: P2 Trivial (vote)
Target Milestone: OOo 1.1.3
Assignee: quetschke
QA Contact: issues@tools
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-20 12:17 UTC by Frank Schönheit
Modified: 2006-03-14 21:03 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
find.exe 4.1, from an older cygwin package (24.66 KB, application/x-compressed)
2004-04-07 20:35 UTC, Frank Schönheit
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Frank Schönheit 2004-03-20 12:17:17 UTC
Building OpenOffice.org in the following configuration:

Windows XP
MSVC .NET 2002
cygwin 1.5.9
4NT 4.0
(everything else mentioned on
http://tools.openoffice.org/dev_docs/build_windows.html#BuildRequirements)

breaks in rvpapi/java with the following message:

/usr/bin/find: ..\com\sun\star changed during execution of /usr/bin/find
dmake:  Error code 129, while making 'Shell escape'


This happens when using the "findutils" package of cygwin in version 4.1.7-4.
When downgrading only find.exe to version 4.1, everything compiles fine.

Executing the following line in rvpapi/java (in an ordinary 4NT shell, prepared
for OOo buil) fails, too:
  find ..\com\sun\star -name *.idl
The error message is the same as above.

Replacing the backslashes on the console (respectively the "$/" in
rvpapi/java/makefile.mk) with ordinary slashes makes both the command line and
the build succeed.
Comment 1 Frank Schönheit 2004-03-20 12:23:43 UTC
forgot to mention:
This applies to building SRC680_m26 branch, though I don't think that the source
version makes any difference here ...
Comment 2 quetschke 2004-03-22 16:07:42 UTC
@fs: Thanks for the debugging :-) I'll produce a fix this evening.
Comment 3 quetschke 2004-03-22 17:25:27 UTC
Oops, I meant 1.1.2.
Comment 4 quetschke 2004-03-22 18:01:01 UTC
New title to reflect the problem.
Comment 5 quetschke 2004-03-23 02:20:33 UTC
First: This is a W32-4nt problem ;-)

The problem is that somewhere between findutils 4.1-? and 4.1.7-4 find lost
the ability to use/evaluate paths with backslashes.

I see at least four possibilities to fix this:

1. Require find from 4.1-?

2. put $(subst,\,/ data) in every makefile that uses $(FIND)

3. write a wrapper for find that transforms the arguments and calls find
   for USE_SHELL=4nt. 

4. write a generic DOS->POSIX wrapper and define FIND like:
   FIND=$(UNWRAPCMD) $(FIND) in winenv.bat

vq->ause: I'd propose 3. if you agree I'll produce a small perl script.
Comment 6 quetschke 2004-03-23 02:43:39 UTC
I guess this qualifies as P2.
Comment 7 Frank Schönheit 2004-03-23 08:19:03 UTC
mere interest: Is there a general rule how cygwin tools should handle
backslashes when *not* called from within a cygwin shell?
IIRC, some tools accept backslashes, and some don't, which is somewhat
inconsistent, isn't it?
Comment 8 hjs 2004-03-23 11:42:32 UTC
up to now, all cygwin tools that i evaluated treated the "\" as part of the
filename. this caused problems when using wildcards but worked fine for most
operations.
if this is a general shift, we might even require some kind of general wrapper
for cygwin tools used in a 4nt environment.
if it's just a problem of "find", we might just wrap this one.
hjs->vq: could you check if the most common commands (cp, mv, cat, touch) still do?
Comment 9 quetschke 2004-03-23 14:41:30 UTC
OK, something is strange here, I just updated all my cygwin packages
to the latest and greatest and did some tests.

In bash:
--- bash ---
quetschke@Baltasar /home
$ find ../tmp -name *.test
../tmp/ooo.test

quetschke@Baltasar /home
$ find ..\\tmp -name *.test
..\tmp/ooo.test

quetschke@Baltasar /home
$ find c:\\cygwin\\tmp -name *.test
c:\cygwin\tmp/ooo.test

quetschke@Baltasar /home
$ find c:/cygwin/tmp -name *.test
c:/cygwin/tmp/ooo.test
--- bash ---

In cmd.exe:

--- cmd.exe ---
C:\cygwin\home>c:\cygwin\bin\find ..\tmp -name *.test
..\tmp/ooo.test

C:\cygwin\home>c:\cygwin\bin\find ../tmp -name *.test
../tmp/ooo.test
--- cmd.exe ---

Hmmm, I don't see a problem here. I guess there was always the output
of mixed '\' and '/' when you use DOS notation.

vq->fs: Can you check the file attributes?
Comment 10 quetschke 2004-03-23 14:49:48 UTC
2nd try, I thought that com is maybe a reserved name, in cmd.exe:

C:\cygwin\home>c:\cygwin\bin\find ..\com\sun\star -name *.test
..\com\sun\star/ooo.test
Comment 11 quetschke 2004-03-23 15:02:11 UTC
Got it!

My d: drive is FAT32, there I get:

D:\home>c:\cygwin\bin\find ../com/sun/star -name *.test
../com/sun/star/ooo.test

D:\home>c:\cygwin\bin\find ..\com\sun\star -name *.test
/usr/bin/find: ..\com\sun\star changed during execution of /usr/bin/find

ause or fs, can anyone of you please check if it works with network drives?

I'll post this problem to the cygwin list later.

I'm puzzled when this problem was introduced, the findutils package changed
in 2002 to 4.1.7-4, but maybe nobody ever tried to build OOo on FAT.

Actually if one builds with the TEMP var pointing to a directory on a FAT
drive I know (there is an issue somewhere) that you cannot do rebuilds,
because the flagfiles (can) have filedates that are off by one second.

For now, I'd say: Don't use FAT drives at all.
Comment 12 Frank Schönheit 2004-03-23 15:23:43 UTC
> My d: drive is FAT32
strange indeed! Kudos for finding this :)

> ause or fs, can anyone of you please check if it works with network drives?
I won't have access to a machine with both cygwin and network access before thursday

> I'm puzzled when this problem was introduced, the findutils package changed
> in 2002 to 4.1.7-4, but maybe nobody ever tried to build OOo on FAT.

May "working" cygwin installation may indeed be older than this, I originally
used it to build Mozilla quite some time ago.

> For now, I'd say: Don't use FAT drives at all.

Okay, that's ugly, since it may require me to migrate a 30GB partition to NTFS
(which it should be nowadays), but if that saves me trouble, I may do so.
Comment 13 hjs 2004-03-23 16:05:01 UTC
did some tests here too. find (4.1.7-4) fails on FAT32 and network volumes if
the searchdirectory contains backslashes AND begins with "..". a directory below
the current location works fine.


Comment 14 quetschke 2004-03-24 00:34:15 UTC
> Okay, that's ugly, since it may require me to migrate a 30GB partition
> to NTFS (which it should be nowadays), but if that saves me trouble,
> I may do so.
Well, you can use the old find, or I can send you a patched find from
the findutils 4.1.7-4 sources, it would disable the inode comparison
for the top directory entry.

I hope that I get aswers in the cygwin mailing list and that this is
fixable without disabling this check.

Amazingly enough that there is an inode emulation!
Comment 15 quetschke 2004-03-25 02:58:38 UTC
The good news is I pinpointed the problem in the cygwin1.dll, see:
<http://cygwin.com/ml/cygwin/2004-03/msg01210.html>.

The bad news is that some people think the problem is not
worth to fix, quote: "speed disadvantage for nebulous gain."

Maybe a good diplomat is needed. Is Joerg around ;-)
Comment 16 Frank Schönheit 2004-03-25 09:11:42 UTC
Uh. Looks like they're very reluctant, indeed. Can we convince them with
"OpenOffice.org is not going to use cygwin anymore!!!!1" ? :) Or, more
diplomatic: Fixing this would allow using cygwin in heterogenous environments,
where cygwin tools and other command line tools (now knowing about slashes) are
mixed. Just an idea.
Comment 17 quetschke 2004-03-25 14:39:11 UTC
Some lobbying might help ;-) Pointing out that there are "real-world"
applications that currently fail might also help, but saying that you
get this problem when you mix cygwin and 4nt might not help :-)
Comment 18 quetschke 2004-03-25 18:41:52 UTC
Just FYI, the needed fix is already in cvs.

cvs -d :pserver:anoncvs@sources.redhat.com:/cvs/src diff -u -r1.289 -r1.290
src/winsup/cygwin/path.cc

vq wonders: Manche Leute muss ich nicht verstehen ....
Comment 19 joerg.barfurth 2004-03-26 13:05:33 UTC
Actually I am  around ;-)

But seeing that there already is a fix in Cygwin cvs, I think there is not much
more we need to (or can) do.

I propose that we close this issue as WONTFIX. In the build documentation we
should tell people that a certain (range of) findutil version(s) don't work. IOW
they should go back to older working findutils until the mentioned patch is
released.

Probably we should not actually CLOSE the issue until the cygwin patch is
available and we have verified that it actually solves our problem.
Comment 20 Frank Schönheit 2004-03-28 16:05:49 UTC
Hmm, I just wanted to try this lobbying ... (not with Jörg's eloquence :), but
who knows what it's good for).

Okay, I'll happily close this as <whatever> (I suppose WONTFIX comes closest).
Volker, do you mind adding an "Important note 9" to
http://tools.openoffice.org/dev_docs/build_windows.html#BuildRequirements?
Comment 21 quetschke 2004-03-29 13:49:04 UTC
Yes, we can resolve the issue. In general I'm not that happy with the WONTFIX
state. If a user runs into this problem and sees a WONTFIX, that might lead
him to the impression that this is an unfixable problem.

If we resolve as FIXED, even if "we" didn't fix it, but external resources,
this comes closer IMHO to the fact that now there exists a solution for
this problem.

Opinions?

And, yes I'll update the build instructions after a cygwin 1.5.10 is released.
(It is due this week, I don't want to confuse the people even more with
something like they have to get very old findutils and manually install it
to .. )
Comment 22 Frank Schönheit 2004-03-30 07:27:22 UTC
I'm fine with FIXED, when 1.5.10 is out.
Comment 23 utomo99 2004-03-31 04:01:10 UTC
so, is that correct That this also affecting 1.1.1 & Other windows version ? 
and the work around is ? 
edit the makefile.mk at  rvpapi/java/makefile.mk
Replace $/ with $\

or wait for cygwin 1.5.10

Thanks
Comment 24 Frank Schönheit 2004-04-07 20:35:45 UTC
Created attachment 14398 [details]
find.exe 4.1, from an older cygwin package
Comment 25 Martin Hollmichel 2004-05-06 16:47:42 UTC
set target to 1.1.3
Comment 26 quetschke 2004-06-07 23:46:09 UTC
D:\>c:\cygwin\bin\find.exe .\tmp -name *.test
.\tmp/file.test

OK, works in cygwin 1.5.10.
Comment 27 quetschke 2004-06-07 23:47:03 UTC
close