Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 19 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Instead:
- Easy addition of new compilers or versions


## Using Toolchains in a Bazel Module
## Using Toolchains in a different Bazel Module

### GCC Example (Linux x86_64)

Expand All @@ -88,23 +88,31 @@ gcc.use(
use_default_package = True,
)
use_repo("score_gcc_toolchain", "score_gcc_toolchain_pkg")
registry_toolchains("x86_64-linux-gcc-12.2.0")
```

### QCC Example (QNX ARM64)

```starlark
bazel_dep(name = "score_cpp_toolchains", version = "0.1.0")
use_extension("@score_cpp_toolchains//bazel/extentions:gcc.bzl", "qcc")
gcc.use(
qcc.use(
target_cpu = "arm64",
sdp_version = "8.0.0",
use_default_package = True,
)
use_repo("score_qcc_toolchain", "score_qcc_toolchain_pkg")
registry_toolchains("x86_64-linux-qcc-12.2.0")
```

The registration of toolchains is done by adding command line option `--extra_toolchains=@<toolchain_repo>//:toolchain_name`
In case above this would be:
```bash
--extra_toolchains=@score_gcc_toolchain//:x86_64-linux-gcc-12.2.0
--extra_toolchains=@score_qcc_toolchain//:x86_64-linux-qcc-12.2.0
```

> NOTE: In case that more than one toolchain needs to be defined, the registration must be protected via config flags otherwise</br>
the first toolchain that matches constraints will be selected by toolchain resolutions.

## Configuration Flags

Shared flag sets live under:
Expand Down Expand Up @@ -137,24 +145,15 @@ These templates simplify adding:

## Testing and Validation

Every toolchain must pass mandatory tests under `tests/`.

### Test Types

| Test Type | Purpose |
|-----------|---------|
| Smoke tests | Validate tool presence |
| Feature tests | Verify compiler/linker capabilities |
| Integration tests | Validate Bazel builds using the toolchain |

Tests cover:
Testing is part of the **integration gate pipeline**.

- Simple compilation (`main.cpp`)
- pthread linking (`main_pthread.cpp`)
- Toolchain registration behavior
## Examples

Testing is part of the **integration gate pipeline**.
Example cover:

- Simple compilation ( [examples/main.cpp](./examples/main.cpp))
- pthread linking ([examples/main_pthread.cpp](./examples/main_pthread.cpp))
- Toolchain registration behavior ([examples/.bazelrc](./examples/.bazelrc))

# Documentation

Expand All @@ -166,8 +165,7 @@ Documentation uses **Sphinx** and lives in `docs/`.
2. Add a package descriptor (e.g., `packages/linux/x86_64/gcc/13.1.0`)
3. Generate configuration from templates
4. Update flags if needed
5. Run tests: `bazel test //tests/...`
6. Submit through integration gate
5. Submit through integration gate

---

Expand Down
6 changes: 5 additions & 1 deletion tests/.bazelrc → examples/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

# -------------------------------------------------------------------------------
# Link to S-CORE Bazel Registry
# -------------------------------------------------------------------------------
common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/
common --registry=https://bcr.bazel.build

# Shared configuration for simple test execution
# -------------------------------------------------------------------------------
# Shared configuration for simple example execution
# -------------------------------------------------------------------------------
build:shared --incompatible_strict_action_env
build:shared --sandbox_writable_path=/var/tmp
build:shared --host_platform=@score_bazel_platforms//:x86_64-linux
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.