Skip to content

Commit 437ea53

Browse files
committed
Convert all .rst into markdown
1 parent 5f27b23 commit 437ea53

18 files changed

Lines changed: 662 additions & 665 deletions

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,16 @@ Example cover:
154154

155155
# Documentation
156156

157-
Documentation uses **Sphinx** and lives in `docs/`. (Not yet prepared!)
157+
The documentation lives in `docs/` as Markdown sources rendered by Sphinx.
158+
159+
- [Documentation index](docs/index.md)
160+
- [Overview](docs/overview.md)
161+
- [Repository layout](docs/repository_layout.md)
162+
- [Extension API](docs/extension_api.md)
163+
- [Generation flow](docs/generation_flow.md)
164+
- [Examples and validation](docs/examples_and_validation.md)
165+
- [QNX integration](docs/qnx_integration.md)
166+
- [Maintenance](docs/maintenance.md)
158167

159168
# QNX License
160169

docs/conf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@
1717
version = "0.1"
1818

1919
_optional_extensions = [
20+
"myst_parser",
2021
"sphinxcontrib.plantuml",
2122
"score_sphinx_bundle",
2223
]
2324

2425
extensions = [
2526
ext for ext in _optional_extensions if importlib.util.find_spec(ext) is not None
2627
]
28+
29+
source_suffix = {
30+
".md": "markdown",
31+
}

docs/examples_and_validation.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<!--
2+
# *******************************************************************************
3+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
4+
#
5+
# See the NOTICE file(s) distributed with this work for additional
6+
# information regarding copyright ownership.
7+
#
8+
# This program and the accompanying materials are made available under the
9+
# terms of the Apache License Version 2.0 which is available at
10+
# https://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# SPDX-License-Identifier: Apache-2.0
13+
# *******************************************************************************
14+
-->
15+
16+
# Examples And Validation
17+
18+
## Example Workspace Purpose
19+
20+
The `examples/` directory is a separate Bazel workspace used as a lightweight
21+
integration test bed for the repository.
22+
23+
It demonstrates how consumers declare toolchains while also serving as the main
24+
smoke-test surface for validating that the generated toolchains can build and,
25+
where appropriate, run example targets.
26+
27+
## Important Files
28+
29+
`examples/MODULE.bazel`
30+
31+
Declares representative Linux and QNX toolchain repositories and wires the
32+
example workspace back to the local checkout with `local_path_override`.
33+
34+
`examples/.bazelrc`
35+
36+
Defines named Bazel configurations that activate the generated toolchains and
37+
platforms.
38+
39+
`examples/BUILD`
40+
41+
Contains small C++ targets used to verify compilation, linking, pthread
42+
support, and sanitizer integration.
43+
44+
`examples/tests/toolchain_smoke_tests.sh`
45+
46+
Matrix runner that maps each configuration name to a small build or test
47+
sequence.
48+
49+
## Smoke-Test Matrix
50+
51+
The example workspace currently validates these configuration groups:
52+
53+
- Linux host toolchains
54+
- Linux cross-compilation toolchains
55+
- runtime-specific Linux toolchains such as AutoSD and EB corbos Linux for Safety Applications
56+
- packaged QNX toolchains
57+
- locally built QNX SDP toolchains
58+
59+
The smoke-test runner isolates Bazel state per configuration so it does not
60+
rely on `bazel clean --expunge` between cases.
61+
62+
## Useful Commands
63+
64+
```bash
65+
cd examples
66+
./test.sh --list
67+
./test.sh host_config_1
68+
./test.sh --keep-going
69+
```
70+
71+
## What The Tests Prove
72+
73+
The example workspace is not intended to be an exhaustive compiler correctness
74+
suite. Instead, it answers a narrower question: did the configuration
75+
repository produce a usable toolchain definition for each supported scenario?
76+
77+
In practice this means checking:
78+
79+
- successful compilation with the selected compiler and sysroot,
80+
- correct toolchain registration and platform matching,
81+
- basic linking behavior,
82+
- feature coverage such as pthread-enabled builds,
83+
- optional sanitizer feature wiring for the local Linux toolchain path.

docs/examples_and_validation.rst

Lines changed: 0 additions & 84 deletions
This file was deleted.

