The examples/ directory is a separate Bazel workspace used as a lightweight
integration test bed for the repository.
It demonstrates how consumers declare toolchains while also serving as the main smoke-test surface for validating that the generated toolchains can build and, where appropriate, run example targets.
These examples are intended only for sanity testing global changes on the module extension side. They are not a reference point for full platform setup. For a proper build on a dedicated platform, consumers must consult the relevant platform developers and owners rather than relying on these examples as a platform configuration guide.
examples/MODULE.bazel
Declares representative Linux and QNX toolchain repositories and wires the
example workspace back to the local checkout with local_path_override.
examples/.bazelrc
Defines named Bazel configurations that activate the generated toolchains and platforms.
examples/BUILD
Contains small C++ targets used to verify compilation, linking, pthread support, and sanitizer integration.
examples/test.sh
Matrix runner that maps each configuration name to a small build or test sequence.
The example workspace currently validates these configuration groups:
- Linux host toolchains
- Linux cross-compilation toolchains
- runtime-specific Linux toolchains such as AutoSD and EB corbos Linux for Safety Applications
- packaged QNX toolchains
The smoke-test runner isolates Bazel state per configuration so it does not
rely on bazel clean --expunge between cases.
cd examples
./test.sh --list
./test.sh host_config_1
./test.sh --keep-goingAs stated before, the example workspace is not intended to be an exhaustive compiler correctness suite. Instead, it answers a narrower question: did the configuration repository produce a usable toolchain definition for each supported scenario?
In practice this means checking among other things:
- successful compilation with the selected compiler and sysroot,
- correct toolchain registration and platform matching,
- basic linking behavior,
- feature coverage such as pthread-enabled builds,
- optional sanitizer feature wiring for the local Linux toolchain path.