Linux CI Tests failing

Hello, I am having issues with the Linux CI tests failing, for this PR:

I found this post which may be related:

I am wondering if there is anything I can do to resolve the issue, thank you for any help you can provide.

Your tests aren't failing; rather, your PR isn't compiling:

In file included from /home/build-user/swift/lib/ClangImporter/ImportDecl.cpp:46:
/home/build-user/swift/include/swift/ClangImporter/CXXMethodBridging.h:65:21: error: no matching function for call to 'any_of'
    bool hasUpper = llvm::any_of(getClangName(), std::isupper);
/home/build-user/llvm-project/llvm/include/llvm/ADT/STLExtras.h:1558:6: note: candidate template ignored: couldn't infer template argument 'UnaryPredicate'
bool any_of(R &&Range, UnaryPredicate P) {
1 error generated.

You can click on "Details" and navigate to read the logs. The macOS build doesn't look like it ran, either, so it's not possible to say that it's passing.

1 Like

Oh okay, thank you. I will investigate further

It seems the macOS tests finished running and passed.

It is just a hint but I think the issue is the usage of using std::isupper in bool hasUpper = llvm::any_of(getClangName(), std::isupper);. I've seems issue like that before where those library support headers for C functions can be required depending on the platform of setting that you are compiling. So we could try either #include in the file you are using or just use the C function directly isupper as the code that was previously there for islower bool hasUpper = llvm::any_of(getClangName(), isupper);. Those would be my suspects, but could be not it, anyways, hope that helps =]

1 Like

Ahh yeah, makes sense. I imported the header containing the method and the tests still had the same issue. Maybe an issue with the pipeline?

Do you mean std::isupper method or llvm::any_of?

It seems like isupper is defined in std namespace through the library support header #include <cctype>. Which I couldn't see in the PR(I saw only the attempt to include "llvm/ADT/STLExtras.h"), but #include <cctype> was my initial suggestion =]

Did the call without std:: work e.g. llvm::any_of(getClangName(), isupper)?

I think it possibly could be an issue with the pipeline, but IMO the chances are that we are missing something in the code. I've seem such issues where a required include was under a #if WIN32 for example and that causes similar problems when I used to work on a cpp project that targeted Windows and Linux... so that it why I thought it was possible to be something like this :)

1 Like

Unfortunately including cctype didnt resolve the issue, so i added a the #if __linux__ check to handle the workaround, which should hopefully work!

Ah, that is unfortunate ... this is really a curious case then :laughing: