Skip to content

no-std Step 9 — CI job + smoke-test for no_std + alloc compile verification #422

Description

@Mec-iS

Part of #413feat: no-std feature flag for embedded/edge targets

Task

Add a CI job that proves smartcore builds on a real no_std + alloc target and does not silently re-acquire std coupling in future PRs.

Minimum viable CI (recommended first pass)

A compile-check against thumbv7m-none-eabi (ARM Cortex-M3, no OS, no std):

# .github/workflows/no-std.yml
name: no-std compile check
on: [push, pull_request]
jobs:
  no-std:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: thumbv7m-none-eabi
      - name: cargo check (no-std + alloc)
        run: cargo check --no-default-features --target thumbv7m-none-eabi

This requires no QEMU, no linker, no #[panic_handler] in the library crate itself — cargo check only verifies the dependency graph and type-checks.

Smoke-test example (stretch goal)

A minimal examples/no_std_knn.rs (or examples/no_std_logistic.rs) that runs KNN or LogisticRegression under QEMU-emulated ARM:

#![no_std]
#![no_main]
extern crate alloc;
use smartcore::neighbors::knn_classifier::KNNClassifier;
// ... minimal fit/predict with static data

Full QEMU run adds ~2–3 hrs of CI configuration (linker, arm-none-eabi-gcc or lld, #[panic_handler], QEMU install). Recommended as a follow-up once the compile-check gate is green.

Acceptance

  • A new GitHub Actions workflow file (e.g. .github/workflows/no-std.yml) runs cargo check --no-default-features --target thumbv7m-none-eabi on every push and PR
  • The workflow is green on main after all Steps 1–8 are merged
  • (Stretch) A smoke-test example compiles and runs on QEMU-emulated ARM in CI
  • Docs note the no_std path in the user guide or a new "Embedded / no-std" section

Estimated effort

  • Compile-check CI only: ~1–1.5 hrs
  • Full QEMU run: ~2–3 hrs additional

Dependencies

Blocked on Steps 1–8 all being merged. This is the final integration gate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions