SafeAPI RBC 2oo2 Specific Application
Installer packaging and site-data libraries for the safeAPIRBC2oo2 reference RBC
Loading...
Searching...
No Matches
safeAPIRBC2oo2SA

Two roles, deliberately kept in one project:

  1. Installer packaging — packages safeAPIRBC2oo2GP's already-built binaries (and GA's/GP's own shared libraries) into self-extracting shell installers, one per distinct target platform/channel.
  2. Site-data static librariessa::site::gp and sa::site::ga, implementing the site-topology header contracts safeAPIRBC2oo2GP/safeAPIRBC2oo2GA each define for themselves (full RailML topology vs. a reduced route-only projection respectively).

"SA" is a naming coincidence leaned into on purpose: "the standalone installer/packaging counterpart to the app" and "Specific Application" in the railway-signaling sense.

Installer packaging

build_installers.sh reads etc/config/packaging.conf (per-role target/compiler-channel selection for A, B, and the Gateway roles — they may target different platforms, not just different compilers), resolves each role's already-built binary from safeAPIRBC2oo2GP's dist/<platform>[/<channel>]/bin/, and produces one self-extracting installer per distinct resolved target (dist/install/safeapi-rbc2oo2-<target>-installer.sh), bundling the shared libraries every role binary needs (libsafeapi_rbc2oo2_ga, libsafeapi_gp) alongside them. Does not build source itself — run safeAPIRBC2oo2TestEnv/etc/scripts/build_toolchains.sh (and build_channels.sh for compiler-diversity builds) first.

./build_installers.sh # config-driven, from packaging.conf
./build_installers.sh -c /path/to/other.conf # a different config
./build_installers.sh -a # sweep every known target, skip what isn't built

Each generated installer runs four phases on the target machine: precheck (OS/arch match, libc presence), extract + install (to $PREFIX, default /opt/safeapi-rbc2oo2), postcheck (actually runs every installed binary with no args and checks for usage: output — proves the dynamic linker really resolved everything, not just that the files exist), next steps.

show_product_structure.sh gives a read-only report of what build_installers.sh would currently package — role → target → binary → size → CRC64/SHA-256 — without actually packaging anything (-j for JSON).

Site-data libraries

src/ab_siteGP.c implements safeAPIRBC2oo2GP/include/ab_siteGP.h (sa::site::gp, the full topology); src/ab_siteGA.c implements safeAPIRBC2oo2GA/include/ab_siteGA.h (sa::site::ga, the reduced route-only projection). This project reaches into GP's and GA's own include/ directories to compile against headers it doesn't own (SAPI_RBC2OO2GP_DIR/SAPI_RBC2OO2GA_DIR) — a genuine two-way dependency (GP/GA need this project's compiled library; this project needs their headers) that can't be expressed as a single Conan requires, so the header paths are supplied as required Conan options instead. The two tables deliberately use non-colliding symbol names (ab_site_track_layout vs. ab_site_ga_track_layout) — sharing a name let one shared library's copy interpose the other's at load time on Linux, corrupting every route lookup (see CLAUDE.md for the full story).

Docker

Dockerfile (context: the SAPI workspace root) builds the RBC container image used by safeAPIRBC2oo2TestEnv/docker-compose.yml's six A/B/C×WEST/EAST services: it compiles safeAPIRBC2oo2GP (pulling in the framework, backend, and GA), generates a Docker-specific packaging.conf, runs build_installers.sh, and then actually runs the generated installer before the runtime stage copies /app/. A broken installer or a missing shared-library dependency fails the Docker build loudly instead of shipping something unproven.

Building

cmake -S . -B build \
-DSAPI_RBC2OO2GP_DIR=../safeAPIRBC2oo2GP -DSAPI_RBC2OO2GA_DIR=../safeAPIRBC2oo2GA
cmake --build build
cmake --install build --prefix . # -> dist/<platform>/

Honest limits

App binaries only (safeAPIFreamwork itself isn't packaged — it's a build-time dependency, not something an end user installs separately). No OS-native package-manager integration (.deb/.rpm/ .apk) yet. No code signing or embedded checksum manifest in the installer itself. No installer for QNX/FreeRTOS targets (no app can be built for either yet).