[LLVMdev] LLVM on Cygwin: why tests don't run

Csaba Raduly
Thu, 23 Dec 2010 23:04:31 -0000

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
PATHEXT=.COM;.EXE;.BAT;.CMD;.WSH

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?

P.S.
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!)

Csaba