This is an archive of the discontinued LLVM Phabricator instance.

[dotest] Make a missing FileCheck binary a warning, not an error
ClosedPublic

Authored by vsk on Oct 11 2018, 3:12 PM.

Details

Diff Detail

Repository
rL LLVM

Event Timeline

vsk created this revision.Oct 11 2018, 3:12 PM
zturner added a subscriber: vsk.Oct 11 2018, 3:23 PM

Why is FileCheck missing in the first place?

I spent a bit more time on this and I think I have a better idea of what's happening.

Vedant added functionality so that we can use FileCheck-style checks inside non-lit LLDB tests. Part of that change was to require a parameter --filecheck to be passed when calling the scripts (such as dotests.py). Also as part of that change, the CMakeFiles now propagate a default location for FileCheck as an input to the scripts, so that if you just run the tests by default using any of the generated outputs (for ninja, or make, or VS), they work correctly

The bots (at least some bots) don't just use the generated solutions to run the tests. There's some complicated logic in the zorg repo to create the list of parameters that are passed to the bots and they do not include the new --filecheck argument. So it's not individual bots that need to be updated, but the test harness. I haven't really looked at it before, so I'm still trying to understand it - especially how we would get FileCheck to any of the bots that run the tests remotely using lldbserver today.

The failing bots are not windows bots but Linux bots. It looks like you only updated the configurations for xcode.

I think the file that needs to be updated is:

zorg\buildbot\builders\LLDBBuilder.py

I've been meaning to look at this - for the command line style "cd test; ./dotest.py" approach, we could use similar logic to what packages/Python/lldbsuite/test/dotest.py does in getOutputPaths() where it finds an lldb binary in the "typical" location. for an Xcode style build, this would be in a directory like ../llvm-build/Release+Asserts/x86_64/bin/FileCheck where the build-style ("Release+Asserts") is going to vary but I'm guessing that the build configuration of the FileCheck binary picked is not important.

(obviously this would only be the behavior if a filecheck path was not specified)

@jasonmolenda That's not a bad idea. If you have a change ready, you could send it for review ;)

stella.stamenova requested changes to this revision.Oct 12 2018, 10:02 AM

@vsk Could you also make the filecheck function explicitly fail when it doesn't have a path to the binary? That way it will be fairly obvious what the problem is and the error combined with the warning should be clear enough.

This revision now requires changes to proceed.Oct 12 2018, 10:02 AM
vsk updated this revision to Diff 169471.Oct 12 2018, 12:12 PM
This revision is now accepted and ready to land.Oct 12 2018, 12:30 PM
This revision was automatically updated to reflect the committed changes.

The bots are now failing because lexists doesn't handle NoneType correctly:

  File "/lldb-buildbot/lldbSlave/buildWorkingDir/llvm/tools/lldb/packages/Python/lldbsuite/test/configuration.py", line 191, in get_filecheck_path
    if os.path.lexists(filecheck):
  File "/lldb-buildbot/virenv/lib/python2.7/posixpath.py", line 152, in lexists
    os.lstat(path)
TypeError: coercing to Unicode: need string or buffer, NoneType found

I think get_filecheck_path should check if filecheck is set first before calling lexists:

if filecheck and os.path.lexists(filecheck):
        return filecheck

Progress! The tests are running again and only a handful fail (some because of FileCheck, others for various other reasons).

http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/29816

It looks like there a number of tests that have failures unrelated to FileCheck, so anyone who has committed something recently should probably check if they broke a test or two.