Skip to content

[libc] Add missing dependency for test target #138423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 3, 2025

Conversation

mikhailramalho
Copy link
Member

@mikhailramalho mikhailramalho commented May 3, 2025

It seems we were missing a dependency when adding a new test target, e.g., test libc.test.src.math.sqrt_test.__unit__ would create a custom target in the form of:

  add_custom_target(
    libc.test.src.__support.FPUtil.dyadic_float_test.__unit__
    COMMAND  ${LIBC_UNITTEST_ENV} ${CMAKE_CROSSCOMPILING_EMULATOR} libc.test.src.__support.FPUtil.dyadic_float_test.__unit__.__build__
    COMMENT Running unit test libc.test.src.__support.FPUtil.dyadic_float_test.__unit__ )

but it wouldn't set that it depends on libc.test.src.__support.FPUtil.dyadic_float_test.__unit__.__build__ being built.

For some reason, it would break the rv32 buildbot, as it would try to run a test but the __build__ is nowhere to be found, since it wasn't built in the first place.

It seems we were missing a dependency when adding a new test target, e.g.,
test libc.test.src.math.sqrt_test.__unit__ would create a custom target
in the form of:

add_custom_target(
  libc.test.src.__support.FPUtil.dyadic_float_test.__unit__
  COMMAND  ${LIBC_UNITTEST_ENV} ${CMAKE_CROSSCOMPILING_EMULATOR} libc.test.src.__support.FPUtil.dyadic_float_test.__unit__.__build__
  COMMENT Running unit test libc.test.src.__support.FPUtil.dyadic_float_test.__unit__ )

but it wouldn't set that it depends on libc.test.src.__support.FPUtil.dyadic_float_test.__unit__.__build__
being built.

For some reason, it would break the rv32b buildbot, as it would try to
run a test but the __build__ is nowhere to be found, since it wasn't
built in the first place.
@llvmbot
Copy link
Member

llvmbot commented May 3, 2025

@llvm/pr-subscribers-libc

Author: Mikhail R. Gadelha (mikhailramalho)

Changes

It seems we were missing a dependency when adding a new test target, e.g., test libc.test.src.math.sqrt_test.unit would create a custom target in the form of:

add_custom_target(
libc.test.src.__support.FPUtil.dyadic_float_test.unit
COMMAND ${LIBC_UNITTEST_ENV} ${CMAKE_CROSSCOMPILING_EMULATOR} libc.test.src.__support.FPUtil.dyadic_float_test.unit.build
COMMENT Running unit test libc.test.src.__support.FPUtil.dyadic_float_test.unit )

but it wouldn't set that it depends on libc.test.src.__support.FPUtil.dyadic_float_test.unit.build being built.

For some reason, it would break the rv32b buildbot, as it would try to run a test but the build is nowhere to be found, since it wasn't built in the first place.


Full diff: https://github.com/llvm/llvm-project/pull/138423.diff

1 Files Affected:

  • (modified) libc/cmake/modules/LLVMLibCTestRules.cmake (+1)
diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index a28e15fc5e394..3f804694b5bae 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -321,6 +321,7 @@ function(create_libc_unittest fq_target_name)
       ${fq_target_name}
       COMMAND ${LIBC_UNITTEST_ENV} ${CMAKE_CROSSCOMPILING_EMULATOR} ${fq_build_target_name}
       COMMENT "Running unit test ${fq_target_name}"
+      DEPENDS ${fq_build_target_name}
     )
   endif()
 

@mikhailramalho
Copy link
Member Author

mikhailramalho commented May 3, 2025

I can't explain why this only happens in the rv32 buildbot, maybe it's the version of cmake?

$ cmake --version
cmake version 3.30.0

Local tests are still running but there no issues so far.

@mikhailramalho mikhailramalho merged commit ebdf2e0 into llvm:main May 3, 2025
18 checks passed
@mikhailramalho mikhailramalho deleted the fix-rv32-bb branch May 3, 2025 21:10
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
It seems we were missing a dependency when adding a new test target,
e.g., test libc.test.src.math.sqrt_test.__unit__ would create a
custom target in the form of:

```
  add_custom_target(
    libc.test.src.__support.FPUtil.dyadic_float_test.__unit__
    COMMAND  ${LIBC_UNITTEST_ENV} ${CMAKE_CROSSCOMPILING_EMULATOR} libc.test.src.__support.FPUtil.dyadic_float_test.__unit__.__build__
    COMMENT Running unit test libc.test.src.__support.FPUtil.dyadic_float_test.__unit__ )
``` 

but it wouldn't set that it depends on
libc.test.src.__support.FPUtil.dyadic_float_test.__unit__.__build__
being built.

For some reason, it would break the rv32 buildbot, as it would try to
run a test but the __build__ is nowhere to be found, since it wasn't
built in the first place.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
It seems we were missing a dependency when adding a new test target,
e.g., test libc.test.src.math.sqrt_test.__unit__ would create a
custom target in the form of:

```
  add_custom_target(
    libc.test.src.__support.FPUtil.dyadic_float_test.__unit__
    COMMAND  ${LIBC_UNITTEST_ENV} ${CMAKE_CROSSCOMPILING_EMULATOR} libc.test.src.__support.FPUtil.dyadic_float_test.__unit__.__build__
    COMMENT Running unit test libc.test.src.__support.FPUtil.dyadic_float_test.__unit__ )
``` 

but it wouldn't set that it depends on
libc.test.src.__support.FPUtil.dyadic_float_test.__unit__.__build__
being built.

For some reason, it would break the rv32 buildbot, as it would try to
run a test but the __build__ is nowhere to be found, since it wasn't
built in the first place.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
It seems we were missing a dependency when adding a new test target,
e.g., test libc.test.src.math.sqrt_test.__unit__ would create a
custom target in the form of:

```
  add_custom_target(
    libc.test.src.__support.FPUtil.dyadic_float_test.__unit__
    COMMAND  ${LIBC_UNITTEST_ENV} ${CMAKE_CROSSCOMPILING_EMULATOR} libc.test.src.__support.FPUtil.dyadic_float_test.__unit__.__build__
    COMMENT Running unit test libc.test.src.__support.FPUtil.dyadic_float_test.__unit__ )
``` 

but it wouldn't set that it depends on
libc.test.src.__support.FPUtil.dyadic_float_test.__unit__.__build__
being built.

For some reason, it would break the rv32 buildbot, as it would try to
run a test but the __build__ is nowhere to be found, since it wasn't
built in the first place.
GeorgeARM pushed a commit to GeorgeARM/llvm-project that referenced this pull request May 7, 2025
It seems we were missing a dependency when adding a new test target,
e.g., test libc.test.src.math.sqrt_test.__unit__ would create a
custom target in the form of:

```
  add_custom_target(
    libc.test.src.__support.FPUtil.dyadic_float_test.__unit__
    COMMAND  ${LIBC_UNITTEST_ENV} ${CMAKE_CROSSCOMPILING_EMULATOR} libc.test.src.__support.FPUtil.dyadic_float_test.__unit__.__build__
    COMMENT Running unit test libc.test.src.__support.FPUtil.dyadic_float_test.__unit__ )
``` 

but it wouldn't set that it depends on
libc.test.src.__support.FPUtil.dyadic_float_test.__unit__.__build__
being built.

For some reason, it would break the rv32 buildbot, as it would try to
run a test but the __build__ is nowhere to be found, since it wasn't
built in the first place.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants