Skip to content

[MAINTENANCE] Build system cleanup: remove unused libevent, consolidate dispatch scripts, fix version tracking #131

@yunlishao-vibe

Description

@yunlishao-vibe

Task Summary

The build system has accumulated technical debt: libevent is vendored but marked "Not currently used", dispatch scripts have grown organically without consistency, RealSimVersion.h.in uses the old branding, and the generate_version.ps1 script is disconnected from the dispatch pipeline.

Why is this needed?

  • CommonLib/libevent/ is a large vendored library (50+ headers) noted as "Not currently used" in dependencies.yaml — it should be removed from the repo or gated behind a proper optional flag
  • dispatch.bat calls scripts numbered 1–7 but the scripts are numbered 1–7 with gaps and naming inconsistencies (e.g., 5a_carmaker_components.ps1 vs 4_virtual_environment.bat)
  • scripts/generate_version.ps1 exists but is not called by dispatch.bat — version generation is a manual step
  • RealSimVersion.h.in uses REALSIM_VERSION_* prefix (tracked in issue [MAINTENANCE] Unify RealSim→FIXS branding in source code, logs, and comments #128 for renaming, but the version generation script also needs updating)
  • build_libsumo.ps1 and build_sumo_executables.ps1 are in scripts/ root but not integrated into dispatch.bat
  • The dispatch.bat build log goes to scripts/dispatch/build.log but there's no CI artifact collection

Scope of Work

1. Remove libevent from CommonLib

  • Remove CommonLib/libevent/ directory (50+ vendored headers, never used)
  • Remove libevent from dependencies.yaml
  • Remove libevent build from scripts/dispatch/1_external_libraries.bat
  • Verify no source files include libevent headers (grep across all .cpp/.h)
  • Add note to doc/BUILD.md about what libevent was and why removed

2. Fix dispatch script numbering and naming

  • Renumber scripts for consistency: 1-external, 2-core, 3-vissim, 4-carmaker, 5-dspace, 6-mex, 7-virtualenv, 8-buildinfo
  • Ensure dispatch.bat calls all scripts in correct order
  • Integrate scripts/generate_version.ps1 into the dispatch pipeline (call before build)
  • Document each script's purpose in doc/BUILD.md

3. Integrate libsumo build scripts

  • Move scripts/build_libsumo.ps1 and scripts/build_sumo_executables.ps1 into scripts/dispatch/ or document them as standalone utilities
  • Add them to BUILD.md with clear instructions on when to use them

4. Add auto-test

  • Add tests/Python/test_build_system.py that validates:
    • No libevent headers are included in any source file
    • All dispatch scripts exist and are referenced in dispatch.bat
    • dependencies.yaml is valid YAML and contains required keys
    • RealSimVersion.h (generated) exists after build with expected macro names

5. Update .gitignore

  • Ensure build/ output directory is properly gitignored (except prebuilt binaries intentionally committed)
  • Add *.log for build log files in scripts/dispatch/

Files Involved

  • CommonLib/libevent/ (delete)
  • dependencies.yaml
  • scripts/dispatch/*.bat, *.ps1
  • scripts/dispatch/dispatch.bat
  • scripts/generate_version.ps1
  • scripts/build_libsumo.ps1, scripts/build_sumo_executables.ps1
  • doc/BUILD.md
  • .gitignore
  • tests/Python/test_build_system.py (new)

Acceptance Criteria

  • CommonLib/libevent/ removed from repo
  • No source file includes libevent headers
  • Dispatch scripts consistently numbered and all called from dispatch.bat
  • generate_version.ps1 integrated into build pipeline
  • tests/Python/test_build_system.py passes
  • doc/BUILD.md updated to reflect changes

Branch and PR Target

  • All PRs for this issue should target the dev branch (not main)
  • First ensure main is merged into dev before starting work

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions