Part of #413 — feat: 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
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.
Part of #413 —
feat: no-std feature flag for embedded/edge targetsTask
Add a CI job that proves smartcore builds on a real
no_std + alloctarget and does not silently re-acquirestdcoupling in future PRs.Minimum viable CI (recommended first pass)
A compile-check against
thumbv7m-none-eabi(ARM Cortex-M3, no OS, nostd):This requires no QEMU, no linker, no
#[panic_handler]in the library crate itself —cargo checkonly verifies the dependency graph and type-checks.Smoke-test example (stretch goal)
A minimal
examples/no_std_knn.rs(orexamples/no_std_logistic.rs) that runs KNN or LogisticRegression under QEMU-emulated ARM:Full QEMU run adds ~2–3 hrs of CI configuration (linker,
arm-none-eabi-gccorlld,#[panic_handler], QEMU install). Recommended as a follow-up once the compile-check gate is green.Acceptance
.github/workflows/no-std.yml) runscargo check --no-default-features --target thumbv7m-none-eabion every push and PRmainafter all Steps 1–8 are mergedno_stdpath in the user guide or a new "Embedded / no-std" sectionEstimated effort
Dependencies
Blocked on Steps 1–8 all being merged. This is the final integration gate.