llvm / llvm/llvm-project

Bots should fail check-libc if the bots can't run tests

Open
#193,820 1 comment 0 reactions 0 assignees View on GitHub
cmake libc
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

In https://github.com/llvm/llvm-project/blob/44a1d740333b271e752e921581513ac4a37ce8f0/libc/test/CMakeLists.txt#L52 we have the following bit of code:

```cmake
if(LIBC_TARGET_OS_IS_GPU)
if(NOT CMAKE_CROSSCOMPILING_EMULATOR)
message(WARNING "Cannot build libc GPU tests, set CMAKE_CROSSCOMPILING_EMULATOR.")
return()
elseif(LIBC_GPU_TESTS_DISABLED)
message(WARNING "Cannot build libc GPU tests, missing target architecture.")
return()
endif()
endif()
```

But this means that if someone misconfigures something (hypothetically, one of our post-commit bots), it will silently not run tests but still exit with success. It is convenient to allow building in an environment where you can't run tests, so the developer should be able to do that, but if they run check-libc after either of these have failed, it should exit with a non-zero exit code.

Contributor guide

Open the contributing guide

Research direction

Start by reading the GPU-test conditionals in libc/test/CMakeLists.txt and then run check-libc in the affected configurations. Preserve successful builds when tests cannot run, but make check-libc return a non-zero status after either missing emulator or missing target architecture prevents the tests from running.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system, ci-cd, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.