docs/extension_api.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
<!--
2+
# *******************************************************************************
3+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
4+
#
5+
# See the NOTICE file(s) distributed with this work for additional
6+
# information regarding copyright ownership.
7+
#
8+
# This program and the accompanying materials are made available under the
9+
# terms of the Apache License Version 2.0 which is available at
10+
# https://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# SPDX-License-Identifier: Apache-2.0
13+
# *******************************************************************************
14+
-->
15+
16+
# Extension API
17+
18+
## Consumer Entry Point
19+
20+
Consumers interact with this repository through the `gcc` module extension in
21+
`@score_bazel_cpp_toolchains//extensions:gcc.bzl`.
22+
23+
Typical usage looks like this:
24+
25+
```starlark
26+
bazel_dep(name = "score_bazel_cpp_toolchains", version = "0.4.0")
27+
28+
gcc = use_extension("@score_bazel_cpp_toolchains//extensions:gcc.bzl", "gcc")
29+
30+
gcc.toolchain(
31+
name = "score_gcc_toolchain",
32+
target_cpu = "x86_64",
33+
target_os = "linux",
34+
version = "12.2.0",
35+
use_default_package = True,
36+
)
37+
38+
use_repo(gcc, "score_gcc_toolchain")
39+
```
40+
41+
## Public Tags
42+
43+
`gcc.toolchain(...)`
44+
45+
Declares a toolchain repository to generate.
46+
47+
`gcc.sdp(...)`
48+
49+
Declares a package repository explicitly. This is used when the package is not
50+
taken from the default version matrix or when local QNX SDP generation is
51+
required.
52+
53+
## `gcc.toolchain(...)` Attributes
54+
55+
Required attributes:
56+
57+
- `name`: name of the generated repository
58+
- `target_cpu`: target CPU, currently `x86_64` or `aarch64`
59+
- `target_os`: target OS, currently `linux` or `qnx`
60+
61+
Common package selection attributes:
62+
63+
- `use_default_package`: resolve package metadata from `packages/version_matrix.bzl`
64+
- `version`: GCC version string for Linux toolchains
65+
- `sdp_version`: QNX SDP version string
66+
- `sdk_version`: alternative SDK identifier used in matrix resolution
67+
- `sdp_to_link`: override the package repository name that the toolchain uses
68+
69+
Flag and runtime attributes:
70+
71+
- `extra_compile_flags`
72+
- `extra_c_compile_flags`
73+
- `extra_cxx_compile_flags`
74+
- `extra_link_flags`
75+
- `ld_library_paths`
76+
- `runtime_ecosystem`
77+
- `use_base_constraints_only`
78+
79+
QNX-specific attributes:
80+
81+
- `license_path`
82+
- `license_info_variable`
83+
- `license_info_url`
84+
85+
## `gcc.sdp(...)` Attributes
86+
87+
The `gcc.sdp` tag defines the package side of the toolchain setup. Important
88+
attributes are:
89+
90+
- `name`: repository name for the package
91+
- `build_file`: BUILD file that exposes the package contents as Bazel targets
92+
- `url` and `sha256`: archive or installer source
93+
- `strip_prefix`: extraction prefix for packaged archives
94+
- `mode`: `archive` or `build`
95+
- `patchset`: QNX SDP patchset definition used in build mode
96+
- `target_cpu`: target CPU used when building an SDP locally
97+
98+
## Activation In A Workspace
99+
100+
Declaring a toolchain repository is not enough on its own. Consumers still need
101+
to activate the generated toolchain during Bazel analysis, typically with a
102+
configuration such as:
103+
104+
```text
105+
--extra_toolchains=@score_gcc_toolchain//:x86_64-linux-gcc_12.2.0
106+
```
107+
108+
The example workspace under `examples/` provides complete `.bazelrc`
109+
configurations for this activation step.
110+
111+
## Behavior Notes
112+
113+
- The extension is intended for the root module.
114+
- When `use_default_package` is enabled, the version matrix can inject extra
115+
include and link flags required by non-standard sysroot layouts.
116+
- QNX toolchains use additional licensing and include-path parameters that do
117+
not apply to Linux toolchains.

0 commit comments

Comments
 (0)