LLVM on Cygwin: why tests don't run

Hi all,
LLVM+clang builds fine under Cygwin 1.7, but "make check-all" fails to
run because lit doesn't find the freshly built clang. The reason is as
follows: in llvm/utils/lit/lit/Util.py, in the "which" method, there's

66: # Get suffixes to search.
67: pathext = os.environ.get('PATHEXT', '').split(os.pathsep)

The problem is, PATHEXT is imported verbatim from the Windows
environment into the Cygwin environment, so it contains for example

However, under Cygwin os.pathsep is the Unix-style ':' rather than the
Windows-style ';' so this fails to chop up PATHEXT. The end result is
that the "which" method ends up looking for the file
"clang.COM;.EXE;.BAT;.CMD;.WSH" with little success.

If PATHEXT is only relevant on Windows, perhaps the split should be
done with a hardcoded ';' instead of os.pathsep

Otherwise, it should be the responsibility of the user to set PATHEXT
to the appropriate form in his Cygwin environment, e.g. with something
like this in .bashrc

PATHEXT=`cygpath -p -u $PATHEXT`

This should be documented in LLVM somewhere (perhaps in GettingStarted.html ?)

Any opinions?

With the above change, "make check-all" starts to run. Estimated run
time: 40 hours on my 1.8GHz single-core Centrino laptop. (The same
machine running Linux completed "make check-all" in 2min 30 sec!)


Good evening, Csaba!

I think rather, Cygwin does not need to know what PATHEXT would be.
A patch(0001) is attached.

Another patch is for unittests. Lit does not find *Tests.exe in
unittests on ToT.

0001-lit-Util.py-On-Cygwin-PATHEXT-may-exist-but-it-s.patch.txt (934 Bytes)

0002-lit-TestFormats.py-Unittests-may-be-found-with-s.patch.txt (820 Bytes)

Yes, that does make sense. Cygwin doesn't need PATHEXT.
With this patch, "make check-all" started to run on Cygwin. Only 24h to go...


I know now. It was a debug build (enable-optimized=no) created only
for trying out your patch on Util.py.

Good morning, Csaba.

me2. I don't know why too slow.

I know now. It was a debug build (enable-optimized=no) created only
for trying out your patch on Util.py.

Oops! My issue is with Release(w/e +Asserts) build!
If you can, try "Release+Asserts/(llc opt &c) -help repeatedly.
In my environments, Windows XP Home SP3 and Windows XP x64 Edititon,
Always I see "HDD BUSY" indicator and it takes about thousands
milseconds to display help text.

In contrast, on msys, executable binaries can be cached.

Lemme know if you got anything, thank you!