setup: include build-essential in default packages#175
Conversation
The default `holoscan setup` package list installed `ninja-build` but no C/C++ compiler, so on stripped bases like `nvcr.io/nvidia/cuda:12.9.1-base-ubuntu24.04` cmake immediately failed with `No CMAKE_C_COMPILER could be found` the moment a downstream project tried to configure (caught in holohub Jenkins build #484). Add `build-essential` to the default list so the same `holoscan setup` that already provisions ninja/cmake/python-dev also leaves behind a working compiler. The conditional inside `install_packages_if_missing` makes this a no-op on bases that already ship gcc (SDK images, full Ubuntu desktop images, etc.). Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe ChangesSetup Command Documentation Enhancement
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
| # but no compiler, so cmake fails with `No CMAKE_C_COMPILER could | ||
| # be found` the moment a downstream project tries to configure. | ||
| install_packages_if_missing( | ||
| ["wget", "xvfb", "git", "unzip", "ffmpeg", "ninja-build", "libv4l-dev"], |
There was a problem hiding this comment.
do you know what the criteria we used to decide whether a package should be included in this auto-installation command? I'm writing some tests and I couldn't remember how we came up with this list.. @tbirdso
There was a problem hiding this comment.
My recollection is that this is a loose list of tools that we either directly rely on in HoloHub CLI or otherwise see commonly represented across Holoscan projects
- General environment management:
wget,git,unzip holohub buildtooling:cmake,,ninja-build- Tools commonly used at build or runtime in Holoscan projects:
xvfb,ffmpeg,libv4l-dev
|
Thanks @wyli for investigating. My initial thoughts are:
CMake Error at applications/myproj/CMakeLists.txt:18 (project):
No CMAKE_C_COMPILER could be found.
No CMAKE_CXX_COMPILER could be found.
|
## Summary The application template's `CMakeLists.txt` called a bare `project()` — which implicitly enables **C and CXX** — and ran `find_package(holoscan)` unconditionally. As a result, a `language=python` project generated by `./holohub create` failed to configure on hosts without a C/C++ toolchain (e.g. bare CUDA base images): ``` CMake Error at applications/myproj/CMakeLists.txt:18 (project): No CMAKE_C_COMPILER could be found. No CMAKE_CXX_COMPILER could be found. ``` This change makes the template follow the conventions already used in the tree (the root `CMakeLists.txt` probes for a compiler before enabling CXX; `holochat` declares `project(... NONE)`): - **cpp** projects declare `LANGUAGES CXX` (no C compiler required) and keep `find_package(holoscan)`. - **python** projects declare `LANGUAGES NONE` and skip `find_package` — the SDK is imported at runtime, so configuring needs no toolchain and no SDK development package. - The placeholder test uses the modern `add_test(NAME ... COMMAND ...)` signature (the keyword-less form parses as CMake's legacy signature and registers a test whose executable is the literal word `COMMAND`), and is now registered for python projects too. ## Related Complements nvidia-holoscan/holoscan-cli#175, which adds `build-essential` to `holoscan setup` so **cpp** projects build on bare CUDA bases — with this change, **python** projects need no compiler at all. Addresses the CMake-language discussion raised by @tbirdso in that PR's review thread. ## Test plan - [x] Rendered python project configures with no usable compilers (`-DCMAKE_C_COMPILER=/nonexistent -DCMAKE_CXX_COMPILER=/nonexistent`) - [x] Pre-change template rendered the same way reproduces the CI failure above - [x] Rendered cpp project compiles and links against an installed Holoscan SDK (4.3.0, `/opt/nvidia/holoscan`) with CXX as the only enabled language - [x] `utilities/cli/tests/test_create_module.py` passes (2 passed, run with `--noconftest`) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Project templates now generate language-appropriate build configuration for C++ and Python projects. * C++ projects get the expected build setup, while Python projects use a lighter configuration that skips C++-specific steps. * **Bug Fixes** * Test scaffolding now appears consistently across both project types. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Wenqi Li <wenqil@nvidia.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Summary
build-essentialto the defaultholoscan setuppackage list so CUDA-base images (which shipninja-buildbut no compiler) leave behind a working gcc/g++/make.install_packages_if_missingskips already-present packages.Why
Holohub Jenkins build #484 (
cuda12base-2404stage, base =nvcr.io/nvidia/cuda:12.9.1-base-ubuntu24.04) failed in the post-setup cmake configure step:```
CMake Error at applications/myproj/CMakeLists.txt:18 (project):
No CMAKE_C_COMPILER could be found.
No CMAKE_CXX_COMPILER could be found.
```
The default `holoscan setup` already provisions `cmake`, `ninja-build`, `python3-dev`, cuDNN, TensorRT, etc. — adding a compiler is the missing piece for the contract "after `holoscan setup`, a downstream Holoscan project can be configured and built." This change makes that contract hold on bare CUDA bases.
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit