How wind-river/vxworks7-ros2-build works
Project type and purpose
• This is a build‐automation and packaging toolchain for cross‐compiling ROS 2 on the VxWorks 7 RTOS. It provides:
• A GitHub repository with Makefiles, CMake toolchains, patches, and a “pkg” directory of third‐party packages
• Docker images and entrypoints to host the build
• CI/CD workflows (GitHub Actions) to produce prebuilt images and artifacts
• QEMU and Raspberry Pi targets for testing
File structure
• Top‐level:
• .github (CI workflows + custom Actions)
• Docker (Ubuntu 18.04 & 22.04 images for vxbuild and vxros2build)
• buildspecs (CMake toolchain definitions for cross‐compile)
• mk (shared Make rules)
• pkg (subdirectories for each dependency: asio, colcon, eigen, ros2, turtlebot3, unixextra, sdk, etc.)
• tests (expect scripts driving QEMU/emulator tests)
• Makefile, README.md
• “pkg” is a plugin‐style directory: each subfolder contains its own Makefile/patches, consumed by the master Makefile.
• Dockerfiles define the build environment (wruser, environment variables, entrypoints).
README for additional insights
• The project orchestrates:
• Downloading a VxWorks SDK (local volume mount)
• Building each pkg via Make/CMake inside Docker (/work/pkg → /work/output/build)
• Exporting artifacts (/work/output/export/{root,deploy})
• Optionally assembling a QEMU disk image and launching vxWorks for smoke tests
• CI workflows automate Docker image builds and publish prebuilt artifacts.
a. Main components
1. Developer Host
2. Git Repository & CI (GitHub, Actions)
3. Docker Engine
4. Docker Containers
– vxbuild image (installs SDK, host tools)
– vxros2build image (ROS 2 dependencies + colcon + entrypoint)
5. VxWorks SDK Volume
6. Source Code (this repo)
7. Build Orchestrator
– Makefile + mk/*.mk
– CMake toolchain (buildspecs/cmake/toolchain.cmake)
– colcon (for ROS 2 workspace)
8. Package Modules (pkg/*)
9. External Git/Bitbucket (ROS 2, patches, upstream packages)
10. Build Output
– output/build (per‐pkg artifacts)
– output/downloads (third‐party sources)
– output/export/root & deploy (install trees)
11. Test Harness
– QEMU emulator or Raspberry Pi target
– tests/*.exp scripts driving smoke tests
b. Relationships and interactions
– Developer → Git Repo (clone/push)
– GitHub Actions → Docker build (ci pipelines)
– Developer & CI → Docker Engine (build images, run containers)
– Docker Container mounts:
• /wrsdk (VxWorks SDK)
• /work (source tree)
– Inside container:
• Make orchestrates pkg builds (reads mk rules, calls CMake, colcon)
• Downloads upstream sources (git://github.com, bitbucket) into output/downloads
• Applies patches from layer repo into output/build/ros2/patches
– Builds ROS 2 workspace via colcon → output/build/ros2/ros2_ws
– Build Output flows into:
• export/root (headers, dev artifacts)
• export/deploy (binaries, libs, vxscript)
– Test Harness:
• Create IMG via dd + mkfs → mount export/deploy → copy → boot QEMU
• tests/*.exp run through telnet or serial to exercise examples
c. Architectural patterns & design principles
– Layered / plugin architecture: “pkg” modules are loosely coupled, defined by Makefiles
– “Orchestrator” pattern: a top‐level Makefile delegates to sub‐packages
– Containerization: isolate host dependencies via Docker images
– Infrastructure as Code: CI workflows define repeatable pipelines
d. Key technologies & frameworks
– GitHub Actions (CI/CD)
– Docker & Dockerfiles
– Make + mk/*.mk (build orchestrator)
– CMake toolchain (cross‐compile)
– colcon (ROS 2 build tool)
– QEMU / Raspberry Pi (runtime tester)
– Python scripts (Wget/Curl automations, custom GitHub Action)
Detail level & separation
• Break the system into:
1. Source & CI layer
2. Containerized build environment layer
3. Orchestrator & pkg module layer
4. Output & packaging layer
5. Test & deployment layer
• Data flows: code → build → artifacts → test.