Skip to content

fix: resolve 7 bugs in graph, config-gen, rootfs, and CLI#19

Merged
srpatcha merged 2 commits intomasterfrom
fix/bugs-and-improvements
Apr 17, 2026
Merged

fix: resolve 7 bugs in graph, config-gen, rootfs, and CLI#19
srpatcha merged 2 commits intomasterfrom
fix/bugs-and-improvements

Conversation

@hshanmug12
Copy link
Copy Markdown
Contributor

Summary

  • graph.py - Remove 13 lines of dead code in topological_sort(): first in_degree dict and setdefault loop were immediately overwritten.
  • eos_config_generator.py - Enforce 8 KiB floor on stage0_size to prevent undersized bootloader slots on small-flash MCUs.
  • eos_config_generator.py - Add _flash_base_for() helper so nRF52 (0x00000000) and RP2040 (0x10000000) get correct flash base instead of hardcoded STM32 0x08000000.
  • eos_config_generator.py - Expand toolchain prefix map to arm64/aarch64/riscv64/x86_64/mips; remove dead BLE no-op.
  • rootfs.py - Reject home paths containing '..' to prevent directory traversal out of rootfs sandbox.
  • commands.py - Replace str.replace('', '/') with Path.as_posix() for correct cross-platform CMake paths.
  • commands.py - Raise BuildError when a recipe dependency was not built instead of silently skipping it.

Test plan

  • pytest tests/ebuild/test_eos_ai.py - 23/23 passed (WSL Ubuntu)
  • pytest tests/ebuild/test_cortex_r5_integration.py - 32 passed, 101 skipped (WSL Ubuntu)
  • Smoke tests: flash base assertions, topological sort, cycle detection, directory traversal rejection - all passed
  • Python syntax check on all 4 modified files - no errors

Generated with Claude Code

hshanmug12 and others added 2 commits April 13, 2026 22:51
- graph.py: remove 13 lines of dead code in topological_sort()
  (first in_degree dict + setdefault loop were overwritten immediately)
- eos_config_generator.py: enforce 8 KiB floor on stage0_size so
  128 KiB MCUs don't silently produce a 4 KiB bootloader slot
- eos_config_generator.py: add arch-aware _flash_base_for() helper
  so nRF52 (0x00000000) and RP2040 (0x10000000) get correct bases
  instead of the STM32-only hardcoded 0x08000000
- eos_config_generator.py: expand toolchain prefix map to cover arm64,
  aarch64, riscv64, x86_64, mips; remove dead 'if ble: pass' no-op
- rootfs.py: reject home paths containing '..' to prevent directory
  traversal out of the rootfs sandbox
- commands.py: replace str.replace('\', '/') with Path.as_posix()
  for correct cross-platform CMake path generation
- commands.py: raise BuildError when a recipe's declared dependency
  was not built, instead of silently omitting it from dep_dirs

All 55 tests pass (23 unit + 32 integration) in WSL Ubuntu.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@srpatcha srpatcha enabled auto-merge (squash) April 17, 2026 06:27
@srpatcha srpatcha merged commit a0ecc3c into master Apr 17, 2026
24 checks passed
@srpatcha srpatcha deleted the fix/bugs-and-improvements branch April 17, 2026 06:49
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