The-OpenROAD-Project / The-OpenROAD-Project/OpenROAD
drt: -no-tests configure fails — src/drt/test references build_and_test, a target that only exists when ENABLE_TESTS=ON
Nobody has claimed this yet.
- Dominant language
- Verilog
- Stars
- 3.1k
- Forks
- 1k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 136
Description
./etc/Build.sh -no-gui -no-tests no longer configures on master. At 766c85a4dde5f80a30dba7526f221a3953ef70a3:
CMake Error at src/drt/test/CMakeLists.txt:36 (add_dependencies):
Cannot add target-level dependencies to non-existent target
"build_and_test".
The add_dependencies works for top-level logical targets created by the
add_executable, add_library, or add_custom_target commands.
...
-- Tests Enabled : OFF
-- Configuring incomplete, errors occurred!
Reading the source: -no-tests sets -DENABLE_TESTS=OFF (etc/Build.sh:121), and the top-level CMakeLists.txt creates build_and_test only inside if(ENABLE_TESTS) (lines 224-229). src/drt/CMakeLists.txt ends with an unguarded add_subdirectory(test), so the gtest block appended to src/drt/test/CMakeLists.txt in #11160 is reached with that target absent:
include(GoogleTest)
add_executable(WatermarkCostTest WatermarkCostTest.cpp)
target_include_directories(WatermarkCostTest PRIVATE ../src)
target_link_libraries(WatermarkCostTest PRIVATE drt_lib GTest::gtest_main)
gtest_discover_tests(WatermarkCostTest)
add_dependencies(build_and_test WatermarkCostTest)
Every other module with C++ tests keeps that block behind the ENABLE_TESTS guard, in one of two places:
src/odb,src/mplandsrc/rszguardadd_subdirectory(test)in the moduleCMakeLists.txtsrc/grtguardsadd_subdirectory(cpp)insidesrc/grt/test/CMakeLists.txt
src/drt does neither, which is why the new block is the first one to reach add_dependencies with tests off. c751cdc78e74 (2026-09-15) still configured; the first failure we see is after #11160 merged.
Reproduce, from a clean checkout of master:
./etc/Build.sh -no-gui -no-tests
Three questions:
- Is a CMake
-no-testsbuild still a configuration you intend to support? Now that Bazel is the default build system, it would be reasonable if it were not, and we would rather know than paper over it. - If it is, which placement would you prefer for
drt— guardingadd_subdirectory(test)insrc/drt/CMakeLists.txt, the wayodb/mpl/rszdo it, or guarding the gtest block insidesrc/drt/test/CMakeLists.txt, the waygrtdoes? The first is a one-line change; the second keeps the integration tests registered with tests off, which is whatdrtdoes today. - Would you like a PR for it, or would you rather take it yourselves? Happy either way — just say which and we will stay out of the way if you are already on it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce with ./etc/Build.sh -no-gui -no-tests from a clean checkout. Read etc/Build.sh, src/drt/CMakeLists.txt, src/drt/test/CMakeLists.txt, and the comparable guards in src/odb, src/mpl, src/rsz, and src/grt. Confirm the chosen guard follows the project convention and that configuration completes with ENABLE_TESTS=OFF.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system, testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100