Skip to content

setup: include build-essential in default packages#175

Draft
wyli wants to merge 1 commit into
mainfrom
wenqil/setup-add-build-essential
Draft

setup: include build-essential in default packages#175
wyli wants to merge 1 commit into
mainfrom
wenqil/setup-add-build-essential

Conversation

@wyli

@wyli wyli commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add build-essential to the default holoscan setup package list so CUDA-base images (which ship ninja-build but no compiler) leave behind a working gcc/g++/make.
  • No-op on bases that already ship gcc (SDK images, Ubuntu desktop), since install_packages_if_missing skips already-present packages.

Why

Holohub Jenkins build #484 (cuda12base-2404 stage, 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

  • Pre-commit (ruff, isort, black, codespell) passes on the diff
  • Manually: run `holoscan setup` on a fresh `nvcr.io/nvidia/cuda:12.9.1-base-ubuntu24.04` container and confirm `gcc --version` works
  • Holohub Jenkins `cuda12base-2404` stage goes green once this lands on `main` (the holohub Dockerfile installs holoscan-cli from `git+https://github.com/nvidia-holoscan/holoscan-cli.git@main\` for that stage)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Improved code clarity in the setup process with enhanced comments and reformatted configuration lists.

Review Change Stack

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>
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f1c144a8-784c-4893-bb05-9834928abb79

📥 Commits

Reviewing files that changed from the base of the PR and between 19f4689 and 1620593.

📒 Files selected for processing (1)
  • src/holoscan_cli/commands/setup_cmd.py

Walkthrough

The holoscan setup command now includes explanatory comments documenting why build-essential and related development tools are required. The package list argument to install_packages_if_missing has been reformatted across multiple lines for improved readability without changing which packages are installed or the surrounding setup flow.

Changes

Setup Command Documentation Enhancement

Layer / File(s) Summary
Package installation documentation and formatting
src/holoscan_cli/commands/setup_cmd.py
Explanatory comments clarify why build-essential and related tools are required. The package list passed to install_packages_if_missing is reformatted across multiple lines with identical package entries for improved readability. No behavioral changes to package installation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding build-essential to the default packages installed by the setup command.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@wyli wyli requested a review from tbirdso May 28, 2026 10:02
@wyli wyli marked this pull request as draft May 28, 2026 10:52
@copy-pr-bot

copy-pr-bot Bot commented May 28, 2026

Copy link
Copy Markdown

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"],

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 build tooling: cmake, ,ninja-build
  • Tools commonly used at build or runtime in Holoscan projects: xvfb, ffmpeg, libv4l-dev

@tbirdso

tbirdso commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Thanks @wyli for investigating. My initial thoughts are:

  • We intentionally do not declare a default language in HoloHub default CMake setup in order to avoid artificially requiring Python projects to have an unused C/C++ compiler in their environment
  • I wonder if the test pipeline intentionally declares that the project is using the CXX language in CMake? If not, the error output seems like a possible bug:
CMake Error at applications/myproj/CMakeLists.txt:18 (project):
No CMAKE_C_COMPILER could be found.
No CMAKE_CXX_COMPILER could be found.
  • Regardless, I am OK with adding build-essential to ./holohub setup with the reasoning that "this is a foundational package that we observe many common HoloHub subprojects rely on"

tbirdso pushed a commit to nvidia-holoscan/holohub that referenced this pull request Jul 2, 2026
## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants