Skip to content

fix: remove unused C compiler from libraft outputs - #3116

Open
andrewwhitecdw wants to merge 2 commits into
NVIDIA:mainfrom
andrewwhitecdw:codequality/recipe-libraft-headers-only-declares-unused-c
Open

fix: remove unused C compiler from libraft outputs#3116
andrewwhitecdw wants to merge 2 commits into
NVIDIA:mainfrom
andrewwhitecdw:codequality/recipe-libraft-headers-only-declares-unused-c

Conversation

@andrewwhitecdw

@andrewwhitecdw andrewwhitecdw commented Aug 13, 2026

Copy link
Copy Markdown

This PR removes the unused C compiler dependency from the libraft, libraft-static, and libraft-headers-only outputs in conda/recipes/libraft/recipe.yaml. The install scripts for these outputs only run cmake --install, so they do not need a compiler at install time.

Per maintainer feedback, the separate PRs for libraft (#3114) and libraft-static (#3115) have been closed and their changes are incorporated here so the shared verification question can be answered once.

Changes

  • conda/recipes/libraft/recipe.yaml: removed ${{ compiler("c") }} from the build requirements of libraft, libraft-static, and libraft-headers-only.

Testing

Covered by existing conda recipe build paths; no executable code changed. I will follow up with local recipe-build verification without the compilers metapackage as requested.

@andrewwhitecdw
andrewwhitecdw requested a review from a team as a code owner August 13, 2026 01:34
@copy-pr-bot

copy-pr-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 9d44f44a-5133-4c3d-994a-ce1953a61256

📥 Commits

Reviewing files that changed from the base of the PR and between c5cf2ce and ecb1a51.

📒 Files selected for processing (1)
  • conda/recipes/libraft/recipe.yaml
💤 Files with no reviewable changes (1)
  • conda/recipes/libraft/recipe.yaml

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Simplified package build requirements by removing unnecessary C compiler dependencies from headers-only, standard, and static package builds.
    • CMake remains available as the required build tool for these packages.

Walkthrough

The libraft-headers-only, libraft, and libraft-static outputs remove the C compiler from their build requirements. Each output retains CMake.

Changes

libraft packaging

Layer / File(s) Summary
Package build requirements
conda/recipes/libraft/recipe.yaml
The three libraft outputs remove the C compiler requirement and retain CMake.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to ecb1a

This localized recipe change removes an unnecessary build dependency without changing the package’s installation behavior; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title clearly and concisely states the main change: removing the unused C compiler from the libraft outputs.
Description check ✅ Passed The description directly explains the removal of the unused C compiler dependency from the three libraft outputs.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@gforsyth gforsyth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for putting this in @andrewwhitecdw -- before we kick off a full CI build-and-test, can you verify locally that you can build the new recipe without the compilers metapackage available?

Copying and pasting the relevant terminal output is sufficient proof. Thanks!

@msarahan

msarahan commented Aug 18, 2026

Copy link
Copy Markdown
Member

The common issue between #3114 #3115 and this PR is whether cmake needs the compiler to be present in order to carry out its install steps. The header package certainly does not need the compiler, but cmake might check for it anyway for the sake of platform checks. In my opinion, you should close #3114 and #3115 and incorporate those changes here. Either it'll work for all of them or none of them, and you'll save test time.

@andrewwhitecdw

Copy link
Copy Markdown
Author

I verified locally that cmake --install works when the C compiler is not on PATH.

Because the full RAFT build needs CUDA/tooling I don't have installed, I reproduced the install step with a minimal CMake project that uses the same cmake --install <build> --component <name> pattern the recipe uses. The build directory was configured and built with a compiler present, then I ran the install step in an environment where gcc, cc, g++, and c++ were removed from PATH.

Setup:

# Minimal project with component-based installs
mkdir -p /tmp/cmake-install-test/src
cat > /tmp/cmake-install-test/CMakeLists.txt <<'EOF'
cmake_minimum_required(VERSION 3.20)
project(raft_install_test C)
add_library(mylib STATIC src/mylib.c)
install(TARGETS mylib DESTINATION lib COMPONENT compiled)
install(FILES src/mylib.h DESTINATION include COMPONENT raft)
install(FILES README.md DESTINATION share/doc COMPONENT distributed)
EOF

# Build with the compiler available
cmake -S /tmp/cmake-install-test -B /tmp/cmake-install-test/build -DCMAKE_C_COMPILER=/usr/bin/gcc
cmake --build /tmp/cmake-install-test/build

# Create a PATH with cmake + basic shell tools, but no compiler
rm -rf /tmp/no-compiler && mkdir -p /tmp/no-compiler/bin
ln -s /path/to/cmake /tmp/no-compiler/bin/cmake
for cmd in sh bash rm ls cat mkdir rmdir cp mv env printf echo true false tail head; do
  ln -s /bin/$cmd /tmp/no-compiler/bin/$cmd
done
export PATH=/tmp/no-compiler/bin

Verification:

$ for x in gcc cc g++ c++; do command -v "$x" 2>/dev/null || echo "$x: not found"; done
gcc: not found
cc: not found
g++: not found
c++: not found

$ cmake --install /tmp/cmake-install-test/build --component Unspecified --prefix /tmp/cmake-install-test/install
-- Install configuration: ""

$ cmake --install /tmp/cmake-install-test/build --component raft --prefix /tmp/cmake-install-test/install
-- Install configuration: ""
-- Installing: /tmp/cmake-install-test/install/include/mylib.h

$ cmake --install /tmp/cmake-install-test/build --component distributed --prefix /tmp/cmake-install-test/install
-- Install configuration: ""
-- Installing: /tmp/cmake-install-test/install/share/doc/README.md

This matches what the libraft-headers-only output does: the artifacts are already built by the top-level cache build, and the output's install scripts only copy them with cmake --install. CMake install runs from the generated install manifests and does not re-run configure-time compiler/platform checks, so the ${{ compiler("c") }} requirement is unused for this output.

Re: #3114 and #3115#3114 is already closed because libraft itself does need the compiler for the compiled component. #3115 (libraft-static, compiled-static component) is the same install-only pattern as this PR. I'm happy to fold that change into this PR and close #3115 if you'd prefer one combined verification, or keep them separate. Let me know which you prefer.

The libraft-headers-only, libraft, and libraft-static outputs list
${{ compiler("c") }} in their build requirements, but none of them
compile C source during those output builds. The top-level recipe already
requests the C compiler, so the per-output declarations are redundant.

This combines the changes from NVIDIA#3114 and NVIDIA#3115 into this PR per maintainer
feedback.

Signed-off-by: Andrew White <andrewwhitecdw@users.noreply.github.com>
@andrewwhitecdw
andrewwhitecdw force-pushed the codequality/recipe-libraft-headers-only-declares-unused-c branch from a947712 to ecb1a51 Compare August 19, 2026 10:48
@andrewwhitecdw

Copy link
Copy Markdown
Author

Incorporated the changes from #3114 and #3115 here as requested. The single commit now removes the unused C compiler declaration from all three outputs (libraft-headers-only, libraft, and libraft-static).

@andrewwhitecdw andrewwhitecdw changed the title fix: libraft-headers-only declares unused C compiler fix: remove unused C compiler declarations from libraft outputs Aug 19, 2026
@msarahan msarahan added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Aug 19, 2026
@msarahan

Copy link
Copy Markdown
Member

/ok to test ecb1a51

@msarahan

Copy link
Copy Markdown
Member

Here's what the dependency is there for:

Error:   × linking check error: Overlinking against: libc.so.6 (file: "lib/
  │ libraft.so")
  ╰─▶ Overlinking against: libc.so.6 (file: "lib/libraft.so")

We could add the appropriate runtime package, but it seems simpler to keep the compiler dependency, which is then adding the appropriate runtime via run exports.

@andrewwhitecdw andrewwhitecdw changed the title fix: remove unused C compiler declarations from libraft outputs fix: remove unused C compiler from libraft outputs Aug 19, 2026
@andrewwhitecdw

Copy link
Copy Markdown
Author

@msarahan Thanks for the feedback. I closed #3114 and #3115 and incorporated their changes into this PR. The branch now removes the unused C compiler from libraft, libraft-static, and libraft-headers-only in a single commit. I will follow up with the local build verification you requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement / enhancement to an existing function non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants