Skip to content

fix(sherpa-native): add missing includes#204

Open
RobLoach wants to merge 1 commit into
happier-dev:devfrom
RobLoach:fix/sherpa-native-android-missing-includes
Open

fix(sherpa-native): add missing includes#204
RobLoach wants to merge 1 commit into
happier-dev:devfrom
RobLoach:fix/sherpa-native-android-missing-includes

Conversation

@RobLoach

@RobLoach RobLoach commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Fixes #201


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Note

Add missing cstdint and vector includes to HappierSherpaNativeJni.cpp

Adds the missing <cstdint> and <vector> headers to HappierSherpaNativeJni.cpp and moves <memory> earlier in the include order to fix compilation issues.

Macroscope summarized f958658.

Summary by CodeRabbit

  • Chores
    • Updated internal native components to ensure required standard utilities are available.
    • No user-visible behavior changes.

@coderabbitai

coderabbitai Bot commented Jul 19, 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: Pro

Run ID: 2d488106-0840-4df3-ad5e-c9d28e1447c5

📥 Commits

Reviewing files that changed from the base of the PR and between 212776e and f958658.

📒 Files selected for processing (1)
  • packages/sherpa-native/android/src/main/cpp/HappierSherpaNativeJni.cpp

Walkthrough

The Android JNI translation unit updates its include block to explicitly import <cstdint>, <memory>, and <vector>, with no exported declarations or JNI logic changes.

Changes

JNI include update

Layer / File(s) Summary
Explicit standard library headers
packages/sherpa-native/android/src/main/cpp/HappierSherpaNativeJni.cpp
The include block adds and reorders standard library headers used by the JNI implementation.

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

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is mostly empty and does not fill the required Summary, Why, How to test, Notes, or Checklist sections. Add the template sections with a brief summary, motivation, test steps, notes if any, and checklist items.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding missing includes in sherpa-native.
Linked Issues check ✅ Passed The change adds the missing C++ includes needed to fix the Android NDK 27 build failure in #201.
Out of Scope Changes check ✅ Passed The diff stays in the JNI include block and does not introduce unrelated code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@greptile-apps

greptile-apps Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds two missing standard library includes (<cstdint> and <vector>) to the Android JNI C++ file and reorders <memory> alphabetically. These headers are required for types actively used in the file — int32_t/int16_t (from <cstdint>) and std::vector<float>/std::vector<int16_t> (from <vector>) — and their absence would cause compilation failures on strict toolchains that do not provide these declarations transitively.

  • Adds <cstdint> for fixed-width integer types (int32_t, int16_t) used throughout the file in ProgressCallback, Pcm16LeToMonoFloats, and several JNI functions.
  • Adds <vector> for std::vector used in Pcm16LeToMonoFloats and nativePushAudioFrame.
  • Reorders <memory> to maintain alphabetical include ordering.

Confidence Score: 5/5

Minimal, targeted include additions that fix missing declarations required for types actively used in the file — safe to merge.

The change is limited to three lines in the include block: two headers are added that directly satisfy type dependencies already present in the file, and one header is reordered for consistency. No logic is changed, no new behavior is introduced, and all added includes correspond to concrete usages in the existing code.

No files require special attention.

Important Files Changed

Filename Overview
packages/sherpa-native/android/src/main/cpp/HappierSherpaNativeJni.cpp Adds missing <cstdint> and <vector> includes and reorders <memory> alphabetically; all three changes are correct and required.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["#include <cstdint> added"] --> B["int32_t / int16_t types"]
    C["#include <memory> reordered"] --> D["std::unique_ptr / std::make_unique"]
    E["#include <vector> added"] --> F["std::vector<float> / std::vector<int16_t>"]
    B --> G["ProgressCallback / Pcm16LeToMonoFloats / JNI functions"]
    D --> G
    F --> G
    G --> H["HappierSherpaNativeJni.cpp compiles correctly"]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["#include <cstdint> added"] --> B["int32_t / int16_t types"]
    C["#include <memory> reordered"] --> D["std::unique_ptr / std::make_unique"]
    E["#include <vector> added"] --> F["std::vector<float> / std::vector<int16_t>"]
    B --> G["ProgressCallback / Pcm16LeToMonoFloats / JNI functions"]
    D --> G
    F --> G
    G --> H["HappierSherpaNativeJni.cpp compiles correctly"]
Loading

Reviews (1): Last reviewed commit: "fix(sherpa-native): add missing includes" | Re-trigger Greptile

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.

fix(sherpa-native): Android build fails — HappierSherpaNativeJni.cpp missing #include <vector> (NDK 27 libc++)

1 participant